From d139927d00437f502ec334910aefea1b7b097a1b Mon Sep 17 00:00:00 2001 From: h Date: Sun, 6 Aug 2023 16:57:46 -0400 Subject: [PATCH] did basic sigs --- src/mayo.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/mayo.rs b/src/mayo.rs index a7bc485..a2f16fd 100644 --- a/src/mayo.rs +++ b/src/mayo.rs @@ -134,6 +134,7 @@ where [(); k(L) * n(L)]:, [(); m(L)]:, [(); m(L) / 2]:, + [(); (k(L) * n(L) + 1) / 2]:, [(); k(L) * v_bytes(L) + ((k(L) * o(L) + 1) / 2)]:, [(); salt_bytes(L) + o_bytes(L) + p1_bytes(L) + l_bytes(L)]:, [(); digest_bytes(L)]:, @@ -233,12 +234,14 @@ where let s = Mat([[0; k(L) * n(L)]; 1]); for i in 0..(k(L)) { - s.0[0][(i * n(L))..((i + 1) * n(L) - o(L))] = - (vv[i].tp() + Mat([(om.mul_right(x)).0[(i * o(L))..((i + 1) * o(L))]; 1])).0[0]; - s.0[0][((i + 1) * n(L) - o(L))..((i + 1) * n(L))] = x.0[(i * o(L))..((i + 1) * o(L))]; + s.0[0][(i * n(L))..((i + 1) * n(L) - o(L))].copy_from_slice( + &(vv[i] + (om.mul_right(Mat([x.0[(i * o(L))..((i + 1) * o(L))]; 1]).tp()))).0[0], + ); + s.0[0][((i + 1) * n(L) - o(L))..((i + 1) * n(L))] + .copy_from_slice(&x.0[(i * o(L))..((i + 1) * o(L))]); } - let sig = encode_vec(s.tp()).to_vec(); + let sig = encode_vec::<{ k(L) * n(L) }>(s.tp()).to_vec(); for i in salt { sig.push(i);