pq_crypto 0.6.2 → 0.6.3
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 +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 +6 -3
- data/ext/pqcrypto/vendor/mlkem-native/RELEASE.md +22 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/mlkem_native.c +77 -36
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/mlkem_native.h +135 -146
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/mlkem_native_asm.S +116 -72
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/mlkem_native_config.h +351 -415
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/cbmc.h +43 -20
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/common.h +16 -8
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/compress.c +57 -31
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/compress.h +260 -349
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/debug.h +17 -24
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/fips202.c +35 -37
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/fips202.h +43 -57
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/fips202x4.c +14 -15
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/fips202x4.h +5 -4
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/keccakf1600.c +42 -6
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/src/fips202_native_aarch64.h +31 -20
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/src/{keccak_f1600_x1_scalar_asm.S → keccak_f1600_x1_scalar_aarch64_asm.S} +10 -10
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/src/{keccak_f1600_x1_v84a_asm.S → keccak_f1600_x1_v84a_aarch64_asm.S} +10 -10
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/src/{keccak_f1600_x2_v84a_asm.S → keccak_f1600_x2_v84a_aarch64_asm.S} +10 -10
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/src/{keccak_f1600_x4_v8a_scalar_hybrid_asm.S → keccak_f1600_x4_v8a_scalar_hybrid_aarch64_asm.S} +10 -10
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/src/{keccak_f1600_x4_v8a_v84a_scalar_hybrid_asm.S → keccak_f1600_x4_v8a_v84a_scalar_hybrid_aarch64_asm.S} +10 -10
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/src/keccakf1600_round_constants.c +10 -9
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/x1_scalar.h +2 -1
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/x1_v84a.h +1 -1
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/x2_v84a.h +4 -2
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/x4_v8a_scalar.h +2 -2
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/x4_v8a_v84a_scalar.h +1 -1
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/armv81m/src/fips202_native_armv81m.h +2 -1
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/armv81m/src/keccak_f1600_x4_mve.S +55 -9
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/armv81m/src/keccakf1600_round_constants.c +26 -25
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/armv81m/src/state_extract_bytes_x4_mve.S +58 -14
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/armv81m/src/state_xor_bytes_x4_mve.S +57 -16
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/auto.h +2 -1
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/x86_64/keccak_f1600_x4_avx2.h +2 -2
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/x86_64/src/fips202_native_x86_64.h +10 -7
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/x86_64/src/{keccak_f1600_x4_avx2.S → keccak_f1600_x4_avx2_asm.S} +13 -11
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/x86_64/src/keccakf1600_constants.c +12 -11
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/indcpa.c +167 -136
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/indcpa.h +75 -68
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/kem.h +135 -157
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/meta.h +15 -13
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/aarch64_zetas.c +143 -135
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/arith_native_aarch64.h +52 -46
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/{intt.S → intt_aarch64_asm.S} +10 -10
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/{ntt.S → ntt_aarch64_asm.S} +10 -10
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/{poly_mulcache_compute_asm.S → poly_mulcache_compute_aarch64_asm.S} +10 -10
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/{poly_reduce_asm.S → poly_reduce_aarch64_asm.S} +10 -10
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/{poly_tobytes_asm.S → poly_tobytes_aarch64_asm.S} +10 -10
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/{poly_tomont_asm.S → poly_tomont_aarch64_asm.S} +10 -12
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/{polyvec_basemul_acc_montgomery_cached_asm_k2.S → polyvec_basemul_acc_montgomery_cached_k2_aarch64_asm.S} +10 -10
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/{polyvec_basemul_acc_montgomery_cached_asm_k3.S → polyvec_basemul_acc_montgomery_cached_k3_aarch64_asm.S} +10 -10
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/{polyvec_basemul_acc_montgomery_cached_asm_k4.S → polyvec_basemul_acc_montgomery_cached_k4_aarch64_asm.S} +10 -10
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/{rej_uniform_asm.S → rej_uniform_aarch64_asm.S} +12 -12
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/rej_uniform_table.c +514 -513
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/api.h +254 -253
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/meta.h +6 -1
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/ppc64le/README.md +6 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/ppc64le/meta.h +77 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/ppc64le/src/arith_native_ppc64le.h +24 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/ppc64le/src/consts.c +299 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/ppc64le/src/consts.h +34 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/ppc64le/src/intt_ppc_asm.S +3222 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/ppc64le/src/ntt_ppc_asm.S +1651 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/ppc64le/src/poly_tomont_ppc_asm.S +294 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/ppc64le/src/reduce_ppc_asm.S +710 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/riscv64/meta.h +5 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/riscv64/src/rv64v_debug.c +18 -16
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/riscv64/src/rv64v_debug.h +19 -24
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/riscv64/src/rv64v_poly.c +53 -65
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/meta.h +20 -20
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/arith_native_x86_64.h +106 -88
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/compress_consts.c +45 -35
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/compress_consts.h +8 -8
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/consts.c +1 -1
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/consts.h +1 -1
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/{intt.S → intt_avx2_asm.S} +8 -8
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/{ntt.S → ntt_avx2_asm.S} +8 -8
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/{nttfrombytes.S → nttfrombytes_avx2_asm.S} +8 -8
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/{ntttobytes.S → ntttobytes_avx2_asm.S} +8 -8
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/{nttunpack.S → nttunpack_avx2_asm.S} +8 -8
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/{poly_compress_d10.S → poly_compress_d10_avx2_asm.S} +9 -9
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/{poly_compress_d11.S → poly_compress_d11_avx2_asm.S} +9 -9
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/{poly_compress_d4.S → poly_compress_d4_avx2_asm.S} +9 -9
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/{poly_compress_d5.S → poly_compress_d5_avx2_asm.S} +9 -9
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/{poly_decompress_d10.S → poly_decompress_d10_avx2_asm.S} +9 -9
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/{poly_decompress_d11.S → poly_decompress_d11_avx2_asm.S} +9 -9
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/{poly_decompress_d4.S → poly_decompress_d4_avx2_asm.S} +9 -9
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/{poly_decompress_d5.S → poly_decompress_d5_avx2_asm.S} +9 -9
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/{mulcache_compute.S → poly_mulcache_compute_avx2_asm.S} +8 -8
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/{polyvec_basemul_acc_montgomery_cached_asm_k2.S → polyvec_basemul_acc_montgomery_cached_k2_avx2_asm.S} +8 -8
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/{polyvec_basemul_acc_montgomery_cached_asm_k3.S → polyvec_basemul_acc_montgomery_cached_k3_avx2_asm.S} +8 -8
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/{polyvec_basemul_acc_montgomery_cached_asm_k4.S → polyvec_basemul_acc_montgomery_cached_k4_avx2_asm.S} +8 -8
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/{reduce.S → reduce_avx2_asm.S} +8 -8
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/{rej_uniform_asm.S → rej_uniform_avx2_asm.S} +9 -9
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/rej_uniform_table.c +514 -513
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/{tomont.S → tomont_avx2_asm.S} +8 -8
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/poly.c +61 -57
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/poly.h +89 -116
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/poly_k.c +31 -32
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/poly_k.h +226 -301
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/randombytes.h +21 -29
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/sampling.c +68 -63
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/sampling.h +37 -48
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/sys.h +44 -2
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/verify.h +141 -159
- data/lib/pq_crypto/version.rb +1 -1
- data/script/vendor_libs.rb +3 -3
- metadata +47 -38
data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/armv81m/src/state_xor_bytes_x4_mve.S
CHANGED
|
@@ -72,19 +72,39 @@
|
|
|
72
72
|
.global MLK_ASM_NAMESPACE(keccak_f1600_x4_state_xor_bytes_asm)
|
|
73
73
|
MLK_ASM_FN_SYMBOL(keccak_f1600_x4_state_xor_bytes_asm)
|
|
74
74
|
|
|
75
|
+
.cfi_startproc
|
|
75
76
|
push.w {r4, r5, r6, r7, r8, r9, r10, r11, r12, lr}
|
|
77
|
+
.cfi_adjust_cfa_offset 0x28
|
|
78
|
+
.cfi_rel_offset r4, 0x0
|
|
79
|
+
.cfi_rel_offset r5, 0x4
|
|
80
|
+
.cfi_rel_offset r6, 0x8
|
|
81
|
+
.cfi_rel_offset r7, 0xc
|
|
82
|
+
.cfi_rel_offset r8, 0x10
|
|
83
|
+
.cfi_rel_offset r9, 0x14
|
|
84
|
+
.cfi_rel_offset r10, 0x18
|
|
85
|
+
.cfi_rel_offset r11, 0x1c
|
|
86
|
+
.cfi_rel_offset lr, 0x24
|
|
76
87
|
vpush {d8, d9, d10, d11, d12, d13, d14, d15}
|
|
88
|
+
.cfi_adjust_cfa_offset 0x40
|
|
89
|
+
.cfi_rel_offset d8, 0x0
|
|
90
|
+
.cfi_rel_offset d9, 0x8
|
|
91
|
+
.cfi_rel_offset d10, 0x10
|
|
92
|
+
.cfi_rel_offset d11, 0x18
|
|
93
|
+
.cfi_rel_offset d12, 0x20
|
|
94
|
+
.cfi_rel_offset d13, 0x28
|
|
95
|
+
.cfi_rel_offset d14, 0x30
|
|
96
|
+
.cfi_rel_offset d15, 0x38
|
|
77
97
|
ldr r4, [sp, #0x68]
|
|
78
98
|
ldr.w r10, [sp, #0x6c]
|
|
79
99
|
ldr r6, [sp, #0x70]
|
|
80
100
|
cmp r6, #0x0
|
|
81
|
-
beq.w
|
|
101
|
+
beq.w Lkeccak_f1600_x4_state_xor_bytes_asm_exit @ imm = #0x346
|
|
82
102
|
and r5, r10, #0x7
|
|
83
103
|
bic r9, r10, #0x7
|
|
84
104
|
add.w r8, r0, r9, lsl #1
|
|
85
105
|
add.w r7, r8, #0x190
|
|
86
106
|
cmp r5, #0x0
|
|
87
|
-
beq.w
|
|
107
|
+
beq.w Lkeccak_f1600_x4_state_xor_bytes_asm_pre_main @ imm = #0x12c
|
|
88
108
|
subs r1, r1, r5
|
|
89
109
|
subs r2, r2, r5
|
|
90
110
|
subs r3, r3, r5
|
|
@@ -98,7 +118,7 @@ MLK_ASM_FN_SYMBOL(keccak_f1600_x4_state_xor_bytes_asm)
|
|
|
98
118
|
vmrs r11, p0
|
|
99
119
|
lsl.w r11, r11, r5
|
|
100
120
|
vmsr p0, r11
|
|
101
|
-
vpstttt
|
|
121
|
+
vpstttt
|
|
102
122
|
vldrbt.u8 q0, [r1], #4
|
|
103
123
|
vldrbt.u8 q1, [r2], #4
|
|
104
124
|
vldrbt.u8 q2, [r3], #4
|
|
@@ -163,21 +183,19 @@ MLK_ASM_FN_SYMBOL(keccak_f1600_x4_state_xor_bytes_asm)
|
|
|
163
183
|
vstrw.32 q5, [r7], #16
|
|
164
184
|
vmov q7[2], q7[0], r1, r3
|
|
165
185
|
vmov q7[3], q7[1], r2, r4
|
|
166
|
-
|
|
167
|
-
beq.w keccak_f1600_x4_state_xor_bytes_asm_exit @ imm = #0x206
|
|
168
|
-
b keccak_f1600_x4_state_xor_bytes_asm_main_body @ imm = #0xe
|
|
186
|
+
b Lkeccak_f1600_x4_state_xor_bytes_asm_main_body @ imm = #0xe
|
|
169
187
|
|
|
170
|
-
|
|
188
|
+
Lkeccak_f1600_x4_state_xor_bytes_asm_pre_main:
|
|
171
189
|
vmov q7[2], q7[0], r1, r3
|
|
172
190
|
vmov q7[3], q7[1], r2, r4
|
|
173
191
|
mov.w r0, #0x4
|
|
174
192
|
vsub.i32 q7, q7, r0
|
|
175
193
|
|
|
176
|
-
|
|
194
|
+
Lkeccak_f1600_x4_state_xor_bytes_asm_main_body:
|
|
177
195
|
lsr.w lr, r6, #0x3
|
|
178
|
-
wls lr, lr,
|
|
196
|
+
wls lr, lr, Lkeccak_f1600_x4_state_xor_bytes_asm_main_loop_end @ imm = #0xd4
|
|
179
197
|
|
|
180
|
-
|
|
198
|
+
Lkeccak_f1600_x4_state_xor_bytes_asm_main_loop_start:
|
|
181
199
|
vldrw.u32 q0, [q7, #4]!
|
|
182
200
|
vldrw.u32 q1, [q7, #4]!
|
|
183
201
|
vmov q2, q0
|
|
@@ -230,17 +248,17 @@ keccak_f1600_x4_state_xor_bytes_asm_main_loop_start:
|
|
|
230
248
|
veor q5, q5, q1
|
|
231
249
|
vstrw.32 q4, [r8], #16
|
|
232
250
|
vstrw.32 q5, [r7], #16
|
|
233
|
-
le lr,
|
|
251
|
+
le lr, Lkeccak_f1600_x4_state_xor_bytes_asm_main_loop_start @ imm = #-0xd4
|
|
234
252
|
|
|
235
|
-
|
|
253
|
+
Lkeccak_f1600_x4_state_xor_bytes_asm_main_loop_end:
|
|
236
254
|
ands r6, r6, #0x7
|
|
237
|
-
beq.w
|
|
255
|
+
beq.w Lkeccak_f1600_x4_state_xor_bytes_asm_exit @ imm = #0x110
|
|
238
256
|
mov.w r0, #0x4
|
|
239
257
|
vadd.i32 q7, q7, r0
|
|
240
258
|
vmov r1, r3, q7[2], q7[0]
|
|
241
259
|
vmov r2, r4, q7[3], q7[1]
|
|
242
260
|
vctp.8 r6
|
|
243
|
-
vpstttt
|
|
261
|
+
vpstttt
|
|
244
262
|
vldrbt.u8 q0, [r1]
|
|
245
263
|
vldrbt.u8 q1, [r2]
|
|
246
264
|
vldrbt.u8 q2, [r3]
|
|
@@ -304,11 +322,34 @@ keccak_f1600_x4_state_xor_bytes_asm_main_loop_end:
|
|
|
304
322
|
vstrw.32 q4, [r8], #16
|
|
305
323
|
vstrw.32 q5, [r7], #16
|
|
306
324
|
|
|
307
|
-
|
|
325
|
+
Lkeccak_f1600_x4_state_xor_bytes_asm_exit:
|
|
308
326
|
vpop {d8, d9, d10, d11, d12, d13, d14, d15}
|
|
327
|
+
.cfi_restore d8
|
|
328
|
+
.cfi_restore d9
|
|
329
|
+
.cfi_restore d10
|
|
330
|
+
.cfi_restore d11
|
|
331
|
+
.cfi_restore d12
|
|
332
|
+
.cfi_restore d13
|
|
333
|
+
.cfi_restore d14
|
|
334
|
+
.cfi_restore d15
|
|
335
|
+
.cfi_adjust_cfa_offset -0x40
|
|
309
336
|
pop.w {r4, r5, r6, r7, r8, r9, r10, r11, r12, pc}
|
|
310
|
-
|
|
337
|
+
.cfi_restore r4
|
|
338
|
+
.cfi_restore r5
|
|
339
|
+
.cfi_restore r6
|
|
340
|
+
.cfi_restore r7
|
|
341
|
+
.cfi_restore r8
|
|
342
|
+
.cfi_restore r9
|
|
343
|
+
.cfi_restore r10
|
|
344
|
+
.cfi_restore r11
|
|
345
|
+
.cfi_restore lr
|
|
346
|
+
.cfi_adjust_cfa_offset -0x28
|
|
347
|
+
.cfi_endproc
|
|
311
348
|
|
|
312
349
|
MLK_ASM_FN_SIZE(keccak_f1600_x4_state_xor_bytes_asm)
|
|
313
350
|
|
|
314
351
|
#endif /* MLK_FIPS202_ARMV81M_NEED_X4 && !MLK_CONFIG_MULTILEVEL_NO_SHARED */
|
|
352
|
+
|
|
353
|
+
#if defined(__ELF__)
|
|
354
|
+
.section .note.GNU-stack,"",%progbits
|
|
355
|
+
#endif
|
|
@@ -15,7 +15,8 @@
|
|
|
15
15
|
#include "aarch64/auto.h"
|
|
16
16
|
#endif
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
/* The x86_64 backend requires toolchain support for the SysV ABI */
|
|
19
|
+
#if defined(MLK_SYS_X86_64_AVX2) && defined(MLK_SYSV_ABI_SUPPORTED)
|
|
19
20
|
#include "x86_64/keccak_f1600_x4_avx2.h"
|
|
20
21
|
#endif
|
|
21
22
|
|
data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/x86_64/keccak_f1600_x4_avx2.h
CHANGED
|
@@ -24,8 +24,8 @@ static MLK_INLINE int mlk_keccak_f1600_x4_native(uint64_t *state)
|
|
|
24
24
|
return MLK_NATIVE_FUNC_FALLBACK;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
mlk_keccak_f1600_x4_avx2_asm(state, mlk_keccakf1600_round_constants,
|
|
28
|
+
mlk_keccak_rho8, mlk_keccak_rho56);
|
|
29
29
|
return MLK_NATIVE_FUNC_SUCCESS;
|
|
30
30
|
}
|
|
31
31
|
#endif /* !__ASSEMBLER__ */
|
data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/x86_64/src/fips202_native_x86_64.h
CHANGED
|
@@ -17,19 +17,22 @@
|
|
|
17
17
|
|
|
18
18
|
#define mlk_keccakf1600_round_constants \
|
|
19
19
|
MLK_NAMESPACE(keccakf1600_round_constants)
|
|
20
|
-
|
|
20
|
+
MLK_INTERNAL_DATA_DECLARATION const uint64_t
|
|
21
|
+
mlk_keccakf1600_round_constants[24];
|
|
21
22
|
|
|
22
23
|
#define mlk_keccak_rho8 MLK_NAMESPACE(keccak_rho8)
|
|
23
|
-
|
|
24
|
+
MLK_INTERNAL_DATA_DECLARATION const uint64_t mlk_keccak_rho8[4];
|
|
24
25
|
|
|
25
26
|
#define mlk_keccak_rho56 MLK_NAMESPACE(keccak_rho56)
|
|
26
|
-
|
|
27
|
+
MLK_INTERNAL_DATA_DECLARATION const uint64_t mlk_keccak_rho56[4];
|
|
27
28
|
|
|
28
|
-
#define
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
#define mlk_keccak_f1600_x4_avx2_asm MLK_NAMESPACE(keccak_f1600_x4_avx2_asm)
|
|
30
|
+
MLK_SYSV_ABI
|
|
31
|
+
void mlk_keccak_f1600_x4_avx2_asm(uint64_t states[100], const uint64_t rc[24],
|
|
32
|
+
const uint64_t rho8[4],
|
|
33
|
+
const uint64_t rho56[4])
|
|
31
34
|
/* This must be kept in sync with the HOL-Light specification
|
|
32
|
-
* in proofs/hol_light/x86_64/proofs/
|
|
35
|
+
* in proofs/hol_light/x86_64/proofs/keccak_f1600_x4_avx2_asm.ml */
|
|
33
36
|
__contract__(
|
|
34
37
|
requires(memory_no_alias(states, sizeof(uint64_t) * 25 * 4))
|
|
35
38
|
requires(rc == mlk_keccakf1600_round_constants)
|
|
@@ -9,21 +9,19 @@
|
|
|
9
9
|
|
|
10
10
|
/*
|
|
11
11
|
* WARNING: This file is auto-derived from the mlkem-native source file
|
|
12
|
-
* dev/fips202/x86_64/src/
|
|
12
|
+
* dev/fips202/x86_64/src/keccak_f1600_x4_avx2_asm.S using scripts/simpasm. Do not modify it directly.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
#if defined(__ELF__)
|
|
16
|
-
.section .note.GNU-stack,"",@progbits
|
|
17
|
-
#endif
|
|
18
|
-
|
|
19
15
|
.text
|
|
20
16
|
.balign 4
|
|
21
|
-
.global MLK_ASM_NAMESPACE(
|
|
22
|
-
MLK_ASM_FN_SYMBOL(
|
|
17
|
+
.global MLK_ASM_NAMESPACE(keccak_f1600_x4_avx2_asm)
|
|
18
|
+
MLK_ASM_FN_SYMBOL(keccak_f1600_x4_avx2_asm)
|
|
23
19
|
|
|
24
20
|
.cfi_startproc
|
|
21
|
+
movq %rsp, %r11
|
|
22
|
+
.cfi_def_cfa_register %r11
|
|
23
|
+
andq $-0x20, %rsp
|
|
25
24
|
subq $0x300, %rsp # imm = 0x300
|
|
26
|
-
.cfi_adjust_cfa_offset 0x300
|
|
27
25
|
vmovdqu (%rdi), %ymm0
|
|
28
26
|
vmovdqu 0xc8(%rdi), %ymm3
|
|
29
27
|
vmovdqu 0x190(%rdi), %ymm1
|
|
@@ -441,11 +439,15 @@ LLkeccak_f1600_x4_avx2:
|
|
|
441
439
|
vmovhpd %xmm3, 0x188(%rdi)
|
|
442
440
|
vmovq %xmm15, 0x250(%rdi)
|
|
443
441
|
vmovhpd %xmm15, 0x318(%rdi)
|
|
444
|
-
|
|
445
|
-
.
|
|
442
|
+
movq %r11, %rsp
|
|
443
|
+
.cfi_def_cfa_register %rsp
|
|
446
444
|
retq
|
|
447
445
|
.cfi_endproc
|
|
448
446
|
|
|
449
|
-
MLK_ASM_FN_SIZE(
|
|
447
|
+
MLK_ASM_FN_SIZE(keccak_f1600_x4_avx2_asm)
|
|
450
448
|
|
|
451
449
|
#endif /* MLK_FIPS202_X86_64_NEED_X4_AVX2 && !MLK_CONFIG_MULTILEVEL_NO_SHARED */
|
|
450
|
+
|
|
451
|
+
#if defined(__ELF__)
|
|
452
|
+
.section .note.GNU-stack,"",%progbits
|
|
453
|
+
#endif
|
data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/x86_64/src/keccakf1600_constants.c
CHANGED
|
@@ -17,25 +17,26 @@
|
|
|
17
17
|
|
|
18
18
|
#include "fips202_native_x86_64.h"
|
|
19
19
|
|
|
20
|
-
MLK_ALIGN const uint64_t
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
20
|
+
MLK_ALIGN MLK_INTERNAL_DATA_DEFINITION const uint64_t
|
|
21
|
+
mlk_keccakf1600_round_constants[24] = {
|
|
22
|
+
0x0000000000000001, 0x0000000000008082, 0x800000000000808a,
|
|
23
|
+
0x8000000080008000, 0x000000000000808b, 0x0000000080000001,
|
|
24
|
+
0x8000000080008081, 0x8000000000008009, 0x000000000000008a,
|
|
25
|
+
0x0000000000000088, 0x0000000080008009, 0x000000008000000a,
|
|
26
|
+
0x000000008000808b, 0x800000000000008b, 0x8000000000008089,
|
|
27
|
+
0x8000000000008003, 0x8000000000008002, 0x8000000000000080,
|
|
28
|
+
0x000000000000800a, 0x800000008000000a, 0x8000000080008081,
|
|
29
|
+
0x8000000000008080, 0x0000000080000001, 0x8000000080008008,
|
|
29
30
|
};
|
|
30
31
|
|
|
31
|
-
MLK_ALIGN const uint64_t mlk_keccak_rho8[] = {
|
|
32
|
+
MLK_ALIGN MLK_INTERNAL_DATA_DEFINITION const uint64_t mlk_keccak_rho8[4] = {
|
|
32
33
|
0x0605040302010007,
|
|
33
34
|
0x0e0d0c0b0a09080f,
|
|
34
35
|
0x1615141312111017,
|
|
35
36
|
0x1e1d1c1b1a19181f,
|
|
36
37
|
};
|
|
37
38
|
|
|
38
|
-
MLK_ALIGN const uint64_t mlk_keccak_rho56[] = {
|
|
39
|
+
MLK_ALIGN MLK_INTERNAL_DATA_DEFINITION const uint64_t mlk_keccak_rho56[4] = {
|
|
39
40
|
0x0007060504030201,
|
|
40
41
|
0x080f0e0d0c0b0a09,
|
|
41
42
|
0x1017161514131211,
|