From aabb69b8ba13a398b75f0c86444b1cf3b8a52e4b Mon Sep 17 00:00:00 2001 From: slontis Date: Fri, 17 Jan 2025 18:48:53 +1100 Subject: [PATCH] ML-DSA: Fix endian issue in ossl_ml_dsa_poly_sample_in_ball(). Reviewed-by: Viktor Dukhovni Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/26451) --- crypto/ml_dsa/ml_dsa_sample.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crypto/ml_dsa/ml_dsa_sample.c b/crypto/ml_dsa/ml_dsa_sample.c index 21c2c380f4e..c3f33a7206b 100644 --- a/crypto/ml_dsa/ml_dsa_sample.c +++ b/crypto/ml_dsa/ml_dsa_sample.c @@ -7,6 +7,7 @@ * https://www.openssl.org/source/license.html */ +#include #include "ml_dsa_local.h" #include "ml_dsa_vector.h" #include "ml_dsa_matrix.h" @@ -322,7 +323,7 @@ int ossl_ml_dsa_poly_sample_in_ball(POLY *out_c, const uint8_t *seed, int seed_l * grab the first 64 bits - since tau < 64 * Each bit gives a +1 or -1 value. */ - memcpy(&signs, block, 8); + OPENSSL_load_u64_le(&signs, block); poly_zero(out_c); -- 2.47.2