diff --git a/gen164/5/ed_puck.c b/gen164/5/ed_puck.c index e20d7f2a3d..76e6ff448f 100644 --- a/gen164/5/ed_puck.c +++ b/gen164/5/ed_puck.c @@ -16,13 +16,16 @@ c3_y pub_y[32]; c3_y sec_y[64]; c3_y sed_y[32]; + c3_y mes_y; u2_noun a = u2_frag(u2_cv_sam, cor); if ( (u2_none == a) || (u2_no == u2_stud(a)) ) { return u2_bl_bail(wir_r, c3__exit); } - u2_cr_bytes(0, 32, sed_y, a); + mes_y = u2_met(3, a); + memset(sed_y, 0, 32); + u2_cr_bytes(0, mes_y, sed_y, a); ed25519_create_keypair(pub_y, sec_y, sed_y); return u2_ci_bytes(32, pub_y); } diff --git a/gen164/5/ed_sign.c b/gen164/5/ed_sign.c index 687425dbb2..b0d5f41e5a 100644 --- a/gen164/5/ed_sign.c +++ b/gen164/5/ed_sign.c @@ -15,28 +15,24 @@ u2_noun b) // retain { c3_y sig_y[64]; - c3_y sec_y[32]; - c3_y pub_y[32]; c3_y sed_y[32]; - - c3_w secm_w = u2_met(3, b); + c3_y pub_y[64]; + c3_y sec_y[64]; c3_w mesm_w = u2_met(3, a); + c3_w mess_w = u2_met(3, b); c3_y* mes_y = 0; + memset(sig_y, 0, 64); + memset(sed_y, 0, 32); + memset(pub_y, 0, 64); + memset(sec_y, 0, 64); - if ( 64 < secm_w ) { - return u2_bl_bail(wir_r, c3__exit); - } - memset(&sig_y, 64, 0); - memset(&pub_y, 32, 0); - - mes_y = c3_malloc(mesm_w); - memset(sec_y, 0, 32); + mes_y = malloc(mesm_w); u2_cr_bytes(0, mesm_w, mes_y, a); - u2_cr_bytes(0, 32, sed_y, b); + u2_cr_bytes(0, mess_w, sed_y, b); ed25519_create_keypair(pub_y, sec_y, sed_y); ed25519_sign(sig_y, mes_y, mesm_w, pub_y, sec_y); diff --git a/gen164/5/ed_veri.c b/gen164/5/ed_veri.c index a15e0aff9e..a40696600b 100644 --- a/gen164/5/ed_veri.c +++ b/gen164/5/ed_veri.c @@ -16,17 +16,19 @@ u2_noun pk) { c3_y sig_y[64]; - c3_y pub_y[32]; + c3_y pub_y[64]; + c3_w ret; c3_y* mes_y; c3_w mesm_w = u2_met(3, s); - c3_w ret; - memset(&sig_y, 64, 0); - memset(&pub_y, 32, 0); + + memset(sig_y, 0, 64); + memset(pub_y, 0, 64); + mes_y = c3_malloc(mesm_w); u2_cr_bytes(0, 64, sig_y, s); - u2_cr_bytes(0, 32, pub_y, pk); + u2_cr_bytes(0, 64, pub_y, pk); u2_cr_bytes(0, mesm_w, mes_y, m); ret = ed25519_verify(sig_y, mes_y, mesm_w, pub_y) == 1 ? u2_yes : u2_no;