mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-03 12:44:45 +02:00
fix various -Wdeclaration-after-statements, and add
-Wdeclaration-after-statement to .github/workflows/pq-all.yml. rearrange code/gating in wolfcrypt/src/wc_mlkem.c:mlkemkey_encapsulate() for clarity and to fix a -Wdeclaration-after-statement. also, made mlkem_encapsulate_c() and mlkem_encapsulate() return error code (currently always zero) rather than void, for consistency. configure.ac: fix Kyber/ML-KEM option setup.
This commit is contained in:
2
.github/workflows/pq-all.yml
vendored
2
.github/workflows/pq-all.yml
vendored
@@ -18,7 +18,7 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
config: [
|
config: [
|
||||||
# Add new configs here
|
# Add new configs here
|
||||||
'--enable-intelasm --enable-sp-asm --enable-all --enable-testcert --enable-acert --enable-dtls13 --enable-dtls-mtu --enable-dtls-frag-ch --enable-dtlscid --enable-quic --with-sys-crypto-policy --enable-experimental --enable-kyber=yes,original --enable-lms --enable-xmss --enable-dilithium --enable-dual-alg-certs --disable-qt CPPFLAGS="-pedantic -DWOLFCRYPT_TEST_LINT -DNO_WOLFSSL_CIPHER_SUITE_TEST"'
|
'--enable-intelasm --enable-sp-asm --enable-all --enable-testcert --enable-acert --enable-dtls13 --enable-dtls-mtu --enable-dtls-frag-ch --enable-dtlscid --enable-quic --with-sys-crypto-policy --enable-experimental --enable-kyber=yes,original --enable-lms --enable-xmss --enable-dilithium --enable-dual-alg-certs --disable-qt CPPFLAGS="-pedantic -Wdeclaration-after-statement -DWOLFCRYPT_TEST_LINT -DNO_WOLFSSL_CIPHER_SUITE_TEST"'
|
||||||
]
|
]
|
||||||
name: make check
|
name: make check
|
||||||
if: github.repository_owner == 'wolfssl'
|
if: github.repository_owner == 'wolfssl'
|
||||||
|
20
configure.ac
20
configure.ac
@@ -1416,14 +1416,14 @@ AC_ARG_WITH([liboqs],
|
|||||||
# Used:
|
# Used:
|
||||||
# - SHA3, Shake128 and Shake256
|
# - SHA3, Shake128 and Shake256
|
||||||
AC_ARG_ENABLE([kyber],
|
AC_ARG_ENABLE([kyber],
|
||||||
[AS_HELP_STRING([--enable-kyber],[Enable MLKEM (default: disabled)])],
|
[AS_HELP_STRING([--enable-kyber],[Enable Kyber/MLKEM (default: disabled)])],
|
||||||
[ ENABLED_MLKEM=$enableval ],
|
[ ENABLED_MLKEM=$enableval ],
|
||||||
[ ENABLED_MLKEM=no ]
|
[ ENABLED_MLKEM=no ]
|
||||||
)
|
)
|
||||||
|
# note, inherits default from "kyber" clause above.
|
||||||
AC_ARG_ENABLE([mlkem],
|
AC_ARG_ENABLE([mlkem],
|
||||||
[AS_HELP_STRING([--enable-kyber],[Enable MLKEM (default: disabled)])],
|
[AS_HELP_STRING([--enable-mlkem],[Enable MLKEM (default: disabled)])],
|
||||||
[ ENABLED_MLKEM=$enableval ],
|
[ ENABLED_MLKEM=$enableval ]
|
||||||
[ ENABLED_MLKEM=no ]
|
|
||||||
)
|
)
|
||||||
|
|
||||||
ENABLED_WC_MLKEM=no
|
ENABLED_WC_MLKEM=no
|
||||||
@@ -1434,13 +1434,18 @@ ENABLED_MLKEM_DECAPSULATE=no
|
|||||||
for v in `echo $ENABLED_MLKEM | tr "," " "`
|
for v in `echo $ENABLED_MLKEM | tr "," " "`
|
||||||
do
|
do
|
||||||
case $v in
|
case $v in
|
||||||
yes)
|
yes|all)
|
||||||
ENABLED_MLKEM512=yes
|
ENABLED_MLKEM512=yes
|
||||||
ENABLED_MLKEM768=yes
|
ENABLED_MLKEM768=yes
|
||||||
ENABLED_MLKEM1024=yes
|
ENABLED_MLKEM1024=yes
|
||||||
ENABLED_MLKEM_MAKE_KEY=yes
|
ENABLED_MLKEM_MAKE_KEY=yes
|
||||||
ENABLED_MLKEM_ENCAPSULATE=yes
|
ENABLED_MLKEM_ENCAPSULATE=yes
|
||||||
ENABLED_MLKEM_DECAPSULATE=yes
|
ENABLED_MLKEM_DECAPSULATE=yes
|
||||||
|
if test "$v" = "all"
|
||||||
|
then
|
||||||
|
ENABLED_ML_KEM=yes
|
||||||
|
ENABLED_ORIGINAL=yes
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
no)
|
no)
|
||||||
;;
|
;;
|
||||||
@@ -1468,11 +1473,6 @@ do
|
|||||||
decapsulate|dec)
|
decapsulate|dec)
|
||||||
ENABLED_MLKEM_DECAPSULATE=yes
|
ENABLED_MLKEM_DECAPSULATE=yes
|
||||||
;;
|
;;
|
||||||
all)
|
|
||||||
ENABLED_MLKEM_MAKE_KEY=yes
|
|
||||||
ENABLED_MLKEM_ENCAPSULATE=yes
|
|
||||||
ENABLED_MLKEM_DECAPSULATE=yes
|
|
||||||
;;
|
|
||||||
original|kyber)
|
original|kyber)
|
||||||
ENABLED_ORIGINAL=yes
|
ENABLED_ORIGINAL=yes
|
||||||
;;
|
;;
|
||||||
|
@@ -10894,10 +10894,11 @@ int TLSX_CKS_Set(WOLFSSL* ssl, TLSX** extensions)
|
|||||||
int TLSX_CKS_Parse(WOLFSSL* ssl, byte* input, word16 length,
|
int TLSX_CKS_Parse(WOLFSSL* ssl, byte* input, word16 length,
|
||||||
TLSX** extensions)
|
TLSX** extensions)
|
||||||
{
|
{
|
||||||
(void) extensions;
|
|
||||||
int ret;
|
int ret;
|
||||||
int i, j;
|
int i, j;
|
||||||
|
|
||||||
|
(void) extensions;
|
||||||
|
|
||||||
/* Validating the input. */
|
/* Validating the input. */
|
||||||
if (length == 0)
|
if (length == 0)
|
||||||
return BUFFER_ERROR;
|
return BUFFER_ERROR;
|
||||||
|
@@ -29768,6 +29768,7 @@ static int msgSrvCb(SSL_CTX *ctx, SSL *ssl)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(OPENSSL_ALL) && defined(SESSION_CERTS) && !defined(NO_BIO)
|
#if defined(OPENSSL_ALL) && defined(SESSION_CERTS) && !defined(NO_BIO)
|
||||||
|
{
|
||||||
WOLFSSL_X509* peer = NULL;
|
WOLFSSL_X509* peer = NULL;
|
||||||
|
|
||||||
ExpectNotNull(peer= wolfSSL_get_peer_certificate(ssl));
|
ExpectNotNull(peer= wolfSSL_get_peer_certificate(ssl));
|
||||||
@@ -29776,6 +29777,7 @@ static int msgSrvCb(SSL_CTX *ctx, SSL *ssl)
|
|||||||
fprintf(stderr, "Peer Certificate = :\n");
|
fprintf(stderr, "Peer Certificate = :\n");
|
||||||
X509_print(bio,peer);
|
X509_print(bio,peer);
|
||||||
X509_free(peer);
|
X509_free(peer);
|
||||||
|
}
|
||||||
|
|
||||||
ExpectNotNull(sk = SSL_get_peer_cert_chain(ssl));
|
ExpectNotNull(sk = SSL_get_peer_cert_chain(ssl));
|
||||||
if (sk == NULL) {
|
if (sk == NULL) {
|
||||||
|
@@ -9675,8 +9675,10 @@ static void bench_mlkem_keygen(int type, const char* name, int keySize,
|
|||||||
#ifdef MLKEM_NONDETERMINISTIC
|
#ifdef MLKEM_NONDETERMINISTIC
|
||||||
ret = wc_KyberKey_MakeKey(key, &gRng);
|
ret = wc_KyberKey_MakeKey(key, &gRng);
|
||||||
#else
|
#else
|
||||||
|
{
|
||||||
unsigned char rand[WC_ML_KEM_MAKEKEY_RAND_SZ] = {0,};
|
unsigned char rand[WC_ML_KEM_MAKEKEY_RAND_SZ] = {0,};
|
||||||
ret = wc_KyberKey_MakeKeyWithRandom(key, rand, sizeof(rand));
|
ret = wc_KyberKey_MakeKeyWithRandom(key, rand, sizeof(rand));
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
goto exit;
|
goto exit;
|
||||||
|
@@ -21236,11 +21236,12 @@ static int DecodeAltSigAlg(const byte* input, int sz, DecodedCert* cert)
|
|||||||
* like a traditional signature in the certificate. */
|
* like a traditional signature in the certificate. */
|
||||||
static int DecodeAltSigVal(const byte* input, int sz, DecodedCert* cert)
|
static int DecodeAltSigVal(const byte* input, int sz, DecodedCert* cert)
|
||||||
{
|
{
|
||||||
(void)cert;
|
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
word32 idx = 0;
|
word32 idx = 0;
|
||||||
int len = 0;
|
int len = 0;
|
||||||
|
|
||||||
|
(void)cert;
|
||||||
|
|
||||||
WOLFSSL_ENTER("DecodeAltSigVal");
|
WOLFSSL_ENTER("DecodeAltSigVal");
|
||||||
|
|
||||||
if (ret == 0) {
|
if (ret == 0) {
|
||||||
@@ -32238,15 +32239,14 @@ int wc_MakeSigWithBitStr(byte *sig, int sigSz, int sType, byte* buf,
|
|||||||
falcon_key* falconKey = NULL;
|
falcon_key* falconKey = NULL;
|
||||||
dilithium_key* dilithiumKey = NULL;
|
dilithium_key* dilithiumKey = NULL;
|
||||||
sphincs_key* sphincsKey = NULL;
|
sphincs_key* sphincsKey = NULL;
|
||||||
|
|
||||||
WOLFSSL_ENTER("wc_MakeSigWithBitStr");
|
|
||||||
|
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
int headerSz;
|
int headerSz;
|
||||||
void* heap = NULL;
|
void* heap = NULL;
|
||||||
CertSignCtx certSignCtx_lcl;
|
CertSignCtx certSignCtx_lcl;
|
||||||
CertSignCtx* certSignCtx = &certSignCtx_lcl;
|
CertSignCtx* certSignCtx = &certSignCtx_lcl;
|
||||||
|
|
||||||
|
WOLFSSL_ENTER("wc_MakeSigWithBitStr");
|
||||||
|
|
||||||
if ((sig == NULL) || (sigSz <= 0)) {
|
if ((sig == NULL) || (sigSz <= 0)) {
|
||||||
return BAD_FUNC_ARG;
|
return BAD_FUNC_ARG;
|
||||||
}
|
}
|
||||||
|
@@ -672,10 +672,8 @@ static int mlkemkey_encapsulate(MlKemKey* key, const byte* m, byte* r, byte* c)
|
|||||||
sword16 y[3 * MLKEM_MAX_K * MLKEM_N];
|
sword16 y[3 * MLKEM_MAX_K * MLKEM_N];
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#ifdef WOLFSSL_MLKEM_ENCAPSULATE_SMALL_MEM
|
|
||||||
sword16* u;
|
sword16* u;
|
||||||
sword16* v;
|
sword16* v;
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Establish parameters based on key type. */
|
/* Establish parameters based on key type. */
|
||||||
switch (key->type) {
|
switch (key->type) {
|
||||||
@@ -741,21 +739,15 @@ static int mlkemkey_encapsulate(MlKemKey* key, const byte* m, byte* r, byte* c)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (ret == 0) {
|
|
||||||
#ifndef WOLFSSL_MLKEM_ENCAPSULATE_SMALL_MEM
|
#ifndef WOLFSSL_MLKEM_ENCAPSULATE_SMALL_MEM
|
||||||
|
if (ret == 0) {
|
||||||
/* Assign allocated dynamic memory to pointers.
|
/* Assign allocated dynamic memory to pointers.
|
||||||
* y (b) | a (m) | mu (p) | e1 (p) | e2 (v) | u (v) | v (p) */
|
* y (b) | a (m) | mu (p) | e1 (p) | e2 (v) | u (v) | v (p) */
|
||||||
a = y + MLKEM_N * k;
|
a = y + MLKEM_N * k;
|
||||||
mu = a + MLKEM_N * k * k;
|
mu = a + MLKEM_N * k * k;
|
||||||
e1 = mu + MLKEM_N;
|
e1 = mu + MLKEM_N;
|
||||||
e2 = e1 + MLKEM_N * k;
|
e2 = e1 + MLKEM_N * k;
|
||||||
#else
|
|
||||||
/* Assign allocated dynamic memory to pointers.
|
|
||||||
* y (v) | a (v) | u (v) */
|
|
||||||
a = y + MLKEM_N * k;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef WOLFSSL_MLKEM_ENCAPSULATE_SMALL_MEM
|
|
||||||
/* Convert msg to a polynomial.
|
/* Convert msg to a polynomial.
|
||||||
* Step 20: mu <- Decompress_1(ByteDecode_1(m)) */
|
* Step 20: mu <- Decompress_1(ByteDecode_1(m)) */
|
||||||
mlkem_from_msg(mu, m);
|
mlkem_from_msg(mu, m);
|
||||||
@@ -767,7 +759,7 @@ static int mlkemkey_encapsulate(MlKemKey* key, const byte* m, byte* r, byte* c)
|
|||||||
*/
|
*/
|
||||||
ret = mlkem_get_noise(&key->prf, k, y, e1, e2, r);
|
ret = mlkem_get_noise(&key->prf, k, y, e1, e2, r);
|
||||||
}
|
}
|
||||||
#ifdef WOLFSSL_MLKEM_CACHE_A
|
#ifdef WOLFSSL_MLKEM_CACHE_A
|
||||||
if ((ret == 0) && ((key->flags & MLKEM_FLAG_A_SET) != 0)) {
|
if ((ret == 0) && ((key->flags & MLKEM_FLAG_A_SET) != 0)) {
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
/* Transpose matrix.
|
/* Transpose matrix.
|
||||||
@@ -782,16 +774,13 @@ static int mlkemkey_encapsulate(MlKemKey* key, const byte* m, byte* r, byte* c)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif /* WOLFSSL_MLKEM_CACHE_A */
|
||||||
if (ret == 0) {
|
if (ret == 0) {
|
||||||
/* Generate the transposed matrix.
|
/* Generate the transposed matrix.
|
||||||
* Step 4-8: generate matrix A_hat */
|
* Step 4-8: generate matrix A_hat */
|
||||||
ret = mlkem_gen_matrix(&key->prf, a, k, key->pubSeed, 1);
|
ret = mlkem_gen_matrix(&key->prf, a, k, key->pubSeed, 1);
|
||||||
}
|
}
|
||||||
if (ret == 0) {
|
if (ret == 0) {
|
||||||
sword16* u;
|
|
||||||
sword16* v;
|
|
||||||
|
|
||||||
/* Assign remaining allocated dynamic memory to pointers.
|
/* Assign remaining allocated dynamic memory to pointers.
|
||||||
* y (v) | a (m) | mu (p) | e1 (p) | r2 (v) | u (v) | v (p)*/
|
* y (v) | a (m) | mu (p) | e1 (p) | r2 (v) | u (v) | v (p)*/
|
||||||
u = e2 + MLKEM_N;
|
u = e2 + MLKEM_N;
|
||||||
@@ -799,8 +788,14 @@ static int mlkemkey_encapsulate(MlKemKey* key, const byte* m, byte* r, byte* c)
|
|||||||
|
|
||||||
/* Perform encapsulation maths.
|
/* Perform encapsulation maths.
|
||||||
* Steps 18-19, 21: calculate u and v */
|
* Steps 18-19, 21: calculate u and v */
|
||||||
mlkem_encapsulate(key->pub, u, v, a, y, e1, e2, mu, k);
|
ret = mlkem_encapsulate(key->pub, u, v, a, y, e1, e2, mu, k);
|
||||||
#else
|
}
|
||||||
|
#else /* WOLFSSL_MLKEM_ENCAPSULATE_SMALL_MEM */
|
||||||
|
if (ret == 0) {
|
||||||
|
/* Assign allocated dynamic memory to pointers.
|
||||||
|
* y (v) | a (v) | u (v) */
|
||||||
|
a = y + MLKEM_N * k;
|
||||||
|
|
||||||
/* Initialize the PRF for use in the noise generation. */
|
/* Initialize the PRF for use in the noise generation. */
|
||||||
mlkem_prf_init(&key->prf);
|
mlkem_prf_init(&key->prf);
|
||||||
/* Generate noise using PRF.
|
/* Generate noise using PRF.
|
||||||
@@ -819,9 +814,9 @@ static int mlkemkey_encapsulate(MlKemKey* key, const byte* m, byte* r, byte* c)
|
|||||||
ret = mlkem_encapsulate_seeds(key->pub, &key->prf, u, a, y, k, m,
|
ret = mlkem_encapsulate_seeds(key->pub, &key->prf, u, a, y, k, m,
|
||||||
key->pubSeed, r);
|
key->pubSeed, r);
|
||||||
}
|
}
|
||||||
|
#endif /* WOLFSSL_MLKEM_ENCAPSULATE_SMALL_MEM */
|
||||||
|
|
||||||
if (ret == 0) {
|
if (ret == 0) {
|
||||||
#endif
|
|
||||||
{
|
|
||||||
byte* c1 = c;
|
byte* c1 = c;
|
||||||
byte* c2 = c + compVecSz;
|
byte* c2 = c + compVecSz;
|
||||||
|
|
||||||
@@ -852,8 +847,6 @@ static int mlkemkey_encapsulate(MlKemKey* key, const byte* m, byte* r, byte* c)
|
|||||||
/* Step 24: return c <- (c_1||c_2) */
|
/* Step 24: return c <- (c_1||c_2) */
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef WOLFSSL_NO_MALLOC
|
#ifndef WOLFSSL_NO_MALLOC
|
||||||
|
@@ -1345,8 +1345,10 @@ void mlkem_keygen(sword16* s, sword16* t, sword16* e, const sword16* a, int k)
|
|||||||
* @param [in] e2 Error polynomial.
|
* @param [in] e2 Error polynomial.
|
||||||
* @param [in] m Message polynomial.
|
* @param [in] m Message polynomial.
|
||||||
* @param [in] k Number of polynomials in vector.
|
* @param [in] k Number of polynomials in vector.
|
||||||
|
* @return 0 on success.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
void mlkem_encapsulate(const sword16* t, sword16* u , sword16* v,
|
int mlkem_encapsulate(const sword16* t, sword16* u , sword16* v,
|
||||||
const sword16* a, sword16* y, const sword16* e1, const sword16* e2,
|
const sword16* a, sword16* y, const sword16* e1, const sword16* e2,
|
||||||
const sword16* m, int k)
|
const sword16* m, int k)
|
||||||
{
|
{
|
||||||
@@ -1416,6 +1418,8 @@ void mlkem_encapsulate(const sword16* t, sword16* u , sword16* v,
|
|||||||
/* Add errors and message to v and reduce.
|
/* Add errors and message to v and reduce.
|
||||||
* Step 21: v <- InvNTT(t_hat_trans o y_hat) + e_2 + mu) */
|
* Step 21: v <- InvNTT(t_hat_trans o y_hat) + e_2 + mu) */
|
||||||
mlkem_add3_reduce(v, e2, m);
|
mlkem_add3_reduce(v, e2, m);
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
#endif /* !WOLFSSL_MLKEM_NO_ENCAPSULATE || !WOLFSSL_MLKEM_NO_DECAPSULATE */
|
#endif /* !WOLFSSL_MLKEM_NO_ENCAPSULATE || !WOLFSSL_MLKEM_NO_DECAPSULATE */
|
||||||
|
|
||||||
@@ -1660,8 +1664,9 @@ int mlkem_keygen_seeds(sword16* s, sword16* t, MLKEM_PRF_T* prf,
|
|||||||
* @param [in] e2 Error polynomial.
|
* @param [in] e2 Error polynomial.
|
||||||
* @param [in] m Message polynomial.
|
* @param [in] m Message polynomial.
|
||||||
* @param [in] k Number of polynomials in vector.
|
* @param [in] k Number of polynomials in vector.
|
||||||
|
* @return 0 on success.
|
||||||
*/
|
*/
|
||||||
static void mlkem_encapsulate_c(const sword16* pub, sword16* u, sword16* v,
|
static int mlkem_encapsulate_c(const sword16* pub, sword16* u, sword16* v,
|
||||||
const sword16* a, sword16* y, const sword16* e1, const sword16* e2,
|
const sword16* a, sword16* y, const sword16* e1, const sword16* e2,
|
||||||
const sword16* m, int k)
|
const sword16* m, int k)
|
||||||
{
|
{
|
||||||
@@ -1696,6 +1701,8 @@ static void mlkem_encapsulate_c(const sword16* pub, sword16* u, sword16* v,
|
|||||||
sword16 t = v[i] + e2[i] + m[i];
|
sword16 t = v[i] + e2[i] + m[i];
|
||||||
v[i] = MLKEM_BARRETT_RED(t);
|
v[i] = MLKEM_BARRETT_RED(t);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Encapsulate message.
|
/* Encapsulate message.
|
||||||
@@ -1709,8 +1716,9 @@ static void mlkem_encapsulate_c(const sword16* pub, sword16* u, sword16* v,
|
|||||||
* @param [in] e2 Error polynomial.
|
* @param [in] e2 Error polynomial.
|
||||||
* @param [in] m Message polynomial.
|
* @param [in] m Message polynomial.
|
||||||
* @param [in] k Number of polynomials in vector.
|
* @param [in] k Number of polynomials in vector.
|
||||||
|
* @return 0 on success.
|
||||||
*/
|
*/
|
||||||
void mlkem_encapsulate(const sword16* pub, sword16* u, sword16* v,
|
int mlkem_encapsulate(const sword16* pub, sword16* u, sword16* v,
|
||||||
const sword16* a, sword16* y, const sword16* e1, const sword16* e2,
|
const sword16* a, sword16* y, const sword16* e1, const sword16* e2,
|
||||||
const sword16* m, int k)
|
const sword16* m, int k)
|
||||||
{
|
{
|
||||||
@@ -1718,11 +1726,12 @@ void mlkem_encapsulate(const sword16* pub, sword16* u, sword16* v,
|
|||||||
if (IS_INTEL_AVX2(cpuid_flags) && (SAVE_VECTOR_REGISTERS2() == 0)) {
|
if (IS_INTEL_AVX2(cpuid_flags) && (SAVE_VECTOR_REGISTERS2() == 0)) {
|
||||||
mlkem_encapsulate_avx2(pub, u, v, a, y, e1, e2, m, k);
|
mlkem_encapsulate_avx2(pub, u, v, a, y, e1, e2, m, k);
|
||||||
RESTORE_VECTOR_REGISTERS();
|
RESTORE_VECTOR_REGISTERS();
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
mlkem_encapsulate_c(pub, u, v, a, y, e1, e2, m, k);
|
return mlkem_encapsulate_c(pub, u, v, a, y, e1, e2, m, k);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -163,7 +163,7 @@ int mlkem_keygen_seeds(sword16* priv, sword16* pub, MLKEM_PRF_T* prf,
|
|||||||
#endif
|
#endif
|
||||||
#ifndef WOLFSSL_MLKEM_ENCAPSULATE_SMALL_MEM
|
#ifndef WOLFSSL_MLKEM_ENCAPSULATE_SMALL_MEM
|
||||||
WOLFSSL_LOCAL
|
WOLFSSL_LOCAL
|
||||||
void mlkem_encapsulate(const sword16* pub, sword16* bp, sword16* v,
|
int mlkem_encapsulate(const sword16* pub, sword16* bp, sword16* v,
|
||||||
const sword16* at, sword16* sp, const sword16* ep, const sword16* epp,
|
const sword16* at, sword16* sp, const sword16* ep, const sword16* epp,
|
||||||
const sword16* m, int kp);
|
const sword16* m, int kp);
|
||||||
#else
|
#else
|
||||||
|
Reference in New Issue
Block a user