Skip to content

Commit ee7f02b

Browse files
Merge pull request #8004 from SparkiDev/dilithium_fixes_1
Dilithium: fixes
2 parents 113a61c + 67528f9 commit ee7f02b

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

wolfcrypt/src/dilithium.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3411,7 +3411,7 @@ static int dilithium_check_hint(const byte* h, byte k, byte omega)
34113411
}
34123412
}
34133413
/* Ensure the last hint is less than the current hint. */
3414-
else if (h[i - 1] > h[i]) {
3414+
else if (h[i - 1] >= h[i]) {
34153415
ret = SIG_VERIFY_E;
34163416
break;
34173417
}
@@ -9654,7 +9654,7 @@ int wc_Dilithium_PublicKeyDecode(const byte* input, word32* inOutIdx,
96549654
ret = dilitihium_get_der_length(input, &idx, &length, inSz);
96559655
}
96569656
if (ret == 0) {
9657-
if (input[idx] != 0) {
9657+
if ((input[idx] != 0) || (length == 0)) {
96589658
ret = ASN_PARSE_E;
96599659
}
96609660
idx++;

0 commit comments

Comments
 (0)