provide big enough buffers for the ed jets

This commit is contained in:
~hatteb-mitlyd 2014-04-18 15:34:16 -07:00
parent 717c61a6dc
commit d671b6659f
3 changed files with 20 additions and 19 deletions

View File

@ -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);
}

View File

@ -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);

View File

@ -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;