]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
ML-DSA: Fix endian issue in ossl_ml_dsa_poly_sample_in_ball().
authorslontis <shane.lontis@oracle.com>
Fri, 17 Jan 2025 07:48:53 +0000 (18:48 +1100)
committerTomas Mraz <tomas@openssl.org>
Fri, 14 Feb 2025 09:46:03 +0000 (10:46 +0100)
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/26451)

crypto/ml_dsa/ml_dsa_sample.c

index 21c2c380f4e8037f71821753e26ba6b2ef3e8694..c3f33a7206bd51a5e1042cfb0d93f99dbc581536 100644 (file)
@@ -7,6 +7,7 @@
  * https://www.openssl.org/source/license.html
  */
 
+#include <openssl/byteorder.h>
 #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);