pq_crypto 0.6.4 → 0.6.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +46 -0
- data/README.md +5 -0
- data/ext/pqcrypto/pqcrypto_version.h +1 -1
- data/ext/pqcrypto/vendor/.vendored +4 -4
- data/ext/pqcrypto/vendor/mlkem-native/README.md +2 -4
- data/ext/pqcrypto/vendor/mlkem-native/RELEASE.md +98 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/mlkem_native.c +8 -7
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/mlkem_native.h +21 -1
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/mlkem_native_asm.S +45 -44
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/mlkem_native_config.h +36 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/common.h +13 -30
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/compress.c +25 -5
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/compress.h +14 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/context.h +42 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/auto.h +20 -12
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/src/keccak_f1600_x1_scalar_aarch64_asm.S +5 -3
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/src/keccak_f1600_x1_v84a_aarch64_asm.S +5 -2
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/src/keccak_f1600_x2_v84a_aarch64_asm.S +5 -2
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/src/keccak_f1600_x4_v8a_scalar_hybrid_aarch64_asm.S +10 -7
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/src/keccak_f1600_x4_v8a_v84a_scalar_hybrid_aarch64_asm.S +10 -7
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/x1_v84a.h +2 -1
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/x2_v84a.h +2 -1
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/x4_v8a_scalar.h +5 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/x4_v8a_v84a_scalar.h +2 -1
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/armv81m/mve.h +5 -19
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/armv81m/src/keccak_f1600_x4_mve.S +8 -5
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/armv81m/src/{state_extract_bytes_x4_mve.S → keccak_f1600_x4_state_extract_bytes_mve.S} +14 -14
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/armv81m/src/{state_xor_bytes_x4_mve.S → keccak_f1600_x4_state_xor_bytes_mve.S} +12 -12
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/x86_64/src/keccak_f1600_x4_avx2_asm.S +36 -2
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/indcpa.c +22 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/indcpa.h +6 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/kem.c +11 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/kem.h +25 -1
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/meta.h +44 -2
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/aarch64_zetas.c +2 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/arith_native_aarch64.h +11 -10
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/{intt_aarch64_asm.S → mlkem_intt_aarch64_asm.S} +16 -9
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/{ntt_aarch64_asm.S → mlkem_ntt_aarch64_asm.S} +10 -7
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/{poly_mulcache_compute_aarch64_asm.S → mlkem_poly_mulcache_compute_aarch64_asm.S} +6 -3
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/{poly_reduce_aarch64_asm.S → mlkem_poly_reduce_aarch64_asm.S} +6 -3
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/{poly_tobytes_aarch64_asm.S → mlkem_poly_tobytes_aarch64_asm.S} +12 -5
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/{poly_tomont_aarch64_asm.S → mlkem_poly_tomont_aarch64_asm.S} +11 -5
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/{polyvec_basemul_acc_montgomery_cached_k2_aarch64_asm.S → mlkem_polyvec_basemul_acc_montgomery_cached_k2_aarch64_asm.S} +6 -3
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/{polyvec_basemul_acc_montgomery_cached_k3_aarch64_asm.S → mlkem_polyvec_basemul_acc_montgomery_cached_k3_aarch64_asm.S} +6 -3
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/{polyvec_basemul_acc_montgomery_cached_k4_aarch64_asm.S → mlkem_polyvec_basemul_acc_montgomery_cached_k4_aarch64_asm.S} +6 -3
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/{rej_uniform_aarch64_asm.S → mlkem_rej_uniform_aarch64_asm.S} +17 -17
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/api.h +21 -8
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/meta.h +1 -1
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/ppc64le/meta.h +4 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/ppc64le/src/{intt_ppc_asm.S → mlkem_intt_ppc_asm.S} +29 -5
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/ppc64le/src/{ntt_ppc_asm.S → mlkem_ntt_ppc_asm.S} +22 -1
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/ppc64le/src/{poly_tomont_ppc_asm.S → mlkem_poly_tomont_ppc_asm.S} +25 -3
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/ppc64le/src/{reduce_ppc_asm.S → mlkem_reduce_ppc_asm.S} +22 -1
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/riscv64/meta.h +4 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/riscv64/src/arith_native_riscv64.h +4 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/riscv64/src/rv64v_poly.c +6 -2
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/meta.h +25 -5
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/arith_native_x86_64.h +20 -20
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/compress_consts.c +14 -3
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/compress_consts.h +8 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/{intt_avx2_asm.S → mlkem_intt_avx2_asm.S} +27 -3
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/{ntt_avx2_asm.S → mlkem_ntt_avx2_asm.S} +23 -1
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/{nttfrombytes_avx2_asm.S → mlkem_nttfrombytes_avx2_asm.S} +27 -3
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/{ntttobytes_avx2_asm.S → mlkem_ntttobytes_avx2_asm.S} +27 -3
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/{nttunpack_avx2_asm.S → mlkem_nttunpack_avx2_asm.S} +17 -1
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/{poly_compress_d10_avx2_asm.S → mlkem_poly_compress_d10_avx2_asm.S} +34 -3
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/{poly_compress_d11_avx2_asm.S → mlkem_poly_compress_d11_avx2_asm.S} +33 -2
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/{poly_compress_d4_avx2_asm.S → mlkem_poly_compress_d4_avx2_asm.S} +34 -3
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/{poly_compress_d5_avx2_asm.S → mlkem_poly_compress_d5_avx2_asm.S} +33 -2
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/{poly_decompress_d10_avx2_asm.S → mlkem_poly_decompress_d10_avx2_asm.S} +32 -3
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/{poly_decompress_d11_avx2_asm.S → mlkem_poly_decompress_d11_avx2_asm.S} +32 -2
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/{poly_decompress_d4_avx2_asm.S → mlkem_poly_decompress_d4_avx2_asm.S} +32 -3
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/{poly_decompress_d5_avx2_asm.S → mlkem_poly_decompress_d5_avx2_asm.S} +32 -2
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/{poly_mulcache_compute_avx2_asm.S → mlkem_poly_mulcache_compute_avx2_asm.S} +29 -1
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/{polyvec_basemul_acc_montgomery_cached_k2_avx2_asm.S → mlkem_polyvec_basemul_acc_montgomery_cached_k2_avx2_asm.S} +35 -1
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/{polyvec_basemul_acc_montgomery_cached_k3_avx2_asm.S → mlkem_polyvec_basemul_acc_montgomery_cached_k3_avx2_asm.S} +35 -1
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/{polyvec_basemul_acc_montgomery_cached_k4_avx2_asm.S → mlkem_polyvec_basemul_acc_montgomery_cached_k4_avx2_asm.S} +35 -1
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/{reduce_avx2_asm.S → mlkem_reduce_avx2_asm.S} +17 -1
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/{rej_uniform_avx2_asm.S → mlkem_rej_uniform_avx2_asm.S} +40 -7
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/{tomont_avx2_asm.S → mlkem_tomont_avx2_asm.S} +20 -3
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/poly.c +7 -2
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/poly.h +6 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/poly_k.c +25 -4
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/poly_k.h +33 -4
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/sampling.c +4 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/sampling.h +4 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/sys.h +19 -1
- data/lib/pq_crypto/version.rb +1 -1
- data/script/vendor_libs.rb +3 -3
- metadata +40 -42
|
@@ -22,7 +22,7 @@ MLK_MUST_CHECK_RETURN_VALUE MLK_SYSV_ABI
|
|
|
22
22
|
uint64_t mlk_rej_uniform_avx2_asm(int16_t *r, const uint8_t *buf,
|
|
23
23
|
unsigned buflen, const uint8_t *table)
|
|
24
24
|
/* This must be kept in sync with the HOL-Light specification
|
|
25
|
-
* in proofs/hol_light/x86_64/proofs/
|
|
25
|
+
* in proofs/hol_light/x86_64/proofs/mlkem_rej_uniform_avx2_asm.ml. */
|
|
26
26
|
__contract__(
|
|
27
27
|
requires(buflen % 12 == 0)
|
|
28
28
|
requires(memory_no_alias(buf, buflen))
|
|
@@ -37,7 +37,7 @@ __contract__(
|
|
|
37
37
|
MLK_SYSV_ABI
|
|
38
38
|
void mlk_ntt_avx2_asm(int16_t *r, const int16_t *qdata)
|
|
39
39
|
/* This must be kept in sync with the HOL-Light specification
|
|
40
|
-
* in proofs/hol_light/x86_64/proofs/
|
|
40
|
+
* in proofs/hol_light/x86_64/proofs/mlkem_ntt_avx2_asm.ml */
|
|
41
41
|
__contract__(
|
|
42
42
|
requires(memory_no_alias(r, sizeof(int16_t) * MLKEM_N))
|
|
43
43
|
requires(array_abs_bound(r, 0, MLKEM_N, 8192))
|
|
@@ -52,7 +52,7 @@ __contract__(
|
|
|
52
52
|
MLK_SYSV_ABI
|
|
53
53
|
void mlk_invntt_avx2_asm(int16_t *r, const int16_t *qdata)
|
|
54
54
|
/* This must be kept in sync with the HOL-Light specification
|
|
55
|
-
* in proofs/hol_light/x86_64/proofs/
|
|
55
|
+
* in proofs/hol_light/x86_64/proofs/mlkem_intt_avx2_asm.ml */
|
|
56
56
|
__contract__(
|
|
57
57
|
requires(memory_no_alias(r, sizeof(int16_t) * MLKEM_N))
|
|
58
58
|
requires(qdata == mlk_qdata)
|
|
@@ -66,7 +66,7 @@ __contract__(
|
|
|
66
66
|
MLK_SYSV_ABI
|
|
67
67
|
void mlk_nttunpack_avx2_asm(int16_t *r)
|
|
68
68
|
/* This must be kept in sync with the HOL-Light specification
|
|
69
|
-
* in proofs/hol_light/x86_64/proofs/
|
|
69
|
+
* in proofs/hol_light/x86_64/proofs/mlkem_nttunpack_avx2_asm.ml */
|
|
70
70
|
__contract__(
|
|
71
71
|
requires(memory_no_alias(r, sizeof(int16_t) * MLKEM_N))
|
|
72
72
|
requires(array_bound(r, 0, MLKEM_N, 0, MLKEM_Q))
|
|
@@ -81,7 +81,7 @@ __contract__(
|
|
|
81
81
|
MLK_SYSV_ABI
|
|
82
82
|
void mlk_reduce_avx2_asm(int16_t *r)
|
|
83
83
|
/* This must be kept in sync with the HOL-Light specification
|
|
84
|
-
* in proofs/hol_light/x86_64/proofs/
|
|
84
|
+
* in proofs/hol_light/x86_64/proofs/mlkem_reduce_avx2_asm.ml */
|
|
85
85
|
__contract__(
|
|
86
86
|
requires(memory_no_alias(r, sizeof(int16_t) * MLKEM_N))
|
|
87
87
|
assigns(memory_slice(r, sizeof(int16_t) * MLKEM_N))
|
|
@@ -94,7 +94,7 @@ MLK_SYSV_ABI
|
|
|
94
94
|
void mlk_poly_mulcache_compute_avx2_asm(int16_t *out, const int16_t *in,
|
|
95
95
|
const int16_t *qdata)
|
|
96
96
|
/* This must be kept in sync with the HOL-Light specification
|
|
97
|
-
* in proofs/hol_light/x86_64/proofs/
|
|
97
|
+
* in proofs/hol_light/x86_64/proofs/mlkem_poly_mulcache_compute_avx2_asm.ml */
|
|
98
98
|
__contract__(
|
|
99
99
|
requires(memory_no_alias(out, sizeof(int16_t) * (MLKEM_N / 2)))
|
|
100
100
|
requires(memory_no_alias(in, sizeof(int16_t) * MLKEM_N))
|
|
@@ -109,7 +109,7 @@ MLK_SYSV_ABI
|
|
|
109
109
|
void mlk_polyvec_basemul_acc_montgomery_cached_k2_avx2_asm(
|
|
110
110
|
int16_t *r, const int16_t *a, const int16_t *b, const int16_t *b_cache)
|
|
111
111
|
/* This must be kept in sync with the HOL-Light specification in
|
|
112
|
-
* proofs/hol_light/x86_64/proofs/
|
|
112
|
+
* proofs/hol_light/x86_64/proofs/mlkem_polyvec_basemul_acc_montgomery_cached_k2_avx2_asm.ml.
|
|
113
113
|
*/
|
|
114
114
|
__contract__(
|
|
115
115
|
requires(memory_no_alias(r, sizeof(int16_t) * MLKEM_N))
|
|
@@ -126,7 +126,7 @@ MLK_SYSV_ABI
|
|
|
126
126
|
void mlk_polyvec_basemul_acc_montgomery_cached_k3_avx2_asm(
|
|
127
127
|
int16_t *r, const int16_t *a, const int16_t *b, const int16_t *b_cache)
|
|
128
128
|
/* This must be kept in sync with the HOL-Light specification in
|
|
129
|
-
* proofs/hol_light/x86_64/proofs/
|
|
129
|
+
* proofs/hol_light/x86_64/proofs/mlkem_polyvec_basemul_acc_montgomery_cached_k3_avx2_asm.ml.
|
|
130
130
|
*/
|
|
131
131
|
__contract__(
|
|
132
132
|
requires(memory_no_alias(r, sizeof(int16_t) * MLKEM_N))
|
|
@@ -143,7 +143,7 @@ MLK_SYSV_ABI
|
|
|
143
143
|
void mlk_polyvec_basemul_acc_montgomery_cached_k4_avx2_asm(
|
|
144
144
|
int16_t *r, const int16_t *a, const int16_t *b, const int16_t *b_cache)
|
|
145
145
|
/* This must be kept in sync with the HOL-Light specification in
|
|
146
|
-
* proofs/hol_light/x86_64/proofs/
|
|
146
|
+
* proofs/hol_light/x86_64/proofs/mlkem_polyvec_basemul_acc_montgomery_cached_k4_avx2_asm.ml.
|
|
147
147
|
*/
|
|
148
148
|
__contract__(
|
|
149
149
|
requires(memory_no_alias(r, sizeof(int16_t) * MLKEM_N))
|
|
@@ -158,7 +158,7 @@ __contract__(
|
|
|
158
158
|
MLK_SYSV_ABI
|
|
159
159
|
void mlk_ntttobytes_avx2_asm(uint8_t *r, const int16_t *a)
|
|
160
160
|
/* This must be kept in sync with the HOL-Light specification in
|
|
161
|
-
* proofs/hol_light/x86_64/proofs/
|
|
161
|
+
* proofs/hol_light/x86_64/proofs/mlkem_ntttobytes_avx2_asm.ml.
|
|
162
162
|
*/
|
|
163
163
|
__contract__(
|
|
164
164
|
requires(memory_no_alias(r, MLKEM_POLYBYTES))
|
|
@@ -171,7 +171,7 @@ __contract__(
|
|
|
171
171
|
MLK_SYSV_ABI
|
|
172
172
|
void mlk_nttfrombytes_avx2_asm(int16_t *r, const uint8_t *a)
|
|
173
173
|
/* This must be kept in sync with the HOL-Light specification in
|
|
174
|
-
* proofs/hol_light/x86_64/proofs/
|
|
174
|
+
* proofs/hol_light/x86_64/proofs/mlkem_nttfrombytes_avx2_asm.ml.
|
|
175
175
|
*/
|
|
176
176
|
__contract__(
|
|
177
177
|
requires(memory_no_alias(a, MLKEM_POLYBYTES))
|
|
@@ -184,7 +184,7 @@ __contract__(
|
|
|
184
184
|
MLK_SYSV_ABI
|
|
185
185
|
void mlk_tomont_avx2_asm(int16_t *r)
|
|
186
186
|
/* This must be kept in sync with the HOL-Light specification in
|
|
187
|
-
* proofs/hol_light/x86_64/proofs/
|
|
187
|
+
* proofs/hol_light/x86_64/proofs/mlkem_tomont_avx2_asm.ml.
|
|
188
188
|
*/
|
|
189
189
|
__contract__(
|
|
190
190
|
requires(memory_no_alias(r, sizeof(int16_t) * MLKEM_N))
|
|
@@ -198,7 +198,7 @@ void mlk_poly_compress_d4_avx2_asm(uint8_t r[MLKEM_POLYCOMPRESSEDBYTES_D4],
|
|
|
198
198
|
const int16_t *MLK_RESTRICT a,
|
|
199
199
|
const uint8_t *data)
|
|
200
200
|
/* This must be kept in sync with the HOL-Light specification in
|
|
201
|
-
* proofs/hol_light/x86_64/proofs/
|
|
201
|
+
* proofs/hol_light/x86_64/proofs/mlkem_poly_compress_d4_avx2_asm.ml.
|
|
202
202
|
*/
|
|
203
203
|
__contract__(
|
|
204
204
|
requires(memory_no_alias(r, MLKEM_POLYCOMPRESSEDBYTES_D4))
|
|
@@ -215,7 +215,7 @@ void mlk_poly_decompress_d4_avx2_asm(
|
|
|
215
215
|
int16_t *MLK_RESTRICT r, const uint8_t a[MLKEM_POLYCOMPRESSEDBYTES_D4],
|
|
216
216
|
const uint8_t *data)
|
|
217
217
|
/* This must be kept in sync with the HOL-Light specification in
|
|
218
|
-
* proofs/hol_light/x86_64/proofs/
|
|
218
|
+
* proofs/hol_light/x86_64/proofs/mlkem_poly_decompress_d4_avx2_asm.ml.
|
|
219
219
|
*/
|
|
220
220
|
__contract__(
|
|
221
221
|
requires(memory_no_alias(r, sizeof(int16_t) * MLKEM_N))
|
|
@@ -231,7 +231,7 @@ void mlk_poly_compress_d10_avx2_asm(uint8_t r[MLKEM_POLYCOMPRESSEDBYTES_D10],
|
|
|
231
231
|
const int16_t *MLK_RESTRICT a,
|
|
232
232
|
const uint8_t *data)
|
|
233
233
|
/* This must be kept in sync with the HOL-Light specification in
|
|
234
|
-
* proofs/hol_light/x86_64/proofs/
|
|
234
|
+
* proofs/hol_light/x86_64/proofs/mlkem_poly_compress_d10_avx2_asm.ml.
|
|
235
235
|
*/
|
|
236
236
|
__contract__(
|
|
237
237
|
requires(memory_no_alias(r, MLKEM_POLYCOMPRESSEDBYTES_D10))
|
|
@@ -248,7 +248,7 @@ void mlk_poly_decompress_d10_avx2_asm(
|
|
|
248
248
|
int16_t *MLK_RESTRICT r, const uint8_t a[MLKEM_POLYCOMPRESSEDBYTES_D10],
|
|
249
249
|
const uint8_t *data)
|
|
250
250
|
/* This must be kept in sync with the HOL-Light specification in
|
|
251
|
-
* proofs/hol_light/x86_64/proofs/
|
|
251
|
+
* proofs/hol_light/x86_64/proofs/mlkem_poly_decompress_d10_avx2_asm.ml.
|
|
252
252
|
*/
|
|
253
253
|
__contract__(
|
|
254
254
|
requires(memory_no_alias(r, sizeof(int16_t) * MLKEM_N))
|
|
@@ -264,7 +264,7 @@ void mlk_poly_compress_d5_avx2_asm(uint8_t r[MLKEM_POLYCOMPRESSEDBYTES_D5],
|
|
|
264
264
|
const int16_t *MLK_RESTRICT a,
|
|
265
265
|
const uint8_t *data)
|
|
266
266
|
/* This must be kept in sync with the HOL-Light specification in
|
|
267
|
-
* proofs/hol_light/x86_64/proofs/
|
|
267
|
+
* proofs/hol_light/x86_64/proofs/mlkem_poly_compress_d5_avx2_asm.ml.
|
|
268
268
|
*/
|
|
269
269
|
__contract__(
|
|
270
270
|
requires(memory_no_alias(r, MLKEM_POLYCOMPRESSEDBYTES_D5))
|
|
@@ -281,7 +281,7 @@ void mlk_poly_decompress_d5_avx2_asm(
|
|
|
281
281
|
int16_t *MLK_RESTRICT r, const uint8_t a[MLKEM_POLYCOMPRESSEDBYTES_D5],
|
|
282
282
|
const uint8_t *data)
|
|
283
283
|
/* This must be kept in sync with the HOL-Light specification in
|
|
284
|
-
* proofs/hol_light/x86_64/proofs/
|
|
284
|
+
* proofs/hol_light/x86_64/proofs/mlkem_poly_decompress_d5_avx2_asm.ml.
|
|
285
285
|
*/
|
|
286
286
|
__contract__(
|
|
287
287
|
requires(memory_no_alias(r, sizeof(int16_t) * MLKEM_N))
|
|
@@ -297,7 +297,7 @@ void mlk_poly_compress_d11_avx2_asm(uint8_t r[MLKEM_POLYCOMPRESSEDBYTES_D11],
|
|
|
297
297
|
const int16_t *MLK_RESTRICT a,
|
|
298
298
|
const uint8_t *data)
|
|
299
299
|
/* This must be kept in sync with the HOL-Light specification in
|
|
300
|
-
* proofs/hol_light/x86_64/proofs/
|
|
300
|
+
* proofs/hol_light/x86_64/proofs/mlkem_poly_compress_d11_avx2_asm.ml.
|
|
301
301
|
*/
|
|
302
302
|
__contract__(
|
|
303
303
|
requires(memory_no_alias(r, MLKEM_POLYCOMPRESSEDBYTES_D11))
|
|
@@ -314,7 +314,7 @@ void mlk_poly_decompress_d11_avx2_asm(
|
|
|
314
314
|
int16_t *MLK_RESTRICT r, const uint8_t a[MLKEM_POLYCOMPRESSEDBYTES_D11],
|
|
315
315
|
const uint8_t *data)
|
|
316
316
|
/* This must be kept in sync with the HOL-Light specification in
|
|
317
|
-
* proofs/hol_light/x86_64/proofs/
|
|
317
|
+
* proofs/hol_light/x86_64/proofs/mlkem_poly_decompress_d11_avx2_asm.ml.
|
|
318
318
|
*/
|
|
319
319
|
__contract__(
|
|
320
320
|
requires(memory_no_alias(r, sizeof(int16_t) * MLKEM_N))
|
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
|
|
12
12
|
#include "../../../common.h"
|
|
13
13
|
|
|
14
|
-
#if defined(MLK_ARITH_BACKEND_X86_64_DEFAULT)
|
|
14
|
+
#if defined(MLK_ARITH_BACKEND_X86_64_DEFAULT) && \
|
|
15
|
+
(!defined(MLK_CONFIG_NO_ENCAPS_API) || !defined(MLK_CONFIG_NO_DECAPS_API))
|
|
15
16
|
|
|
16
17
|
#include "compress_consts.h"
|
|
17
18
|
|
|
@@ -25,11 +26,13 @@ MLK_ALIGN MLK_INTERNAL_DATA_DEFINITION const uint8_t
|
|
|
25
26
|
2, 0, 0, 0, 6, 0, 0, 0, 3, 0, 0, 0, 7, 0, 0, 0, /* permdidx */
|
|
26
27
|
};
|
|
27
28
|
|
|
29
|
+
#if !defined(MLK_CONFIG_NO_DECAPS_API)
|
|
28
30
|
MLK_ALIGN MLK_INTERNAL_DATA_DEFINITION const uint8_t
|
|
29
31
|
mlk_decompress_d4_data[32] = {
|
|
30
32
|
0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3,
|
|
31
33
|
4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, /* shufbidx */
|
|
32
34
|
};
|
|
35
|
+
#endif /* !MLK_CONFIG_NO_DECAPS_API */
|
|
33
36
|
|
|
34
37
|
MLK_ALIGN MLK_INTERNAL_DATA_DEFINITION const uint8_t
|
|
35
38
|
mlk_compress_d10_data[32] = {
|
|
@@ -38,11 +41,13 @@ MLK_ALIGN MLK_INTERNAL_DATA_DEFINITION const uint8_t
|
|
|
38
41
|
255, 255, 255, 255, 0, 1, 2, 3, 4, 8, /* shufbidx */
|
|
39
42
|
};
|
|
40
43
|
|
|
44
|
+
#if !defined(MLK_CONFIG_NO_DECAPS_API)
|
|
41
45
|
MLK_ALIGN MLK_INTERNAL_DATA_DEFINITION const uint8_t
|
|
42
46
|
mlk_decompress_d10_data[32] = {
|
|
43
47
|
0, 1, 1, 2, 2, 3, 3, 4, 5, 6, 6, 7, 7, 8, 8, 9,
|
|
44
48
|
2, 3, 3, 4, 4, 5, 5, 6, 7, 8, 8, 9, 9, 10, 10, 11, /* shufbidx */
|
|
45
49
|
};
|
|
50
|
+
#endif /* !MLK_CONFIG_NO_DECAPS_API */
|
|
46
51
|
|
|
47
52
|
#endif /* !MLK_CONFIG_MULTILEVEL_NO_SHARED && \
|
|
48
53
|
(MLK_CONFIG_MULTILEVEL_WITH_SHARED || MLKEM_K == 2 || MLKEM_K == 3) \
|
|
@@ -58,6 +63,7 @@ MLK_ALIGN MLK_INTERNAL_DATA_DEFINITION const uint8_t
|
|
|
58
63
|
1, 2, 3, 4, 255, 255, 255, 255, 255, 8, /* shufbidx */
|
|
59
64
|
};
|
|
60
65
|
|
|
66
|
+
#if !defined(MLK_CONFIG_NO_DECAPS_API)
|
|
61
67
|
/* shufbidx[0:32], mask[32:64], shift[64:96] */
|
|
62
68
|
MLK_ALIGN MLK_INTERNAL_DATA_DEFINITION const uint8_t
|
|
63
69
|
mlk_decompress_d5_data[96] = {
|
|
@@ -68,6 +74,7 @@ MLK_ALIGN MLK_INTERNAL_DATA_DEFINITION const uint8_t
|
|
|
68
74
|
0, 4, 32, 0, 0, 1, 8, 0, 64, 0, 0, 2, 16, 0, 128, 0, 0, 4,
|
|
69
75
|
32, 0, 0, 1, 8, 0, 64, 0, 0, 2, 16, 0, 128, 0, /* shift */
|
|
70
76
|
};
|
|
77
|
+
#endif /* !MLK_CONFIG_NO_DECAPS_API */
|
|
71
78
|
|
|
72
79
|
/* srlvqidx[0:32], shufbidx[32:64] */
|
|
73
80
|
MLK_ALIGN MLK_INTERNAL_DATA_DEFINITION const uint8_t
|
|
@@ -81,6 +88,7 @@ MLK_ALIGN MLK_INTERNAL_DATA_DEFINITION const uint8_t
|
|
|
81
88
|
255, 255, 255, 255, 0, 0, 1, 2, 3, 4, /* shufbidx */
|
|
82
89
|
};
|
|
83
90
|
|
|
91
|
+
#if !defined(MLK_CONFIG_NO_DECAPS_API)
|
|
84
92
|
/* shufbidx[0:32], srlvdidx[32:64], srlvqidx[64:96], shift[96:128] */
|
|
85
93
|
MLK_ALIGN MLK_INTERNAL_DATA_DEFINITION const uint8_t
|
|
86
94
|
mlk_decompress_d11_data[128] = {
|
|
@@ -93,12 +101,15 @@ MLK_ALIGN MLK_INTERNAL_DATA_DEFINITION const uint8_t
|
|
|
93
101
|
32, 0, 4, 0, 1, 0, 32, 0, 8, 0, 1, 0, 32, 0, 4, 0,
|
|
94
102
|
32, 0, 4, 0, 1, 0, 32, 0, 8, 0, 1, 0, 32, 0, 4, 0, /* shift */
|
|
95
103
|
};
|
|
104
|
+
#endif /* !MLK_CONFIG_NO_DECAPS_API */
|
|
96
105
|
|
|
97
106
|
#endif /* !MLK_CONFIG_MULTILEVEL_NO_SHARED && \
|
|
98
107
|
(MLK_CONFIG_MULTILEVEL_WITH_SHARED || MLKEM_K == 4) */
|
|
99
108
|
|
|
100
|
-
#else /* MLK_ARITH_BACKEND_X86_64_DEFAULT
|
|
109
|
+
#else /* MLK_ARITH_BACKEND_X86_64_DEFAULT && (!MLK_CONFIG_NO_ENCAPS_API || \
|
|
110
|
+
!MLK_CONFIG_NO_DECAPS_API) */
|
|
101
111
|
|
|
102
112
|
MLK_EMPTY_CU(avx2_compress_consts)
|
|
103
113
|
|
|
104
|
-
#endif /* !MLK_ARITH_BACKEND_X86_64_DEFAULT
|
|
114
|
+
#endif /* !(MLK_ARITH_BACKEND_X86_64_DEFAULT && (!MLK_CONFIG_NO_ENCAPS_API || \
|
|
115
|
+
!MLK_CONFIG_NO_DECAPS_API)) */
|
|
@@ -19,26 +19,34 @@
|
|
|
19
19
|
#define mlk_compress_d4_data MLK_NAMESPACE(compress_d4_data)
|
|
20
20
|
MLK_INTERNAL_DATA_DECLARATION const uint8_t mlk_compress_d4_data[32];
|
|
21
21
|
|
|
22
|
+
#if !defined(MLK_CONFIG_NO_DECAPS_API)
|
|
22
23
|
#define mlk_decompress_d4_data MLK_NAMESPACE(decompress_d4_data)
|
|
23
24
|
MLK_INTERNAL_DATA_DECLARATION const uint8_t mlk_decompress_d4_data[32];
|
|
25
|
+
#endif
|
|
24
26
|
|
|
25
27
|
#define mlk_compress_d10_data MLK_NAMESPACE(compress_d10_data)
|
|
26
28
|
MLK_INTERNAL_DATA_DECLARATION const uint8_t mlk_compress_d10_data[32];
|
|
27
29
|
|
|
30
|
+
#if !defined(MLK_CONFIG_NO_DECAPS_API)
|
|
28
31
|
#define mlk_decompress_d10_data MLK_NAMESPACE(decompress_d10_data)
|
|
29
32
|
MLK_INTERNAL_DATA_DECLARATION const uint8_t mlk_decompress_d10_data[32];
|
|
33
|
+
#endif
|
|
30
34
|
|
|
31
35
|
#define mlk_compress_d5_data MLK_NAMESPACE(compress_d5_data)
|
|
32
36
|
MLK_INTERNAL_DATA_DECLARATION const uint8_t mlk_compress_d5_data[32];
|
|
33
37
|
|
|
38
|
+
#if !defined(MLK_CONFIG_NO_DECAPS_API)
|
|
34
39
|
#define mlk_decompress_d5_data MLK_NAMESPACE(decompress_d5_data)
|
|
35
40
|
MLK_INTERNAL_DATA_DECLARATION const uint8_t mlk_decompress_d5_data[96];
|
|
41
|
+
#endif
|
|
36
42
|
|
|
37
43
|
#define mlk_compress_d11_data MLK_NAMESPACE(compress_d11_data)
|
|
38
44
|
MLK_INTERNAL_DATA_DECLARATION const uint8_t mlk_compress_d11_data[64];
|
|
39
45
|
|
|
46
|
+
#if !defined(MLK_CONFIG_NO_DECAPS_API)
|
|
40
47
|
#define mlk_decompress_d11_data MLK_NAMESPACE(decompress_d11_data)
|
|
41
48
|
MLK_INTERNAL_DATA_DECLARATION const uint8_t mlk_decompress_d11_data[128];
|
|
49
|
+
#endif
|
|
42
50
|
|
|
43
51
|
#endif /* !__ASSEMBLER__ */
|
|
44
52
|
|
|
@@ -30,11 +30,35 @@
|
|
|
30
30
|
|
|
31
31
|
#include "../../../common.h"
|
|
32
32
|
#if defined(MLK_ARITH_BACKEND_X86_64_DEFAULT) && \
|
|
33
|
-
!defined(MLK_CONFIG_MULTILEVEL_NO_SHARED)
|
|
33
|
+
!defined(MLK_CONFIG_MULTILEVEL_NO_SHARED) && \
|
|
34
|
+
(!defined(MLK_CONFIG_NO_ENCAPS_API) || \
|
|
35
|
+
!defined(MLK_CONFIG_NO_DECAPS_API))
|
|
36
|
+
/*yaml
|
|
37
|
+
Name: invntt_avx2_asm
|
|
38
|
+
Description: x86_64 AVX2 inverse NTT
|
|
39
|
+
Signature: void mlk_invntt_avx2_asm(int16_t *r, const int16_t *qdata)
|
|
40
|
+
ABI:
|
|
41
|
+
Architecture: x86_64
|
|
42
|
+
CallingConvention: SysV
|
|
43
|
+
Features: [AVX2]
|
|
44
|
+
rdi:
|
|
45
|
+
type: buffer
|
|
46
|
+
size_bytes: 512
|
|
47
|
+
permissions: read/write
|
|
48
|
+
c_parameter: int16_t *r
|
|
49
|
+
description: Input/output polynomial (256 x int16_t)
|
|
50
|
+
rsi:
|
|
51
|
+
type: buffer
|
|
52
|
+
size_bytes: 1248
|
|
53
|
+
permissions: read-only
|
|
54
|
+
c_parameter: const int16_t *qdata
|
|
55
|
+
description: Precomputed constants (624 x int16_t)
|
|
56
|
+
*/
|
|
57
|
+
|
|
34
58
|
|
|
35
59
|
/*
|
|
36
60
|
* WARNING: This file is auto-derived from the mlkem-native source file
|
|
37
|
-
* dev/x86_64/src/
|
|
61
|
+
* dev/x86_64/src/mlkem_intt_avx2_asm.S using scripts/simpasm. Do not modify it directly.
|
|
38
62
|
*/
|
|
39
63
|
|
|
40
64
|
.text
|
|
@@ -712,7 +736,7 @@ MLK_ASM_FN_SYMBOL(invntt_avx2_asm)
|
|
|
712
736
|
MLK_ASM_FN_SIZE(invntt_avx2_asm)
|
|
713
737
|
|
|
714
738
|
#endif /* MLK_ARITH_BACKEND_X86_64_DEFAULT && !MLK_CONFIG_MULTILEVEL_NO_SHARED \
|
|
715
|
-
|
|
739
|
+
&& (!MLK_CONFIG_NO_ENCAPS_API || !MLK_CONFIG_NO_DECAPS_API) */
|
|
716
740
|
|
|
717
741
|
#if defined(__ELF__)
|
|
718
742
|
.section .note.GNU-stack,"",%progbits
|
|
@@ -27,10 +27,32 @@
|
|
|
27
27
|
#include "../../../common.h"
|
|
28
28
|
#if defined(MLK_ARITH_BACKEND_X86_64_DEFAULT) && \
|
|
29
29
|
!defined(MLK_CONFIG_MULTILEVEL_NO_SHARED)
|
|
30
|
+
/*yaml
|
|
31
|
+
Name: ntt_avx2_asm
|
|
32
|
+
Description: x86_64 AVX2 forward NTT
|
|
33
|
+
Signature: void mlk_ntt_avx2_asm(int16_t *r, const int16_t *qdata)
|
|
34
|
+
ABI:
|
|
35
|
+
Architecture: x86_64
|
|
36
|
+
CallingConvention: SysV
|
|
37
|
+
Features: [AVX2]
|
|
38
|
+
rdi:
|
|
39
|
+
type: buffer
|
|
40
|
+
size_bytes: 512
|
|
41
|
+
permissions: read/write
|
|
42
|
+
c_parameter: int16_t *r
|
|
43
|
+
description: Input/output polynomial (256 x int16_t)
|
|
44
|
+
rsi:
|
|
45
|
+
type: buffer
|
|
46
|
+
size_bytes: 1248
|
|
47
|
+
permissions: read-only
|
|
48
|
+
c_parameter: const int16_t *qdata
|
|
49
|
+
description: Precomputed constants (624 x int16_t)
|
|
50
|
+
*/
|
|
51
|
+
|
|
30
52
|
|
|
31
53
|
/*
|
|
32
54
|
* WARNING: This file is auto-derived from the mlkem-native source file
|
|
33
|
-
* dev/x86_64/src/
|
|
55
|
+
* dev/x86_64/src/mlkem_ntt_avx2_asm.S using scripts/simpasm. Do not modify it directly.
|
|
34
56
|
*/
|
|
35
57
|
|
|
36
58
|
.text
|
|
@@ -20,11 +20,35 @@
|
|
|
20
20
|
#include "../../../common.h"
|
|
21
21
|
|
|
22
22
|
#if defined(MLK_ARITH_BACKEND_X86_64_DEFAULT) && \
|
|
23
|
-
!defined(MLK_CONFIG_MULTILEVEL_NO_SHARED)
|
|
23
|
+
!defined(MLK_CONFIG_MULTILEVEL_NO_SHARED) && \
|
|
24
|
+
(!defined(MLK_CONFIG_NO_ENCAPS_API) || \
|
|
25
|
+
!defined(MLK_CONFIG_NO_DECAPS_API))
|
|
26
|
+
/*yaml
|
|
27
|
+
Name: nttfrombytes_avx2_asm
|
|
28
|
+
Description: x86_64 AVX2 polynomial deserialization in NTT domain
|
|
29
|
+
Signature: void mlk_nttfrombytes_avx2_asm(int16_t *r, const uint8_t *a)
|
|
30
|
+
ABI:
|
|
31
|
+
Architecture: x86_64
|
|
32
|
+
CallingConvention: SysV
|
|
33
|
+
Features: [AVX2]
|
|
34
|
+
rdi:
|
|
35
|
+
type: buffer
|
|
36
|
+
size_bytes: 512
|
|
37
|
+
permissions: write-only
|
|
38
|
+
c_parameter: int16_t *r
|
|
39
|
+
description: Output polynomial (256 x int16_t)
|
|
40
|
+
rsi:
|
|
41
|
+
type: buffer
|
|
42
|
+
size_bytes: 384
|
|
43
|
+
permissions: read-only
|
|
44
|
+
c_parameter: const uint8_t *a
|
|
45
|
+
description: Input byte array (MLKEM_POLYBYTES = 384)
|
|
46
|
+
*/
|
|
47
|
+
|
|
24
48
|
|
|
25
49
|
/*
|
|
26
50
|
* WARNING: This file is auto-derived from the mlkem-native source file
|
|
27
|
-
* dev/x86_64/src/
|
|
51
|
+
* dev/x86_64/src/mlkem_nttfrombytes_avx2_asm.S using scripts/simpasm. Do not modify it directly.
|
|
28
52
|
*/
|
|
29
53
|
|
|
30
54
|
.text
|
|
@@ -186,7 +210,7 @@ MLK_ASM_FN_SYMBOL(nttfrombytes_avx2_asm)
|
|
|
186
210
|
MLK_ASM_FN_SIZE(nttfrombytes_avx2_asm)
|
|
187
211
|
|
|
188
212
|
#endif /* MLK_ARITH_BACKEND_X86_64_DEFAULT && !MLK_CONFIG_MULTILEVEL_NO_SHARED \
|
|
189
|
-
|
|
213
|
+
&& (!MLK_CONFIG_NO_ENCAPS_API || !MLK_CONFIG_NO_DECAPS_API) */
|
|
190
214
|
|
|
191
215
|
#if defined(__ELF__)
|
|
192
216
|
.section .note.GNU-stack,"",%progbits
|
|
@@ -20,11 +20,35 @@
|
|
|
20
20
|
#include "../../../common.h"
|
|
21
21
|
|
|
22
22
|
#if defined(MLK_ARITH_BACKEND_X86_64_DEFAULT) && \
|
|
23
|
-
!defined(MLK_CONFIG_MULTILEVEL_NO_SHARED)
|
|
23
|
+
!defined(MLK_CONFIG_MULTILEVEL_NO_SHARED) && \
|
|
24
|
+
(!defined(MLK_CONFIG_NO_KEYPAIR_API) || \
|
|
25
|
+
!defined(MLK_CONFIG_NO_ENCAPS_API))
|
|
26
|
+
/*yaml
|
|
27
|
+
Name: ntttobytes_avx2_asm
|
|
28
|
+
Description: x86_64 AVX2 polynomial serialization in NTT domain
|
|
29
|
+
Signature: void mlk_ntttobytes_avx2_asm(uint8_t *r, const int16_t *a)
|
|
30
|
+
ABI:
|
|
31
|
+
Architecture: x86_64
|
|
32
|
+
CallingConvention: SysV
|
|
33
|
+
Features: [AVX2]
|
|
34
|
+
rdi:
|
|
35
|
+
type: buffer
|
|
36
|
+
size_bytes: 384
|
|
37
|
+
permissions: write-only
|
|
38
|
+
c_parameter: uint8_t *r
|
|
39
|
+
description: Output byte array (MLKEM_POLYBYTES = 384)
|
|
40
|
+
rsi:
|
|
41
|
+
type: buffer
|
|
42
|
+
size_bytes: 512
|
|
43
|
+
permissions: read-only
|
|
44
|
+
c_parameter: const int16_t *a
|
|
45
|
+
description: Input polynomial (256 x int16_t)
|
|
46
|
+
*/
|
|
47
|
+
|
|
24
48
|
|
|
25
49
|
/*
|
|
26
50
|
* WARNING: This file is auto-derived from the mlkem-native source file
|
|
27
|
-
* dev/x86_64/src/
|
|
51
|
+
* dev/x86_64/src/mlkem_ntttobytes_avx2_asm.S using scripts/simpasm. Do not modify it directly.
|
|
28
52
|
*/
|
|
29
53
|
|
|
30
54
|
.text
|
|
@@ -174,7 +198,7 @@ MLK_ASM_FN_SYMBOL(ntttobytes_avx2_asm)
|
|
|
174
198
|
MLK_ASM_FN_SIZE(ntttobytes_avx2_asm)
|
|
175
199
|
|
|
176
200
|
#endif /* MLK_ARITH_BACKEND_X86_64_DEFAULT && !MLK_CONFIG_MULTILEVEL_NO_SHARED \
|
|
177
|
-
|
|
201
|
+
&& (!MLK_CONFIG_NO_KEYPAIR_API || !MLK_CONFIG_NO_ENCAPS_API) */
|
|
178
202
|
|
|
179
203
|
#if defined(__ELF__)
|
|
180
204
|
.section .note.GNU-stack,"",%progbits
|
|
@@ -21,10 +21,26 @@
|
|
|
21
21
|
|
|
22
22
|
#if defined(MLK_ARITH_BACKEND_X86_64_DEFAULT) && \
|
|
23
23
|
!defined(MLK_CONFIG_MULTILEVEL_NO_SHARED)
|
|
24
|
+
/*yaml
|
|
25
|
+
Name: nttunpack_avx2_asm
|
|
26
|
+
Description: x86_64 AVX2 NTT unpack from custom to bitreversed order
|
|
27
|
+
Signature: void mlk_nttunpack_avx2_asm(int16_t *r)
|
|
28
|
+
ABI:
|
|
29
|
+
Architecture: x86_64
|
|
30
|
+
CallingConvention: SysV
|
|
31
|
+
Features: [AVX2]
|
|
32
|
+
rdi:
|
|
33
|
+
type: buffer
|
|
34
|
+
size_bytes: 512
|
|
35
|
+
permissions: read/write
|
|
36
|
+
c_parameter: int16_t *r
|
|
37
|
+
description: Input/output polynomial (256 x int16_t)
|
|
38
|
+
*/
|
|
39
|
+
|
|
24
40
|
|
|
25
41
|
/*
|
|
26
42
|
* WARNING: This file is auto-derived from the mlkem-native source file
|
|
27
|
-
* dev/x86_64/src/
|
|
43
|
+
* dev/x86_64/src/mlkem_nttunpack_avx2_asm.S using scripts/simpasm. Do not modify it directly.
|
|
28
44
|
*/
|
|
29
45
|
|
|
30
46
|
.text
|
|
@@ -31,11 +31,41 @@
|
|
|
31
31
|
#include "../../../common.h"
|
|
32
32
|
#if defined(MLK_ARITH_BACKEND_X86_64_DEFAULT) && \
|
|
33
33
|
!defined(MLK_CONFIG_MULTILEVEL_NO_SHARED) && \
|
|
34
|
+
(!defined(MLK_CONFIG_NO_ENCAPS_API) || \
|
|
35
|
+
!defined(MLK_CONFIG_NO_DECAPS_API)) && \
|
|
34
36
|
(defined(MLK_CONFIG_MULTILEVEL_WITH_SHARED) || MLKEM_K == 2 || MLKEM_K == 3)
|
|
37
|
+
/*yaml
|
|
38
|
+
Name: poly_compress_d10_avx2_asm
|
|
39
|
+
Description: x86_64 AVX2 polynomial compression (d=10)
|
|
40
|
+
Signature: void mlk_poly_compress_d10_avx2_asm(uint8_t *r, const int16_t *a, const uint8_t *data)
|
|
41
|
+
ABI:
|
|
42
|
+
Architecture: x86_64
|
|
43
|
+
CallingConvention: SysV
|
|
44
|
+
Features: [AVX2]
|
|
45
|
+
rdi:
|
|
46
|
+
type: buffer
|
|
47
|
+
size_bytes: 320
|
|
48
|
+
permissions: write-only
|
|
49
|
+
c_parameter: uint8_t *r
|
|
50
|
+
description: Output compressed polynomial
|
|
51
|
+
rsi:
|
|
52
|
+
type: buffer
|
|
53
|
+
size_bytes: 512
|
|
54
|
+
permissions: read-only
|
|
55
|
+
c_parameter: const int16_t *a
|
|
56
|
+
description: Input polynomial (256 x int16_t)
|
|
57
|
+
rdx:
|
|
58
|
+
type: buffer
|
|
59
|
+
size_bytes: 32
|
|
60
|
+
permissions: read-only
|
|
61
|
+
c_parameter: const uint8_t *data
|
|
62
|
+
description: Precomputed compression constants
|
|
63
|
+
*/
|
|
64
|
+
|
|
35
65
|
|
|
36
66
|
/*
|
|
37
67
|
* WARNING: This file is auto-derived from the mlkem-native source file
|
|
38
|
-
* dev/x86_64/src/
|
|
68
|
+
* dev/x86_64/src/mlkem_poly_compress_d10_avx2_asm.S using scripts/simpasm. Do not modify it directly.
|
|
39
69
|
*/
|
|
40
70
|
|
|
41
71
|
.text
|
|
@@ -374,8 +404,9 @@ MLK_ASM_FN_SYMBOL(poly_compress_d10_avx2_asm)
|
|
|
374
404
|
MLK_ASM_FN_SIZE(poly_compress_d10_avx2_asm)
|
|
375
405
|
|
|
376
406
|
#endif /* MLK_ARITH_BACKEND_X86_64_DEFAULT && !MLK_CONFIG_MULTILEVEL_NO_SHARED \
|
|
377
|
-
&& (
|
|
378
|
-
3)
|
|
407
|
+
&& (!MLK_CONFIG_NO_ENCAPS_API || !MLK_CONFIG_NO_DECAPS_API) && \
|
|
408
|
+
(MLK_CONFIG_MULTILEVEL_WITH_SHARED || MLKEM_K == 2 || MLKEM_K == 3) \
|
|
409
|
+
*/
|
|
379
410
|
|
|
380
411
|
#if defined(__ELF__)
|
|
381
412
|
.section .note.GNU-stack,"",%progbits
|
|
@@ -33,11 +33,41 @@
|
|
|
33
33
|
|
|
34
34
|
#if defined(MLK_ARITH_BACKEND_X86_64_DEFAULT) && \
|
|
35
35
|
!defined(MLK_CONFIG_MULTILEVEL_NO_SHARED) && \
|
|
36
|
+
(!defined(MLK_CONFIG_NO_ENCAPS_API) || \
|
|
37
|
+
!defined(MLK_CONFIG_NO_DECAPS_API)) && \
|
|
36
38
|
(defined(MLK_CONFIG_MULTILEVEL_WITH_SHARED) || MLKEM_K == 4)
|
|
39
|
+
/*yaml
|
|
40
|
+
Name: poly_compress_d11_avx2_asm
|
|
41
|
+
Description: x86_64 AVX2 polynomial compression (d=11)
|
|
42
|
+
Signature: void mlk_poly_compress_d11_avx2_asm(uint8_t *r, const int16_t *a, const uint8_t *data)
|
|
43
|
+
ABI:
|
|
44
|
+
Architecture: x86_64
|
|
45
|
+
CallingConvention: SysV
|
|
46
|
+
Features: [AVX2]
|
|
47
|
+
rdi:
|
|
48
|
+
type: buffer
|
|
49
|
+
size_bytes: 352
|
|
50
|
+
permissions: write-only
|
|
51
|
+
c_parameter: uint8_t *r
|
|
52
|
+
description: Output compressed polynomial
|
|
53
|
+
rsi:
|
|
54
|
+
type: buffer
|
|
55
|
+
size_bytes: 512
|
|
56
|
+
permissions: read-only
|
|
57
|
+
c_parameter: const int16_t *a
|
|
58
|
+
description: Input polynomial (256 x int16_t)
|
|
59
|
+
rdx:
|
|
60
|
+
type: buffer
|
|
61
|
+
size_bytes: 64
|
|
62
|
+
permissions: read-only
|
|
63
|
+
c_parameter: const uint8_t *data
|
|
64
|
+
description: Precomputed compression constants
|
|
65
|
+
*/
|
|
66
|
+
|
|
37
67
|
|
|
38
68
|
/*
|
|
39
69
|
* WARNING: This file is auto-derived from the mlkem-native source file
|
|
40
|
-
* dev/x86_64/src/
|
|
70
|
+
* dev/x86_64/src/mlkem_poly_compress_d11_avx2_asm.S using scripts/simpasm. Do not modify it directly.
|
|
41
71
|
*/
|
|
42
72
|
|
|
43
73
|
.text
|
|
@@ -441,7 +471,8 @@ MLK_ASM_FN_SYMBOL(poly_compress_d11_avx2_asm)
|
|
|
441
471
|
MLK_ASM_FN_SIZE(poly_compress_d11_avx2_asm)
|
|
442
472
|
|
|
443
473
|
#endif /* MLK_ARITH_BACKEND_X86_64_DEFAULT && !MLK_CONFIG_MULTILEVEL_NO_SHARED \
|
|
444
|
-
&& (
|
|
474
|
+
&& (!MLK_CONFIG_NO_ENCAPS_API || !MLK_CONFIG_NO_DECAPS_API) && \
|
|
475
|
+
(MLK_CONFIG_MULTILEVEL_WITH_SHARED || MLKEM_K == 4) */
|
|
445
476
|
|
|
446
477
|
#if defined(__ELF__)
|
|
447
478
|
.section .note.GNU-stack,"",%progbits
|
|
@@ -31,11 +31,41 @@
|
|
|
31
31
|
#include "../../../common.h"
|
|
32
32
|
#if defined(MLK_ARITH_BACKEND_X86_64_DEFAULT) && \
|
|
33
33
|
!defined(MLK_CONFIG_MULTILEVEL_NO_SHARED) && \
|
|
34
|
+
(!defined(MLK_CONFIG_NO_ENCAPS_API) || \
|
|
35
|
+
!defined(MLK_CONFIG_NO_DECAPS_API)) && \
|
|
34
36
|
(defined(MLK_CONFIG_MULTILEVEL_WITH_SHARED) || MLKEM_K == 2 || MLKEM_K == 3)
|
|
37
|
+
/*yaml
|
|
38
|
+
Name: poly_compress_d4_avx2_asm
|
|
39
|
+
Description: x86_64 AVX2 polynomial compression (d=4)
|
|
40
|
+
Signature: void mlk_poly_compress_d4_avx2_asm(uint8_t *r, const int16_t *a, const uint8_t *data)
|
|
41
|
+
ABI:
|
|
42
|
+
Architecture: x86_64
|
|
43
|
+
CallingConvention: SysV
|
|
44
|
+
Features: [AVX2]
|
|
45
|
+
rdi:
|
|
46
|
+
type: buffer
|
|
47
|
+
size_bytes: 128
|
|
48
|
+
permissions: write-only
|
|
49
|
+
c_parameter: uint8_t *r
|
|
50
|
+
description: Output compressed polynomial
|
|
51
|
+
rsi:
|
|
52
|
+
type: buffer
|
|
53
|
+
size_bytes: 512
|
|
54
|
+
permissions: read-only
|
|
55
|
+
c_parameter: const int16_t *a
|
|
56
|
+
description: Input polynomial (256 x int16_t)
|
|
57
|
+
rdx:
|
|
58
|
+
type: buffer
|
|
59
|
+
size_bytes: 32
|
|
60
|
+
permissions: read-only
|
|
61
|
+
c_parameter: const uint8_t *data
|
|
62
|
+
description: Precomputed compression constants
|
|
63
|
+
*/
|
|
64
|
+
|
|
35
65
|
|
|
36
66
|
/*
|
|
37
67
|
* WARNING: This file is auto-derived from the mlkem-native source file
|
|
38
|
-
* dev/x86_64/src/
|
|
68
|
+
* dev/x86_64/src/mlkem_poly_compress_d4_avx2_asm.S using scripts/simpasm. Do not modify it directly.
|
|
39
69
|
*/
|
|
40
70
|
|
|
41
71
|
.text
|
|
@@ -155,8 +185,9 @@ MLK_ASM_FN_SYMBOL(poly_compress_d4_avx2_asm)
|
|
|
155
185
|
MLK_ASM_FN_SIZE(poly_compress_d4_avx2_asm)
|
|
156
186
|
|
|
157
187
|
#endif /* MLK_ARITH_BACKEND_X86_64_DEFAULT && !MLK_CONFIG_MULTILEVEL_NO_SHARED \
|
|
158
|
-
&& (
|
|
159
|
-
3)
|
|
188
|
+
&& (!MLK_CONFIG_NO_ENCAPS_API || !MLK_CONFIG_NO_DECAPS_API) && \
|
|
189
|
+
(MLK_CONFIG_MULTILEVEL_WITH_SHARED || MLKEM_K == 2 || MLKEM_K == 3) \
|
|
190
|
+
*/
|
|
160
191
|
|
|
161
192
|
#if defined(__ELF__)
|
|
162
193
|
.section .note.GNU-stack,"",%progbits
|