Skip to content

Commit

Permalink
Merge pull request #8004 from SparkiDev/dilithium_fixes_1
Browse files Browse the repository at this point in the history
Dilithium: fixes
  • Loading branch information
JacobBarthelmeh authored Sep 30, 2024
2 parents 113a61c + 67528f9 commit ee7f02b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions wolfcrypt/src/dilithium.c
Original file line number Diff line number Diff line change
Expand Up @@ -3411,7 +3411,7 @@ static int dilithium_check_hint(const byte* h, byte k, byte omega)
}
}
/* Ensure the last hint is less than the current hint. */
else if (h[i - 1] > h[i]) {
else if (h[i - 1] >= h[i]) {
ret = SIG_VERIFY_E;
break;
}
Expand Down Expand Up @@ -9654,7 +9654,7 @@ int wc_Dilithium_PublicKeyDecode(const byte* input, word32* inOutIdx,
ret = dilitihium_get_der_length(input, &idx, &length, inSz);
}
if (ret == 0) {
if (input[idx] != 0) {
if ((input[idx] != 0) || (length == 0)) {
ret = ASN_PARSE_E;
}
idx++;
Expand Down

0 comments on commit ee7f02b

Please sign in to comment.