Skip to content

Commit bb67069

Browse files
committed
Kyber original: fix to work
Encapsulate the message (hash of rand) for original. Final of FIPS 203 uses rand.
1 parent bc68819 commit bb67069

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

wolfcrypt/src/wc_kyber.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,11 @@ int wc_KyberKey_EncapsulateWithRandom(KyberKey* key, unsigned char* ct,
630630

631631
if (ret == 0) {
632632
/* Encapsulate the message using the key and the seed (coins). */
633+
#ifdef WOLFSSL_KYBER_ORIGINAL
634+
ret = kyberkey_encapsulate(key, msg, kr + KYBER_SYM_SZ, ct);
635+
#else
633636
ret = kyberkey_encapsulate(key, rand, kr + KYBER_SYM_SZ, ct);
637+
#endif
634638
}
635639

636640
#ifdef WOLFSSL_KYBER_ORIGINAL

0 commit comments

Comments
 (0)