-
Notifications
You must be signed in to change notification settings - Fork 849
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ML-KEM/Kyber: improvements #8467
Conversation
11b6e3a
to
255afc9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
./configure CC="clang-15 -fsanitize=address" --enable-kyber=make
CC examples/benchmark/tls_bench.o
src/tls.c:7998:39: error: unused parameter 'type' [-Werror,-Wunused-parameter]
static int kyber_id2type(int id, int *type)
^
1 error generated.
Similar warning with ./configure CC="clang-15 -fsanitize=address" --enable-kyber=enc
./configure CC="clang-15 -fsanitize=address" --enable-kyber=dec
wolfcrypt/src/wc_kyber.c:1207:30: error: variable 'compVecSz' is uninitialized when used here [-Werror,-Wuninitialized]
const byte* c2 = c + compVecSz;
^~~~~~~~~
wolfcrypt/src/wc_kyber.c:1138:27: note: initialize the variable 'compVecSz' to silence this warning
unsigned int compVecSz;
^
= 0
1 error generated.
make[2]: *** [Makefile:8200: wolfcrypt/src/src_libwolfssl_la-wc_kyber.lo] Error 1
`
Need to specify --enable-kyber=512,768,1024,enc Changed the header files to detect whether a key length has been specified. |
255afc9
to
eec7270
Compare
221280a
to
d6e41c0
Compare
ML-KEM/Kyber: MakeKey call generate random once only for all data. Allow MakeKey/Encapsulate/Decapsulate to be compiled separately. Pull out public key decoding common to public and private key decode. Put references to FIPS 140-3 into code. Rename variables to match FIPS 140-3. Fix InvNTT assembly code for x64 - more reductions. Split out ML-KEM/Kyber tests from api.c. TLSX: Store the object instead of the private key when WOLFSSL_MLKEM_CACHE_A is defined or WOLFSSL_TLSX_PQC_MLKEM_STORE_OBJ. Faster decapsulation when A is cached and object stored. To store private key as normal define WOLFSSL_TLSX_PQC_MLKEM_STORE_PRIV_KEY. misc.c: when Intel x64 build, assume able to read/write unaligned
d6e41c0
to
82b50f1
Compare
Retest this please: "Found unhandled org.jenkinsci.plugins.workflow.support.steps.AgentOfflineException exception:" |
Description
ML-KEM/Kyber:
MakeKey call generate random once only for all data.
Allow MakeKey/Encapsulate/Decapsulate to be compiled separately.
Pull out public key decoding common to public and private key decode.
Put references to FIPS 140-3 into code. Rename variables to match FIPS 140-3.
Fix InvNTT assembly code for x64 - more reductions.
Split out ML-KEM/Kyber tests from api.c.
TLSX:
Store the object instead of the private key when WOLFSSL_MLKEM_CACHE_A is defined or WOLFSSL_TLSX_PQC_MLKEM_STORE_OBJ. Faster decapsulation when A is cached and object stored.
To store private key as normal define
WOLFSSL_TLSX_PQC_MLKEM_STORE_PRIV_KEY.
misc.c: when Intel x64 build, assume able to read/write unaligned
Testing
Regression tested ML-KEM/Kyber
Checklist