mldsa_gh 0.1.0
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 +7 -0
- data/LICENSE +21 -0
- data/README.md +88 -0
- data/ext/mldsa_gh_native/extconf.rb +14 -0
- data/ext/mldsa_gh_native/mldsa_gh_native.c +222 -0
- data/ext/mldsa_gh_native/mldsa_gh_native_all.c +24 -0
- data/ext/mldsa_gh_native/mldsa_gh_native_all.h +26 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/BUILDING.md +108 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/LICENSE +305 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/README.md +247 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/README.md +23 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/mldsa_native.c +803 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/mldsa_native.h +956 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/mldsa_native_asm.S +830 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/mldsa_native_config.h +855 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/cbmc.h +233 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/common.h +301 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/context.h +152 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/ct.c +21 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/ct.h +373 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/debug.c +75 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/debug.h +125 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/fips202/fips202.c +270 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/fips202/fips202.h +224 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/fips202/fips202x4.c +187 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/fips202/fips202x4.h +125 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/fips202/keccakf1600.c +510 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/fips202/keccakf1600.h +110 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/auto.h +85 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/src/fips202_native_aarch64.h +69 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/src/keccak_f1600_x1_scalar_aarch64_asm.S +378 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/src/keccak_f1600_x1_v84a_aarch64_asm.S +207 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/src/keccak_f1600_x2_v84a_aarch64_asm.S +262 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/src/keccak_f1600_x4_v8a_scalar_hybrid_aarch64_asm.S +1080 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/src/keccak_f1600_x4_v8a_v84a_scalar_hybrid_aarch64_asm.S +990 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/src/keccakf1600_round_constants.c +47 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/x1_scalar.h +27 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/x1_v84a.h +36 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/x2_v84a.h +40 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/x4_v8a_scalar.h +32 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/x4_v8a_v84a_scalar.h +37 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/fips202/native/api.h +129 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/fips202/native/armv81m/README.md +10 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/fips202/native/armv81m/mve.h +67 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/fips202/native/armv81m/src/fips202_native_armv81m.h +37 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/fips202/native/armv81m/src/keccak_f1600_x4_mve.S +717 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/fips202/native/armv81m/src/keccak_f1600_x4_mve.c +42 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/fips202/native/armv81m/src/keccak_f1600_x4_state_extract_bytes_mve.S +334 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/fips202/native/armv81m/src/keccak_f1600_x4_state_xor_bytes_mve.S +355 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/fips202/native/armv81m/src/keccakf1600_round_constants.c +53 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/fips202/native/auto.h +35 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/fips202/native/x86_64/keccak_f1600_x4_avx2.h +34 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/fips202/native/x86_64/src/fips202_native_x86_64.h +45 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/fips202/native/x86_64/src/keccak_f1600_x4_avx2_asm.S +488 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/fips202/native/x86_64/src/keccakf1600_constants.c +52 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/native/aarch64/meta.h +314 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/native/aarch64/src/aarch64_zetas.c +248 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/native/aarch64/src/arith_native_aarch64.h +367 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/native/aarch64/src/mldsa_intt_aarch64_asm.S +786 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/native/aarch64/src/mldsa_ntt_aarch64_asm.S +686 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/native/aarch64/src/mldsa_pointwise_montgomery_aarch64_asm.S +106 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/native/aarch64/src/mldsa_poly_caddq_aarch64_asm.S +69 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/native/aarch64/src/mldsa_poly_chknorm_aarch64_asm.S +76 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/native/aarch64/src/mldsa_poly_decompose_32_aarch64_asm.S +108 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/native/aarch64/src/mldsa_poly_decompose_88_aarch64_asm.S +108 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/native/aarch64/src/mldsa_poly_use_hint_32_aarch64_asm.S +125 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/native/aarch64/src/mldsa_poly_use_hint_88_aarch64_asm.S +133 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/native/aarch64/src/mldsa_polyvecl_pointwise_acc_montgomery_l4_aarch64_asm.S +157 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/native/aarch64/src/mldsa_polyvecl_pointwise_acc_montgomery_l5_aarch64_asm.S +173 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/native/aarch64/src/mldsa_polyvecl_pointwise_acc_montgomery_l7_aarch64_asm.S +205 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/native/aarch64/src/mldsa_polyz_unpack_17_aarch64_asm.S +103 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/native/aarch64/src/mldsa_polyz_unpack_19_aarch64_asm.S +100 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/native/aarch64/src/mldsa_rej_uniform_aarch64_asm.S +222 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/native/aarch64/src/mldsa_rej_uniform_eta2_aarch64_asm.S +170 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/native/aarch64/src/mldsa_rej_uniform_eta4_aarch64_asm.S +163 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/native/aarch64/src/polyz_unpack_table.c +52 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/native/aarch64/src/rej_uniform_eta_table.c +547 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/native/aarch64/src/rej_uniform_table.c +63 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/native/api.h +617 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/native/meta.h +24 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/native/x86_64/meta.h +323 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/native/x86_64/src/arith_native_x86_64.h +330 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/native/x86_64/src/consts.c +157 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/native/x86_64/src/consts.h +27 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_intt_avx2_asm.S +2333 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_ntt_avx2_asm.S +2405 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_nttunpack_avx2_asm.S +254 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_pointwise_acc_l4_avx2_asm.S +173 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_pointwise_acc_l5_avx2_asm.S +189 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_pointwise_acc_l7_avx2_asm.S +221 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_pointwise_avx2_asm.S +158 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_poly_caddq_avx2_asm.S +199 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_poly_chknorm_avx2_asm.S +176 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_poly_decompose_32_avx2_asm.S +490 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_poly_decompose_88_avx2_asm.S +489 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_poly_use_hint_32_avx2_asm.S +123 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_poly_use_hint_88_avx2_asm.S +125 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_polyz_unpack_17_avx2_asm.S +355 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_polyz_unpack_19_avx2_asm.S +355 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_rej_uniform_avx2_asm.S +132 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_rej_uniform_eta2_avx2_asm.S +205 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_rej_uniform_eta4_avx2_asm.S +176 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/native/x86_64/src/rej_uniform_table.c +161 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/packing.c +213 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/packing.h +277 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/params.h +153 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/poly.c +1066 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/poly.h +464 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/poly_kl.c +910 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/poly_kl.h +367 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/polyvec.c +509 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/polyvec.h +435 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/polyvec_lazy.c +311 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/polyvec_lazy.h +652 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/randombytes.h +26 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/reduce.h +144 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/rounding.h +265 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/sign.c +1720 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/sign.h +850 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/symmetric.h +68 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/sys.h +327 -0
- data/ext/mldsa_gh_native/vendor/mldsa-native/mldsa/src/zetas.inc +55 -0
- data/lib/mldsa/parameter_set.rb +82 -0
- data/lib/mldsa/signing_key.rb +147 -0
- data/lib/mldsa/verify_key.rb +72 -0
- data/lib/mldsa/version.rb +7 -0
- data/lib/mldsa_gh.rb +93 -0
- metadata +225 -0
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) The mldsa-native project authors
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0 OR ISC OR MIT
|
|
4
|
+
*/
|
|
5
|
+
/*yaml
|
|
6
|
+
Name: poly_use_hint_88_aarch64_asm
|
|
7
|
+
Description: AArch64 hint application (alpha = (Q-1)/88)
|
|
8
|
+
Signature: void mld_poly_use_hint_88_aarch64_asm(int32_t a[256], const int32_t h[256])
|
|
9
|
+
ABI:
|
|
10
|
+
Architecture: aarch64
|
|
11
|
+
CallingConvention: AAPCS64
|
|
12
|
+
Features: [NEON]
|
|
13
|
+
x0:
|
|
14
|
+
type: buffer
|
|
15
|
+
size_bytes: 1024
|
|
16
|
+
permissions: read/write
|
|
17
|
+
c_parameter: int32_t a[256]
|
|
18
|
+
description: Input/output polynomial (256 x int32_t)
|
|
19
|
+
x1:
|
|
20
|
+
type: buffer
|
|
21
|
+
size_bytes: 1024
|
|
22
|
+
permissions: read-only
|
|
23
|
+
c_parameter: const int32_t h[256]
|
|
24
|
+
description: Hint polynomial (256 x int32_t)
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
#include "../../../common.h"
|
|
28
|
+
|
|
29
|
+
#if defined(MLD_ARITH_BACKEND_AARCH64) && !defined(MLD_CONFIG_NO_VERIFY_API) && !defined(MLD_CONFIG_MULTILEVEL_NO_SHARED) && \
|
|
30
|
+
(defined(MLD_CONFIG_MULTILEVEL_WITH_SHARED) || MLD_CONFIG_PARAMETER_SET == 44)
|
|
31
|
+
|
|
32
|
+
/*
|
|
33
|
+
* WARNING: This file is auto-derived from the mldsa-native source file
|
|
34
|
+
* dev/aarch64_opt/src/mldsa_poly_use_hint_88_aarch64_asm.S using scripts/simpasm. Do not modify it directly.
|
|
35
|
+
*/
|
|
36
|
+
|
|
37
|
+
.text
|
|
38
|
+
.balign 4
|
|
39
|
+
.global MLD_ASM_NAMESPACE(poly_use_hint_88_aarch64_asm)
|
|
40
|
+
MLD_ASM_FN_SYMBOL(poly_use_hint_88_aarch64_asm)
|
|
41
|
+
|
|
42
|
+
.cfi_startproc
|
|
43
|
+
mov w4, #0xe001 // =57345
|
|
44
|
+
movk w4, #0x7f, lsl #16
|
|
45
|
+
dup v20.4s, w4
|
|
46
|
+
mov w5, #0x6c00 // =27648
|
|
47
|
+
movk w5, #0x7e, lsl #16
|
|
48
|
+
dup v21.4s, w5
|
|
49
|
+
mov w7, #0xe800 // =59392
|
|
50
|
+
movk w7, #0x2, lsl #16
|
|
51
|
+
dup v22.4s, w7
|
|
52
|
+
mov w11, #0x581 // =1409
|
|
53
|
+
movk w11, #0x5816, lsl #16
|
|
54
|
+
dup v23.4s, w11
|
|
55
|
+
movi v24.4s, #0x2b
|
|
56
|
+
mov x3, #0x10 // =16
|
|
57
|
+
|
|
58
|
+
Lmld_poly_use_hint_88_loop:
|
|
59
|
+
ldr q1, [x0, #0x10]
|
|
60
|
+
ldr q2, [x0, #0x20]
|
|
61
|
+
ldr q3, [x0, #0x30]
|
|
62
|
+
ldr q0, [x0]
|
|
63
|
+
ldr q5, [x1, #0x10]
|
|
64
|
+
ldr q6, [x1, #0x20]
|
|
65
|
+
ldr q7, [x1, #0x30]
|
|
66
|
+
ldr q4, [x1], #0x40
|
|
67
|
+
sqdmulh v17.4s, v1.4s, v23.4s
|
|
68
|
+
srshr v17.4s, v17.4s, #0x11
|
|
69
|
+
cmgt v25.4s, v1.4s, v21.4s
|
|
70
|
+
mls v1.4s, v17.4s, v22.4s
|
|
71
|
+
bic v17.16b, v17.16b, v25.16b
|
|
72
|
+
add v1.4s, v1.4s, v25.4s
|
|
73
|
+
cmle v1.4s, v1.4s, #0
|
|
74
|
+
orr v1.4s, #0x1
|
|
75
|
+
mla v17.4s, v1.4s, v5.4s
|
|
76
|
+
cmgt v25.4s, v17.4s, v24.4s
|
|
77
|
+
bic v17.16b, v17.16b, v25.16b
|
|
78
|
+
umin v17.4s, v17.4s, v24.4s
|
|
79
|
+
sqdmulh v18.4s, v2.4s, v23.4s
|
|
80
|
+
srshr v18.4s, v18.4s, #0x11
|
|
81
|
+
cmgt v25.4s, v2.4s, v21.4s
|
|
82
|
+
mls v2.4s, v18.4s, v22.4s
|
|
83
|
+
bic v18.16b, v18.16b, v25.16b
|
|
84
|
+
add v2.4s, v2.4s, v25.4s
|
|
85
|
+
cmle v2.4s, v2.4s, #0
|
|
86
|
+
orr v2.4s, #0x1
|
|
87
|
+
mla v18.4s, v2.4s, v6.4s
|
|
88
|
+
cmgt v25.4s, v18.4s, v24.4s
|
|
89
|
+
bic v18.16b, v18.16b, v25.16b
|
|
90
|
+
umin v18.4s, v18.4s, v24.4s
|
|
91
|
+
sqdmulh v19.4s, v3.4s, v23.4s
|
|
92
|
+
srshr v19.4s, v19.4s, #0x11
|
|
93
|
+
cmgt v25.4s, v3.4s, v21.4s
|
|
94
|
+
mls v3.4s, v19.4s, v22.4s
|
|
95
|
+
bic v19.16b, v19.16b, v25.16b
|
|
96
|
+
add v3.4s, v3.4s, v25.4s
|
|
97
|
+
cmle v3.4s, v3.4s, #0
|
|
98
|
+
orr v3.4s, #0x1
|
|
99
|
+
mla v19.4s, v3.4s, v7.4s
|
|
100
|
+
cmgt v25.4s, v19.4s, v24.4s
|
|
101
|
+
bic v19.16b, v19.16b, v25.16b
|
|
102
|
+
umin v19.4s, v19.4s, v24.4s
|
|
103
|
+
sqdmulh v16.4s, v0.4s, v23.4s
|
|
104
|
+
srshr v16.4s, v16.4s, #0x11
|
|
105
|
+
cmgt v25.4s, v0.4s, v21.4s
|
|
106
|
+
mls v0.4s, v16.4s, v22.4s
|
|
107
|
+
bic v16.16b, v16.16b, v25.16b
|
|
108
|
+
add v0.4s, v0.4s, v25.4s
|
|
109
|
+
cmle v0.4s, v0.4s, #0
|
|
110
|
+
orr v0.4s, #0x1
|
|
111
|
+
mla v16.4s, v0.4s, v4.4s
|
|
112
|
+
cmgt v25.4s, v16.4s, v24.4s
|
|
113
|
+
bic v16.16b, v16.16b, v25.16b
|
|
114
|
+
umin v16.4s, v16.4s, v24.4s
|
|
115
|
+
str q17, [x0, #0x10]
|
|
116
|
+
str q18, [x0, #0x20]
|
|
117
|
+
str q19, [x0, #0x30]
|
|
118
|
+
str q16, [x0], #0x40
|
|
119
|
+
subs x3, x3, #0x1
|
|
120
|
+
b.ne Lmld_poly_use_hint_88_loop
|
|
121
|
+
ret
|
|
122
|
+
.cfi_endproc
|
|
123
|
+
|
|
124
|
+
MLD_ASM_FN_SIZE(poly_use_hint_88_aarch64_asm)
|
|
125
|
+
|
|
126
|
+
#endif /* MLD_ARITH_BACKEND_AARCH64 && !MLD_CONFIG_NO_VERIFY_API && \
|
|
127
|
+
!MLD_CONFIG_MULTILEVEL_NO_SHARED && \
|
|
128
|
+
(MLD_CONFIG_MULTILEVEL_WITH_SHARED || MLD_CONFIG_PARAMETER_SET == 44) \
|
|
129
|
+
*/
|
|
130
|
+
|
|
131
|
+
#if defined(__ELF__)
|
|
132
|
+
.section .note.GNU-stack,"",%progbits
|
|
133
|
+
#endif
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
/* Copyright (c) The mldsa-native project authors
|
|
2
|
+
* SPDX-License-Identifier: Apache-2.0 OR ISC OR MIT
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/*yaml
|
|
6
|
+
Name: polyvecl_pointwise_acc_montgomery_l4_aarch64_asm
|
|
7
|
+
Description: AArch64 pointwise multiply-accumulate of length-4 polynomial vectors
|
|
8
|
+
Signature: void mld_polyvecl_pointwise_acc_montgomery_l4_aarch64_asm(int32_t r[256], const int32_t a[4][256], const int32_t b[4][256])
|
|
9
|
+
ABI:
|
|
10
|
+
Architecture: aarch64
|
|
11
|
+
CallingConvention: AAPCS64
|
|
12
|
+
Features: [NEON]
|
|
13
|
+
x0:
|
|
14
|
+
type: buffer
|
|
15
|
+
size_bytes: 1024
|
|
16
|
+
permissions: write-only
|
|
17
|
+
c_parameter: int32_t r[256]
|
|
18
|
+
description: Output polynomial (256 x int32_t)
|
|
19
|
+
x1:
|
|
20
|
+
type: buffer
|
|
21
|
+
size_bytes: 4096
|
|
22
|
+
permissions: read-only
|
|
23
|
+
c_parameter: const int32_t a[4][256]
|
|
24
|
+
description: Input polynomial vector a (4 x 256 x int32_t)
|
|
25
|
+
x2:
|
|
26
|
+
type: buffer
|
|
27
|
+
size_bytes: 4096
|
|
28
|
+
permissions: read-only
|
|
29
|
+
c_parameter: const int32_t b[4][256]
|
|
30
|
+
description: Input polynomial vector b (4 x 256 x int32_t)
|
|
31
|
+
*/
|
|
32
|
+
|
|
33
|
+
#include "../../../common.h"
|
|
34
|
+
#if defined(MLD_ARITH_BACKEND_AARCH64) && !defined(MLD_CONFIG_MULTILEVEL_NO_SHARED) && \
|
|
35
|
+
(defined(MLD_CONFIG_MULTILEVEL_WITH_SHARED) || MLDSA_L == 4)
|
|
36
|
+
|
|
37
|
+
/*
|
|
38
|
+
* WARNING: This file is auto-derived from the mldsa-native source file
|
|
39
|
+
* dev/aarch64_opt/src/mldsa_polyvecl_pointwise_acc_montgomery_l4_aarch64_asm.S using scripts/simpasm. Do not modify it directly.
|
|
40
|
+
*/
|
|
41
|
+
|
|
42
|
+
.text
|
|
43
|
+
.balign 4
|
|
44
|
+
.global MLD_ASM_NAMESPACE(polyvecl_pointwise_acc_montgomery_l4_aarch64_asm)
|
|
45
|
+
MLD_ASM_FN_SYMBOL(polyvecl_pointwise_acc_montgomery_l4_aarch64_asm)
|
|
46
|
+
|
|
47
|
+
.cfi_startproc
|
|
48
|
+
mov w3, #0xe001 // =57345
|
|
49
|
+
movk w3, #0x7f, lsl #16
|
|
50
|
+
dup v0.4s, w3
|
|
51
|
+
mov w3, #0x2001 // =8193
|
|
52
|
+
movk w3, #0x380, lsl #16
|
|
53
|
+
dup v1.4s, w3
|
|
54
|
+
mov x3, #0x40 // =64
|
|
55
|
+
|
|
56
|
+
Lmld_polyvecl_pointwise_acc_montgomery_l4_loop_start:
|
|
57
|
+
ldr q17, [x1, #0x10]
|
|
58
|
+
ldr q18, [x1, #0x20]
|
|
59
|
+
ldr q19, [x1, #0x30]
|
|
60
|
+
ldr q16, [x1], #0x40
|
|
61
|
+
ldr q21, [x2, #0x10]
|
|
62
|
+
ldr q22, [x2, #0x20]
|
|
63
|
+
ldr q23, [x2, #0x30]
|
|
64
|
+
ldr q20, [x2], #0x40
|
|
65
|
+
smull v24.2d, v16.2s, v20.2s
|
|
66
|
+
smull2 v25.2d, v16.4s, v20.4s
|
|
67
|
+
smull v26.2d, v17.2s, v21.2s
|
|
68
|
+
smull2 v27.2d, v17.4s, v21.4s
|
|
69
|
+
smull v28.2d, v18.2s, v22.2s
|
|
70
|
+
smull2 v29.2d, v18.4s, v22.4s
|
|
71
|
+
smull v30.2d, v19.2s, v23.2s
|
|
72
|
+
smull2 v31.2d, v19.4s, v23.4s
|
|
73
|
+
ldr q16, [x1, #0x3c0]
|
|
74
|
+
ldr q17, [x1, #0x3d0]
|
|
75
|
+
ldr q18, [x1, #0x3e0]
|
|
76
|
+
ldr q19, [x1, #0x3f0]
|
|
77
|
+
ldr q20, [x2, #0x3c0]
|
|
78
|
+
ldr q21, [x2, #0x3d0]
|
|
79
|
+
ldr q22, [x2, #0x3e0]
|
|
80
|
+
ldr q23, [x2, #0x3f0]
|
|
81
|
+
smlal v24.2d, v16.2s, v20.2s
|
|
82
|
+
smlal2 v25.2d, v16.4s, v20.4s
|
|
83
|
+
smlal v26.2d, v17.2s, v21.2s
|
|
84
|
+
smlal2 v27.2d, v17.4s, v21.4s
|
|
85
|
+
smlal v28.2d, v18.2s, v22.2s
|
|
86
|
+
smlal2 v29.2d, v18.4s, v22.4s
|
|
87
|
+
smlal v30.2d, v19.2s, v23.2s
|
|
88
|
+
smlal2 v31.2d, v19.4s, v23.4s
|
|
89
|
+
ldr q16, [x1, #0x7c0]
|
|
90
|
+
ldr q17, [x1, #0x7d0]
|
|
91
|
+
ldr q18, [x1, #0x7e0]
|
|
92
|
+
ldr q19, [x1, #0x7f0]
|
|
93
|
+
ldr q20, [x2, #0x7c0]
|
|
94
|
+
ldr q21, [x2, #0x7d0]
|
|
95
|
+
ldr q22, [x2, #0x7e0]
|
|
96
|
+
ldr q23, [x2, #0x7f0]
|
|
97
|
+
smlal v24.2d, v16.2s, v20.2s
|
|
98
|
+
smlal2 v25.2d, v16.4s, v20.4s
|
|
99
|
+
smlal v26.2d, v17.2s, v21.2s
|
|
100
|
+
smlal2 v27.2d, v17.4s, v21.4s
|
|
101
|
+
smlal v28.2d, v18.2s, v22.2s
|
|
102
|
+
smlal2 v29.2d, v18.4s, v22.4s
|
|
103
|
+
smlal v30.2d, v19.2s, v23.2s
|
|
104
|
+
smlal2 v31.2d, v19.4s, v23.4s
|
|
105
|
+
ldr q16, [x1, #0xbc0]
|
|
106
|
+
ldr q17, [x1, #0xbd0]
|
|
107
|
+
ldr q18, [x1, #0xbe0]
|
|
108
|
+
ldr q19, [x1, #0xbf0]
|
|
109
|
+
ldr q20, [x2, #0xbc0]
|
|
110
|
+
ldr q21, [x2, #0xbd0]
|
|
111
|
+
ldr q22, [x2, #0xbe0]
|
|
112
|
+
ldr q23, [x2, #0xbf0]
|
|
113
|
+
smlal v24.2d, v16.2s, v20.2s
|
|
114
|
+
smlal2 v25.2d, v16.4s, v20.4s
|
|
115
|
+
smlal v26.2d, v17.2s, v21.2s
|
|
116
|
+
smlal2 v27.2d, v17.4s, v21.4s
|
|
117
|
+
smlal v28.2d, v18.2s, v22.2s
|
|
118
|
+
smlal2 v29.2d, v18.4s, v22.4s
|
|
119
|
+
smlal v30.2d, v19.2s, v23.2s
|
|
120
|
+
smlal2 v31.2d, v19.4s, v23.4s
|
|
121
|
+
uzp1 v16.4s, v24.4s, v25.4s
|
|
122
|
+
mul v16.4s, v16.4s, v1.4s
|
|
123
|
+
smlsl v24.2d, v16.2s, v0.2s
|
|
124
|
+
smlsl2 v25.2d, v16.4s, v0.4s
|
|
125
|
+
uzp2 v16.4s, v24.4s, v25.4s
|
|
126
|
+
uzp1 v17.4s, v26.4s, v27.4s
|
|
127
|
+
mul v17.4s, v17.4s, v1.4s
|
|
128
|
+
smlsl v26.2d, v17.2s, v0.2s
|
|
129
|
+
smlsl2 v27.2d, v17.4s, v0.4s
|
|
130
|
+
uzp2 v17.4s, v26.4s, v27.4s
|
|
131
|
+
uzp1 v18.4s, v28.4s, v29.4s
|
|
132
|
+
mul v18.4s, v18.4s, v1.4s
|
|
133
|
+
smlsl v28.2d, v18.2s, v0.2s
|
|
134
|
+
smlsl2 v29.2d, v18.4s, v0.4s
|
|
135
|
+
uzp2 v18.4s, v28.4s, v29.4s
|
|
136
|
+
uzp1 v19.4s, v30.4s, v31.4s
|
|
137
|
+
mul v19.4s, v19.4s, v1.4s
|
|
138
|
+
smlsl v30.2d, v19.2s, v0.2s
|
|
139
|
+
smlsl2 v31.2d, v19.4s, v0.4s
|
|
140
|
+
uzp2 v19.4s, v30.4s, v31.4s
|
|
141
|
+
str q17, [x0, #0x10]
|
|
142
|
+
str q18, [x0, #0x20]
|
|
143
|
+
str q19, [x0, #0x30]
|
|
144
|
+
str q16, [x0], #0x40
|
|
145
|
+
subs x3, x3, #0x4
|
|
146
|
+
cbnz x3, Lmld_polyvecl_pointwise_acc_montgomery_l4_loop_start
|
|
147
|
+
ret
|
|
148
|
+
.cfi_endproc
|
|
149
|
+
|
|
150
|
+
MLD_ASM_FN_SIZE(polyvecl_pointwise_acc_montgomery_l4_aarch64_asm)
|
|
151
|
+
|
|
152
|
+
#endif /* MLD_ARITH_BACKEND_AARCH64 && !MLD_CONFIG_MULTILEVEL_NO_SHARED && \
|
|
153
|
+
(MLD_CONFIG_MULTILEVEL_WITH_SHARED || MLDSA_L == 4) */
|
|
154
|
+
|
|
155
|
+
#if defined(__ELF__)
|
|
156
|
+
.section .note.GNU-stack,"",%progbits
|
|
157
|
+
#endif
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
/* Copyright (c) The mldsa-native project authors
|
|
2
|
+
* SPDX-License-Identifier: Apache-2.0 OR ISC OR MIT
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/*yaml
|
|
6
|
+
Name: polyvecl_pointwise_acc_montgomery_l5_aarch64_asm
|
|
7
|
+
Description: AArch64 pointwise multiply-accumulate of length-5 polynomial vectors
|
|
8
|
+
Signature: void mld_polyvecl_pointwise_acc_montgomery_l5_aarch64_asm(int32_t r[256], const int32_t a[5][256], const int32_t b[5][256])
|
|
9
|
+
ABI:
|
|
10
|
+
Architecture: aarch64
|
|
11
|
+
CallingConvention: AAPCS64
|
|
12
|
+
Features: [NEON]
|
|
13
|
+
x0:
|
|
14
|
+
type: buffer
|
|
15
|
+
size_bytes: 1024
|
|
16
|
+
permissions: write-only
|
|
17
|
+
c_parameter: int32_t r[256]
|
|
18
|
+
description: Output polynomial (256 x int32_t)
|
|
19
|
+
x1:
|
|
20
|
+
type: buffer
|
|
21
|
+
size_bytes: 5120
|
|
22
|
+
permissions: read-only
|
|
23
|
+
c_parameter: const int32_t a[5][256]
|
|
24
|
+
description: Input polynomial vector a (5 x 256 x int32_t)
|
|
25
|
+
x2:
|
|
26
|
+
type: buffer
|
|
27
|
+
size_bytes: 5120
|
|
28
|
+
permissions: read-only
|
|
29
|
+
c_parameter: const int32_t b[5][256]
|
|
30
|
+
description: Input polynomial vector b (5 x 256 x int32_t)
|
|
31
|
+
*/
|
|
32
|
+
|
|
33
|
+
#include "../../../common.h"
|
|
34
|
+
#if defined(MLD_ARITH_BACKEND_AARCH64) && !defined(MLD_CONFIG_MULTILEVEL_NO_SHARED) && \
|
|
35
|
+
(defined(MLD_CONFIG_MULTILEVEL_WITH_SHARED) || MLDSA_L == 5)
|
|
36
|
+
|
|
37
|
+
/*
|
|
38
|
+
* WARNING: This file is auto-derived from the mldsa-native source file
|
|
39
|
+
* dev/aarch64_opt/src/mldsa_polyvecl_pointwise_acc_montgomery_l5_aarch64_asm.S using scripts/simpasm. Do not modify it directly.
|
|
40
|
+
*/
|
|
41
|
+
|
|
42
|
+
.text
|
|
43
|
+
.balign 4
|
|
44
|
+
.global MLD_ASM_NAMESPACE(polyvecl_pointwise_acc_montgomery_l5_aarch64_asm)
|
|
45
|
+
MLD_ASM_FN_SYMBOL(polyvecl_pointwise_acc_montgomery_l5_aarch64_asm)
|
|
46
|
+
|
|
47
|
+
.cfi_startproc
|
|
48
|
+
mov w3, #0xe001 // =57345
|
|
49
|
+
movk w3, #0x7f, lsl #16
|
|
50
|
+
dup v0.4s, w3
|
|
51
|
+
mov w3, #0x2001 // =8193
|
|
52
|
+
movk w3, #0x380, lsl #16
|
|
53
|
+
dup v1.4s, w3
|
|
54
|
+
mov x3, #0x40 // =64
|
|
55
|
+
|
|
56
|
+
Lmld_polyvecl_pointwise_acc_montgomery_l5_loop_start:
|
|
57
|
+
ldr q17, [x1, #0x10]
|
|
58
|
+
ldr q18, [x1, #0x20]
|
|
59
|
+
ldr q19, [x1, #0x30]
|
|
60
|
+
ldr q16, [x1], #0x40
|
|
61
|
+
ldr q21, [x2, #0x10]
|
|
62
|
+
ldr q22, [x2, #0x20]
|
|
63
|
+
ldr q23, [x2, #0x30]
|
|
64
|
+
ldr q20, [x2], #0x40
|
|
65
|
+
smull v24.2d, v16.2s, v20.2s
|
|
66
|
+
smull2 v25.2d, v16.4s, v20.4s
|
|
67
|
+
smull v26.2d, v17.2s, v21.2s
|
|
68
|
+
smull2 v27.2d, v17.4s, v21.4s
|
|
69
|
+
smull v28.2d, v18.2s, v22.2s
|
|
70
|
+
smull2 v29.2d, v18.4s, v22.4s
|
|
71
|
+
smull v30.2d, v19.2s, v23.2s
|
|
72
|
+
smull2 v31.2d, v19.4s, v23.4s
|
|
73
|
+
ldr q16, [x1, #0x3c0]
|
|
74
|
+
ldr q17, [x1, #0x3d0]
|
|
75
|
+
ldr q18, [x1, #0x3e0]
|
|
76
|
+
ldr q19, [x1, #0x3f0]
|
|
77
|
+
ldr q20, [x2, #0x3c0]
|
|
78
|
+
ldr q21, [x2, #0x3d0]
|
|
79
|
+
ldr q22, [x2, #0x3e0]
|
|
80
|
+
ldr q23, [x2, #0x3f0]
|
|
81
|
+
smlal v24.2d, v16.2s, v20.2s
|
|
82
|
+
smlal2 v25.2d, v16.4s, v20.4s
|
|
83
|
+
smlal v26.2d, v17.2s, v21.2s
|
|
84
|
+
smlal2 v27.2d, v17.4s, v21.4s
|
|
85
|
+
smlal v28.2d, v18.2s, v22.2s
|
|
86
|
+
smlal2 v29.2d, v18.4s, v22.4s
|
|
87
|
+
smlal v30.2d, v19.2s, v23.2s
|
|
88
|
+
smlal2 v31.2d, v19.4s, v23.4s
|
|
89
|
+
ldr q16, [x1, #0x7c0]
|
|
90
|
+
ldr q17, [x1, #0x7d0]
|
|
91
|
+
ldr q18, [x1, #0x7e0]
|
|
92
|
+
ldr q19, [x1, #0x7f0]
|
|
93
|
+
ldr q20, [x2, #0x7c0]
|
|
94
|
+
ldr q21, [x2, #0x7d0]
|
|
95
|
+
ldr q22, [x2, #0x7e0]
|
|
96
|
+
ldr q23, [x2, #0x7f0]
|
|
97
|
+
smlal v24.2d, v16.2s, v20.2s
|
|
98
|
+
smlal2 v25.2d, v16.4s, v20.4s
|
|
99
|
+
smlal v26.2d, v17.2s, v21.2s
|
|
100
|
+
smlal2 v27.2d, v17.4s, v21.4s
|
|
101
|
+
smlal v28.2d, v18.2s, v22.2s
|
|
102
|
+
smlal2 v29.2d, v18.4s, v22.4s
|
|
103
|
+
smlal v30.2d, v19.2s, v23.2s
|
|
104
|
+
smlal2 v31.2d, v19.4s, v23.4s
|
|
105
|
+
ldr q16, [x1, #0xbc0]
|
|
106
|
+
ldr q17, [x1, #0xbd0]
|
|
107
|
+
ldr q18, [x1, #0xbe0]
|
|
108
|
+
ldr q19, [x1, #0xbf0]
|
|
109
|
+
ldr q20, [x2, #0xbc0]
|
|
110
|
+
ldr q21, [x2, #0xbd0]
|
|
111
|
+
ldr q22, [x2, #0xbe0]
|
|
112
|
+
ldr q23, [x2, #0xbf0]
|
|
113
|
+
smlal v24.2d, v16.2s, v20.2s
|
|
114
|
+
smlal2 v25.2d, v16.4s, v20.4s
|
|
115
|
+
smlal v26.2d, v17.2s, v21.2s
|
|
116
|
+
smlal2 v27.2d, v17.4s, v21.4s
|
|
117
|
+
smlal v28.2d, v18.2s, v22.2s
|
|
118
|
+
smlal2 v29.2d, v18.4s, v22.4s
|
|
119
|
+
smlal v30.2d, v19.2s, v23.2s
|
|
120
|
+
smlal2 v31.2d, v19.4s, v23.4s
|
|
121
|
+
ldr q16, [x1, #0xfc0]
|
|
122
|
+
ldr q17, [x1, #0xfd0]
|
|
123
|
+
ldr q18, [x1, #0xfe0]
|
|
124
|
+
ldr q19, [x1, #0xff0]
|
|
125
|
+
ldr q20, [x2, #0xfc0]
|
|
126
|
+
ldr q21, [x2, #0xfd0]
|
|
127
|
+
ldr q22, [x2, #0xfe0]
|
|
128
|
+
ldr q23, [x2, #0xff0]
|
|
129
|
+
smlal v24.2d, v16.2s, v20.2s
|
|
130
|
+
smlal2 v25.2d, v16.4s, v20.4s
|
|
131
|
+
smlal v26.2d, v17.2s, v21.2s
|
|
132
|
+
smlal2 v27.2d, v17.4s, v21.4s
|
|
133
|
+
smlal v28.2d, v18.2s, v22.2s
|
|
134
|
+
smlal2 v29.2d, v18.4s, v22.4s
|
|
135
|
+
smlal v30.2d, v19.2s, v23.2s
|
|
136
|
+
smlal2 v31.2d, v19.4s, v23.4s
|
|
137
|
+
uzp1 v16.4s, v24.4s, v25.4s
|
|
138
|
+
mul v16.4s, v16.4s, v1.4s
|
|
139
|
+
smlsl v24.2d, v16.2s, v0.2s
|
|
140
|
+
smlsl2 v25.2d, v16.4s, v0.4s
|
|
141
|
+
uzp2 v16.4s, v24.4s, v25.4s
|
|
142
|
+
uzp1 v17.4s, v26.4s, v27.4s
|
|
143
|
+
mul v17.4s, v17.4s, v1.4s
|
|
144
|
+
smlsl v26.2d, v17.2s, v0.2s
|
|
145
|
+
smlsl2 v27.2d, v17.4s, v0.4s
|
|
146
|
+
uzp2 v17.4s, v26.4s, v27.4s
|
|
147
|
+
uzp1 v18.4s, v28.4s, v29.4s
|
|
148
|
+
mul v18.4s, v18.4s, v1.4s
|
|
149
|
+
smlsl v28.2d, v18.2s, v0.2s
|
|
150
|
+
smlsl2 v29.2d, v18.4s, v0.4s
|
|
151
|
+
uzp2 v18.4s, v28.4s, v29.4s
|
|
152
|
+
uzp1 v19.4s, v30.4s, v31.4s
|
|
153
|
+
mul v19.4s, v19.4s, v1.4s
|
|
154
|
+
smlsl v30.2d, v19.2s, v0.2s
|
|
155
|
+
smlsl2 v31.2d, v19.4s, v0.4s
|
|
156
|
+
uzp2 v19.4s, v30.4s, v31.4s
|
|
157
|
+
str q17, [x0, #0x10]
|
|
158
|
+
str q18, [x0, #0x20]
|
|
159
|
+
str q19, [x0, #0x30]
|
|
160
|
+
str q16, [x0], #0x40
|
|
161
|
+
subs x3, x3, #0x4
|
|
162
|
+
cbnz x3, Lmld_polyvecl_pointwise_acc_montgomery_l5_loop_start
|
|
163
|
+
ret
|
|
164
|
+
.cfi_endproc
|
|
165
|
+
|
|
166
|
+
MLD_ASM_FN_SIZE(polyvecl_pointwise_acc_montgomery_l5_aarch64_asm)
|
|
167
|
+
|
|
168
|
+
#endif /* MLD_ARITH_BACKEND_AARCH64 && !MLD_CONFIG_MULTILEVEL_NO_SHARED && \
|
|
169
|
+
(MLD_CONFIG_MULTILEVEL_WITH_SHARED || MLDSA_L == 5) */
|
|
170
|
+
|
|
171
|
+
#if defined(__ELF__)
|
|
172
|
+
.section .note.GNU-stack,"",%progbits
|
|
173
|
+
#endif
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
/* Copyright (c) The mldsa-native project authors
|
|
2
|
+
* SPDX-License-Identifier: Apache-2.0 OR ISC OR MIT
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/*yaml
|
|
6
|
+
Name: polyvecl_pointwise_acc_montgomery_l7_aarch64_asm
|
|
7
|
+
Description: AArch64 pointwise multiply-accumulate of length-7 polynomial vectors
|
|
8
|
+
Signature: void mld_polyvecl_pointwise_acc_montgomery_l7_aarch64_asm(int32_t r[256], const int32_t a[7][256], const int32_t b[7][256])
|
|
9
|
+
ABI:
|
|
10
|
+
Architecture: aarch64
|
|
11
|
+
CallingConvention: AAPCS64
|
|
12
|
+
Features: [NEON]
|
|
13
|
+
x0:
|
|
14
|
+
type: buffer
|
|
15
|
+
size_bytes: 1024
|
|
16
|
+
permissions: write-only
|
|
17
|
+
c_parameter: int32_t r[256]
|
|
18
|
+
description: Output polynomial (256 x int32_t)
|
|
19
|
+
x1:
|
|
20
|
+
type: buffer
|
|
21
|
+
size_bytes: 7168
|
|
22
|
+
permissions: read-only
|
|
23
|
+
c_parameter: const int32_t a[7][256]
|
|
24
|
+
description: Input polynomial vector a (7 x 256 x int32_t)
|
|
25
|
+
x2:
|
|
26
|
+
type: buffer
|
|
27
|
+
size_bytes: 7168
|
|
28
|
+
permissions: read-only
|
|
29
|
+
c_parameter: const int32_t b[7][256]
|
|
30
|
+
description: Input polynomial vector b (7 x 256 x int32_t)
|
|
31
|
+
*/
|
|
32
|
+
|
|
33
|
+
#include "../../../common.h"
|
|
34
|
+
#if defined(MLD_ARITH_BACKEND_AARCH64) && !defined(MLD_CONFIG_MULTILEVEL_NO_SHARED) && \
|
|
35
|
+
(defined(MLD_CONFIG_MULTILEVEL_WITH_SHARED) || MLDSA_L == 7)
|
|
36
|
+
|
|
37
|
+
/*
|
|
38
|
+
* WARNING: This file is auto-derived from the mldsa-native source file
|
|
39
|
+
* dev/aarch64_opt/src/mldsa_polyvecl_pointwise_acc_montgomery_l7_aarch64_asm.S using scripts/simpasm. Do not modify it directly.
|
|
40
|
+
*/
|
|
41
|
+
|
|
42
|
+
.text
|
|
43
|
+
.balign 4
|
|
44
|
+
.global MLD_ASM_NAMESPACE(polyvecl_pointwise_acc_montgomery_l7_aarch64_asm)
|
|
45
|
+
MLD_ASM_FN_SYMBOL(polyvecl_pointwise_acc_montgomery_l7_aarch64_asm)
|
|
46
|
+
|
|
47
|
+
.cfi_startproc
|
|
48
|
+
mov w3, #0xe001 // =57345
|
|
49
|
+
movk w3, #0x7f, lsl #16
|
|
50
|
+
dup v0.4s, w3
|
|
51
|
+
mov w3, #0x2001 // =8193
|
|
52
|
+
movk w3, #0x380, lsl #16
|
|
53
|
+
dup v1.4s, w3
|
|
54
|
+
mov x3, #0x40 // =64
|
|
55
|
+
|
|
56
|
+
Lmld_polyvecl_pointwise_acc_montgomery_l7_loop_start:
|
|
57
|
+
ldr q17, [x1, #0x10]
|
|
58
|
+
ldr q18, [x1, #0x20]
|
|
59
|
+
ldr q19, [x1, #0x30]
|
|
60
|
+
ldr q16, [x1], #0x40
|
|
61
|
+
ldr q21, [x2, #0x10]
|
|
62
|
+
ldr q22, [x2, #0x20]
|
|
63
|
+
ldr q23, [x2, #0x30]
|
|
64
|
+
ldr q20, [x2], #0x40
|
|
65
|
+
smull v24.2d, v16.2s, v20.2s
|
|
66
|
+
smull2 v25.2d, v16.4s, v20.4s
|
|
67
|
+
smull v26.2d, v17.2s, v21.2s
|
|
68
|
+
smull2 v27.2d, v17.4s, v21.4s
|
|
69
|
+
smull v28.2d, v18.2s, v22.2s
|
|
70
|
+
smull2 v29.2d, v18.4s, v22.4s
|
|
71
|
+
smull v30.2d, v19.2s, v23.2s
|
|
72
|
+
smull2 v31.2d, v19.4s, v23.4s
|
|
73
|
+
ldr q16, [x1, #0x3c0]
|
|
74
|
+
ldr q17, [x1, #0x3d0]
|
|
75
|
+
ldr q18, [x1, #0x3e0]
|
|
76
|
+
ldr q19, [x1, #0x3f0]
|
|
77
|
+
ldr q20, [x2, #0x3c0]
|
|
78
|
+
ldr q21, [x2, #0x3d0]
|
|
79
|
+
ldr q22, [x2, #0x3e0]
|
|
80
|
+
ldr q23, [x2, #0x3f0]
|
|
81
|
+
smlal v24.2d, v16.2s, v20.2s
|
|
82
|
+
smlal2 v25.2d, v16.4s, v20.4s
|
|
83
|
+
smlal v26.2d, v17.2s, v21.2s
|
|
84
|
+
smlal2 v27.2d, v17.4s, v21.4s
|
|
85
|
+
smlal v28.2d, v18.2s, v22.2s
|
|
86
|
+
smlal2 v29.2d, v18.4s, v22.4s
|
|
87
|
+
smlal v30.2d, v19.2s, v23.2s
|
|
88
|
+
smlal2 v31.2d, v19.4s, v23.4s
|
|
89
|
+
ldr q16, [x1, #0x7c0]
|
|
90
|
+
ldr q17, [x1, #0x7d0]
|
|
91
|
+
ldr q18, [x1, #0x7e0]
|
|
92
|
+
ldr q19, [x1, #0x7f0]
|
|
93
|
+
ldr q20, [x2, #0x7c0]
|
|
94
|
+
ldr q21, [x2, #0x7d0]
|
|
95
|
+
ldr q22, [x2, #0x7e0]
|
|
96
|
+
ldr q23, [x2, #0x7f0]
|
|
97
|
+
smlal v24.2d, v16.2s, v20.2s
|
|
98
|
+
smlal2 v25.2d, v16.4s, v20.4s
|
|
99
|
+
smlal v26.2d, v17.2s, v21.2s
|
|
100
|
+
smlal2 v27.2d, v17.4s, v21.4s
|
|
101
|
+
smlal v28.2d, v18.2s, v22.2s
|
|
102
|
+
smlal2 v29.2d, v18.4s, v22.4s
|
|
103
|
+
smlal v30.2d, v19.2s, v23.2s
|
|
104
|
+
smlal2 v31.2d, v19.4s, v23.4s
|
|
105
|
+
ldr q16, [x1, #0xbc0]
|
|
106
|
+
ldr q17, [x1, #0xbd0]
|
|
107
|
+
ldr q18, [x1, #0xbe0]
|
|
108
|
+
ldr q19, [x1, #0xbf0]
|
|
109
|
+
ldr q20, [x2, #0xbc0]
|
|
110
|
+
ldr q21, [x2, #0xbd0]
|
|
111
|
+
ldr q22, [x2, #0xbe0]
|
|
112
|
+
ldr q23, [x2, #0xbf0]
|
|
113
|
+
smlal v24.2d, v16.2s, v20.2s
|
|
114
|
+
smlal2 v25.2d, v16.4s, v20.4s
|
|
115
|
+
smlal v26.2d, v17.2s, v21.2s
|
|
116
|
+
smlal2 v27.2d, v17.4s, v21.4s
|
|
117
|
+
smlal v28.2d, v18.2s, v22.2s
|
|
118
|
+
smlal2 v29.2d, v18.4s, v22.4s
|
|
119
|
+
smlal v30.2d, v19.2s, v23.2s
|
|
120
|
+
smlal2 v31.2d, v19.4s, v23.4s
|
|
121
|
+
ldr q16, [x1, #0xfc0]
|
|
122
|
+
ldr q17, [x1, #0xfd0]
|
|
123
|
+
ldr q18, [x1, #0xfe0]
|
|
124
|
+
ldr q19, [x1, #0xff0]
|
|
125
|
+
ldr q20, [x2, #0xfc0]
|
|
126
|
+
ldr q21, [x2, #0xfd0]
|
|
127
|
+
ldr q22, [x2, #0xfe0]
|
|
128
|
+
ldr q23, [x2, #0xff0]
|
|
129
|
+
smlal v24.2d, v16.2s, v20.2s
|
|
130
|
+
smlal2 v25.2d, v16.4s, v20.4s
|
|
131
|
+
smlal v26.2d, v17.2s, v21.2s
|
|
132
|
+
smlal2 v27.2d, v17.4s, v21.4s
|
|
133
|
+
smlal v28.2d, v18.2s, v22.2s
|
|
134
|
+
smlal2 v29.2d, v18.4s, v22.4s
|
|
135
|
+
smlal v30.2d, v19.2s, v23.2s
|
|
136
|
+
smlal2 v31.2d, v19.4s, v23.4s
|
|
137
|
+
ldr q16, [x1, #0x13c0]
|
|
138
|
+
ldr q17, [x1, #0x13d0]
|
|
139
|
+
ldr q18, [x1, #0x13e0]
|
|
140
|
+
ldr q19, [x1, #0x13f0]
|
|
141
|
+
ldr q20, [x2, #0x13c0]
|
|
142
|
+
ldr q21, [x2, #0x13d0]
|
|
143
|
+
ldr q22, [x2, #0x13e0]
|
|
144
|
+
ldr q23, [x2, #0x13f0]
|
|
145
|
+
smlal v24.2d, v16.2s, v20.2s
|
|
146
|
+
smlal2 v25.2d, v16.4s, v20.4s
|
|
147
|
+
smlal v26.2d, v17.2s, v21.2s
|
|
148
|
+
smlal2 v27.2d, v17.4s, v21.4s
|
|
149
|
+
smlal v28.2d, v18.2s, v22.2s
|
|
150
|
+
smlal2 v29.2d, v18.4s, v22.4s
|
|
151
|
+
smlal v30.2d, v19.2s, v23.2s
|
|
152
|
+
smlal2 v31.2d, v19.4s, v23.4s
|
|
153
|
+
ldr q16, [x1, #0x17c0]
|
|
154
|
+
ldr q17, [x1, #0x17d0]
|
|
155
|
+
ldr q18, [x1, #0x17e0]
|
|
156
|
+
ldr q19, [x1, #0x17f0]
|
|
157
|
+
ldr q20, [x2, #0x17c0]
|
|
158
|
+
ldr q21, [x2, #0x17d0]
|
|
159
|
+
ldr q22, [x2, #0x17e0]
|
|
160
|
+
ldr q23, [x2, #0x17f0]
|
|
161
|
+
smlal v24.2d, v16.2s, v20.2s
|
|
162
|
+
smlal2 v25.2d, v16.4s, v20.4s
|
|
163
|
+
smlal v26.2d, v17.2s, v21.2s
|
|
164
|
+
smlal2 v27.2d, v17.4s, v21.4s
|
|
165
|
+
smlal v28.2d, v18.2s, v22.2s
|
|
166
|
+
smlal2 v29.2d, v18.4s, v22.4s
|
|
167
|
+
smlal v30.2d, v19.2s, v23.2s
|
|
168
|
+
smlal2 v31.2d, v19.4s, v23.4s
|
|
169
|
+
uzp1 v16.4s, v24.4s, v25.4s
|
|
170
|
+
mul v16.4s, v16.4s, v1.4s
|
|
171
|
+
smlsl v24.2d, v16.2s, v0.2s
|
|
172
|
+
smlsl2 v25.2d, v16.4s, v0.4s
|
|
173
|
+
uzp2 v16.4s, v24.4s, v25.4s
|
|
174
|
+
uzp1 v17.4s, v26.4s, v27.4s
|
|
175
|
+
mul v17.4s, v17.4s, v1.4s
|
|
176
|
+
smlsl v26.2d, v17.2s, v0.2s
|
|
177
|
+
smlsl2 v27.2d, v17.4s, v0.4s
|
|
178
|
+
uzp2 v17.4s, v26.4s, v27.4s
|
|
179
|
+
uzp1 v18.4s, v28.4s, v29.4s
|
|
180
|
+
mul v18.4s, v18.4s, v1.4s
|
|
181
|
+
smlsl v28.2d, v18.2s, v0.2s
|
|
182
|
+
smlsl2 v29.2d, v18.4s, v0.4s
|
|
183
|
+
uzp2 v18.4s, v28.4s, v29.4s
|
|
184
|
+
uzp1 v19.4s, v30.4s, v31.4s
|
|
185
|
+
mul v19.4s, v19.4s, v1.4s
|
|
186
|
+
smlsl v30.2d, v19.2s, v0.2s
|
|
187
|
+
smlsl2 v31.2d, v19.4s, v0.4s
|
|
188
|
+
uzp2 v19.4s, v30.4s, v31.4s
|
|
189
|
+
str q17, [x0, #0x10]
|
|
190
|
+
str q18, [x0, #0x20]
|
|
191
|
+
str q19, [x0, #0x30]
|
|
192
|
+
str q16, [x0], #0x40
|
|
193
|
+
subs x3, x3, #0x4
|
|
194
|
+
cbnz x3, Lmld_polyvecl_pointwise_acc_montgomery_l7_loop_start
|
|
195
|
+
ret
|
|
196
|
+
.cfi_endproc
|
|
197
|
+
|
|
198
|
+
MLD_ASM_FN_SIZE(polyvecl_pointwise_acc_montgomery_l7_aarch64_asm)
|
|
199
|
+
|
|
200
|
+
#endif /* MLD_ARITH_BACKEND_AARCH64 && !MLD_CONFIG_MULTILEVEL_NO_SHARED && \
|
|
201
|
+
(MLD_CONFIG_MULTILEVEL_WITH_SHARED || MLDSA_L == 7) */
|
|
202
|
+
|
|
203
|
+
#if defined(__ELF__)
|
|
204
|
+
.section .note.GNU-stack,"",%progbits
|
|
205
|
+
#endif
|