This commit is contained in:
y4my4my4m 2023-12-27 20:57:25 -05:00
parent 3577319d2e
commit 835a239920

View file

@ -8,7 +8,11 @@ class gf {
U8 _0[16]; U8 _0[16];
U8 _9[32] = {9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; U8 _9[32] = {9, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0
};
gf gf0; gf gf0;
@ -663,7 +667,16 @@ I64 crypto_hashblocks(U8 *x, U8 *m, U64 n) {
return n; return n;
} }
static U8 iv[64] = {
0x6a,0x09,0xe6,0x67,0xf3,0xbc,0xc9,0x08,
0xbb,0x67,0xae,0x85,0x84,0xca,0xa7,0x3b,
0x3c,0x6e,0xf3,0x72,0xfe,0x94,0xf8,0x2b,
0xa5,0x4f,0xf5,0x3a,0x5f,0x1d,0x36,0xf1,
0x51,0x0e,0x52,0x7f,0xad,0xe6,0x82,0xd1,
0x9b,0x05,0x68,0x8c,0x2b,0x3e,0x6c,0x1f,
0x1f,0x83,0xd9,0xab,0xfb,0x41,0xbd,0x6b,
0x5b,0xe0,0xcd,0x19,0x13,0x7e,0x21,0x79
};
I64 crypto_hash(U8 *out, U8 *m, U64 n) { I64 crypto_hash(U8 *out, U8 *m, U64 n) {
U8 h[64], x[256]; U8 h[64], x[256];
@ -690,11 +703,7 @@ I64 crypto_hash(U8 *out, U8 *m, U64 n) {
} }
// FIXME: cant predefine p[4][16] like that!!!
// copilot from here:
U0 add(U16 p[4][16], U16 q[4][16]) U0 add(U16 p[4][16], U16 q[4][16])
{ {
U16 a[16], b[16], c[16], d[16], t[16], e[16], f[16], g[16], h[16]; U16 a[16], b[16], c[16], d[16], t[16], e[16], f[16], g[16], h[16];