Commit 8c9bb54
committed
Shorten MLKEM_NATIVE_ to MLK_, add MLK_ prefix to sys.h macros
This commit is a great renaming of macros from MLKEM_NATIVE_ to MLK_.
In other places where there is risk of clash with other files -- e.g.
sys.h defining ALIGN -- MLK_ is added as a prefix.
The commit is produced by
```
FILES=$(git ls-files -s | grep -v "^120000" | cut -f2)
printf '%s\n' $FILES | xargs -P 8 -I {} \
perl -pi -e 's/SYS_(UNIX_LIKE|LITTLE_ENDIAN|BIG_ENDIAN|X86_64|AARCH64)/MLK_SYS_$1/g' {}
printf '%s\n' $FILES | xargs -P 8 -I {} \
perl -pi -e 's/^ALIGN([^A-Za-z_])/MLK_ALIGN\1/g' {}
printf '%s\n' $FILES | xargs -P 8 -I {} \
perl -pi -e 's/([^A-Za-z_])INLINE([^A-Za-z_])/\1MLK_INLINE\2/g' {}
printf '%s\n' $FILES | xargs -P 8 -I {} \
perl -pi -e 's/([^A-Za-z_])ALWAYS_INLINE([^A-Za-z_])/\1MLK_ALWAYS_INLINE\2/g' {}
printf '%s\n' $FILES | xargs -P 8 -I {} \
perl -pi -e 's/([^A-Za-z_])RESTRICT([^A-Za-z_])/\1MLK_RESTRICT\2/g' {}
printf '%s\n' $FILES | xargs -P 8 -I {} \
perl -pi -e 's/([^A-Za-z_])ALIGN([^A-Za-z_])/\1MLK_ALIGN\2/g' {}
printf '%s\n' $FILES | xargs -P 8 -I {} \
perl -pi -e 's/([^A-Za-z_])FORCE_AARCH64([^A-Za-z_])/\1MLK_FORCE_AARCH64\2/g' {}
printf '%s\n' $FILES | xargs -P 8 -I {} \
perl -pi -e 's/([^A-Za-z_])FORCE_X86_64([^A-Za-z_])/\1MLK_FORCE_X86_64\2/g' {}
printf '%s\n' $FILES | xargs -P 8 -I {} \
perl -pi -e 's/([^A-Za-z_])RESTRICT /\1MLK_RESTRICT /g' {}
printf '%s\n' $FILES | xargs -P 8 -I {} \
perl -pi -e 's/([^A-Za-z_])DEFAULT_ALIGN /\1MLK_DEFAULT_ALIGN /g' {}
printf '%s\n' $FILES | xargs -P 8 -I {} \
perl -pi -e 's/MLKEM_ASM_NAMESPACE/MLK_ASM_NAMESPACE/g' {}
printf '%s\n' $FILES | xargs -P 8 -I {} \
perl -pi -e 's/MLKEM_NAMESPACE/MLK_NAMESPACE/g' {}
printf '%s\n' $FILES | xargs -P 8 -I {} \
perl -pi -e 's/MLKEM_DEFAULT_/MLK_DEFAULT_/g' {}
printf '%s\n' $FILES | xargs -P 8 -I {} \
perl -pi -e 's/MLKEM_USE_/MLK_USE_/g' {}
printf '%s\n' $FILES | xargs -P 8 -I {} \
perl -pi -e 's/PREFIX_UNDERSCORE/MLK_PREFIX_UNDERSCORE/g' {}
printf '%s\n' $FILES | xargs -P 8 -I {} \
perl -pi -e 's/MLKEM_NATIVE_/MLK_/g' {}
printf '%s\n' $FILES | xargs -P 8 -I {} \
perl -pi -e 's/UINT12_LIMIT/MLK_UINT12_LIMIT/g' {}
printf '%s\n' $FILES | xargs -P 8 -I {} \
perl -pi -e 's/BUILD_INFO_/MLK_BUILD_INFO_/g' {}
```
followed by (in nix shell)
```
autogen
format
```
Finally, restore the original default namespace extension as
```
PQCP_MLKEM_NATIVE_XXX
```
which was renamed to `PQCP_MLK_XXX` in the process.
Signed-off-by: Hanno Becker <beckphan@amazon.co.uk>1 parent decd67f commit 8c9bb54
330 files changed
Lines changed: 2866 additions & 2886 deletions
File tree
- .github/workflows
- dev
- aarch64_clean
- src
- aarch64_opt
- src
- fips202/aarch64
- src
- x86_64
- src
- examples
- bring_your_own_fips202
- fips202
- custom_backend
- mlkem_native
- mlkem/fips202/native/custom
- src
- mlkem_native_as_code_package
- monolithic_build_multilevel_native
- monolithic_build_multilevel
- monolithic_build
- multilevel_build_native
- multilevel_build
- integration/liboqs
- mlkem
- fips202
- native
- aarch64
- src
- x86_64
- src
- native
- aarch64
- src
- x86_64
- src
- proofs
- cbmc
- KeccakF1600_StateExtractBytes_BE
- KeccakF1600_StateExtractBytes
- KeccakF1600_StatePermute_native
- KeccakF1600_StatePermute
- KeccakF1600_StateXORBytes_BE
- KeccakF1600_StateXORBytes
- KeccakF1600x4_StateExtractBytes
- KeccakF1600x4_StatePermute_native_x2
- KeccakF1600x4_StatePermute_native_x4
- KeccakF1600x4_StatePermute
- KeccakF1600x4_StateXORBytes
- barrett_reduce
- crypto_kem_dec
- crypto_kem_enc_derand
- crypto_kem_enc
- crypto_kem_keypair_derand
- crypto_kem_keypair
- ct_cmask_neg_i16
- ct_cmask_nonzero_u16
- ct_cmask_nonzero_u8
- ct_cmov_zero
- ct_memcmp
- ct_sel_int16
- ct_sel_uint8
- fqmul
- gen_matrix_native
- gen_matrix
- indcpa_dec
- indcpa_enc
- indcpa_keypair_derand
- invntt_layer
- keccak_absorb_once_x4
- keccak_absorb_once
- keccak_squeeze_once
- keccak_squeezeblocks_x4
- keccak_squeezeblocks
- matvec_mul
- montgomery_reduce
- ntt_butterfly_block
- ntt_layer
- poly_add
- poly_cbd_eta1
- poly_cbd_eta2
- poly_compress_du
- poly_compress_dv
- poly_decompress_du
- poly_decompress_dv
- poly_frombytes_native
- poly_frombytes
- poly_frommsg
- poly_getnoise_eta1122_4x_native
- poly_getnoise_eta1122_4x
- poly_getnoise_eta1_4x
- poly_getnoise_eta2
- poly_invntt_tomont_native
- poly_invntt_tomont
- poly_mulcache_compute_native
- poly_mulcache_compute
- poly_ntt_native
- poly_ntt
- poly_reduce_native
- poly_reduce
- poly_rej_uniform_x4
- poly_rej_uniform
- poly_sub
- poly_tobytes_native
- poly_tobytes
- poly_tomont_native
- poly_tomont
- poly_tomsg
- polyvec_add
- polyvec_basemul_acc_montgomery_cached_native
- polyvec_basemul_acc_montgomery_cached
- polyvec_basemul_acc_montgomery
- polyvec_compress_du
- polyvec_decompress_du
- polyvec_frombytes
- polyvec_invntt_tomont
- polyvec_mulcache_compute
- polyvec_ntt
- polyvec_reduce
- polyvec_tobytes
- polyvec_tomont
- rej_uniform_native
- rej_uniform_scalar
- rej_uniform
- scalar_compress_d10
- scalar_compress_d11
- scalar_compress_d1
- scalar_compress_d4
- scalar_compress_d5
- scalar_decompress_d10
- scalar_decompress_d11
- scalar_decompress_d4
- scalar_decompress_d5
- scalar_signed_to_unsigned_q
- sha3_256
- sha3_512
- shake128_absorb_once
- shake128_squeezeblocks
- shake128x4_absorb_once
- shake128x4_squeezeblocks
- shake256x4
- shake256
- hol_light/arm/mlkem
- scripts
- test
- mk
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
499 | 499 | | |
500 | 500 | | |
501 | 501 | | |
502 | | - | |
| 502 | + | |
503 | 503 | | |
504 | | - | |
| 504 | + | |
505 | 505 | | |
506 | 506 | | |
507 | 507 | | |
508 | | - | |
| 508 | + | |
509 | 509 | | |
510 | 510 | | |
511 | 511 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | | - | |
| 6 | + | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | | - | |
| 13 | + | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
| 80 | + | |
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
91 | | - | |
| 91 | + | |
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
| |||
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
137 | | - | |
| 137 | + | |
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
| |||
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
152 | | - | |
| 152 | + | |
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
| |||
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
170 | | - | |
171 | | - | |
| 170 | + | |
| 171 | + | |
172 | 172 | | |
173 | | - | |
| 173 | + | |
174 | 174 | | |
175 | 175 | | |
176 | | - | |
177 | | - | |
| 176 | + | |
| 177 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | | - | |
| 5 | + | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | | - | |
13 | | - | |
| 11 | + | |
| 12 | + | |
14 | 13 | | |
15 | | - | |
16 | | - | |
17 | | - | |
| 14 | + | |
| 15 | + | |
18 | 16 | | |
19 | | - | |
| 17 | + | |
20 | 18 | | |
21 | | - | |
22 | | - | |
| 19 | + | |
| 20 | + | |
23 | 21 | | |
24 | 22 | | |
25 | 23 | | |
| |||
29 | 27 | | |
30 | 28 | | |
31 | 29 | | |
32 | | - | |
| 30 | + | |
33 | 31 | | |
34 | 32 | | |
35 | | - | |
| 33 | + | |
36 | 34 | | |
37 | 35 | | |
38 | | - | |
| 36 | + | |
39 | 37 | | |
40 | 38 | | |
41 | 39 | | |
42 | | - | |
| 40 | + | |
43 | 41 | | |
44 | 42 | | |
45 | | - | |
| 43 | + | |
46 | 44 | | |
47 | 45 | | |
48 | 46 | | |
49 | | - | |
| 47 | + | |
50 | 48 | | |
51 | 49 | | |
52 | 50 | | |
53 | 51 | | |
54 | | - | |
| 52 | + | |
55 | 53 | | |
56 | 54 | | |
57 | 55 | | |
58 | | - | |
| 56 | + | |
59 | 57 | | |
60 | 58 | | |
61 | 59 | | |
62 | 60 | | |
63 | 61 | | |
64 | 62 | | |
65 | | - | |
| 63 | + | |
66 | 64 | | |
67 | 65 | | |
68 | 66 | | |
69 | 67 | | |
70 | 68 | | |
71 | 69 | | |
72 | | - | |
| 70 | + | |
73 | 71 | | |
74 | 72 | | |
75 | 73 | | |
76 | 74 | | |
77 | 75 | | |
78 | | - | |
| 76 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | | - | |
| 6 | + | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
49 | | - | |
| 48 | + | |
| 49 | + | |
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
| 55 | + | |
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
| 62 | + | |
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | | - | |
| 69 | + | |
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
76 | | - | |
77 | | - | |
| 76 | + | |
| 77 | + | |
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | | - | |
83 | | - | |
| 82 | + | |
| 83 | + | |
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
92 | | - | |
| 92 | + | |
93 | 93 | | |
94 | | - | |
| 94 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | | - | |
| 6 | + | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
0 commit comments