Skip to content

Commit 9839405

Browse files
author
gefeili
committed
Minor refactor on MayoSigner.
1 parent b7e747a commit 9839405

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

core/src/main/java/org/bouncycastle/pqc/crypto/mayo/MayoSigner.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,11 @@ public byte[] generateSignature(byte[] message)
131131
// Generate S = seed_pk || (additional bytes), using SHAKE256.
132132
// Output length is param_pk_seed_bytes + param_O_bytes.
133133
shake.update(seed_sk, 0, seed_sk.length);
134-
shake.doFinal(seed_pk, 0, pk_seed_bytes + oBytes);
134+
shake.doFinal(seed_pk, 0, totalS);
135135

136136
// Decode the portion of S after the first param_pk_seed_bytes into O.
137137
// (In C, this is: decode(S + param_pk_seed_bytes, O, param_v * param_o))
138-
Utils.decode(seed_pk, pk_seed_bytes, O, 0, v * o);
138+
Utils.decode(seed_pk, pk_seed_bytes, O, 0, O.length);
139139

140140
// Expand P1 and P2 into the long array P using seed_pk.
141141
Utils.expandP1P2(params, P, seed_pk);

0 commit comments

Comments
 (0)