diff --git a/docs/algorithms/kem/classic_mceliece.md b/docs/algorithms/kem/classic_mceliece.md
index a64f07a2c..af7ecee8a 100644
--- a/docs/algorithms/kem/classic_mceliece.md
+++ b/docs/algorithms/kem/classic_mceliece.md
@@ -6,7 +6,7 @@
- **Authors' website**: https://classic.mceliece.org
- **Specification version**: SUPERCOP-20191221.
- **Primary Source**:
- - **Source**: https://github.com/PQClean/PQClean/commit/e2d82cc58dcbc75dcce9ecf70e91465a00c2a4d8
+ - **Source**: https://github.com/PQClean/PQClean/commit/f365dcfe69f15325443ce65df9798e42816f78e9
- **Implementation license (SPDX-Identifier)**: Public domain
, which takes it from:
- SUPERCOP-20191221 "vec" and "avx" implementations
diff --git a/docs/algorithms/kem/classic_mceliece.yml b/docs/algorithms/kem/classic_mceliece.yml
index 6fd9fae99..fe66c1054 100644
--- a/docs/algorithms/kem/classic_mceliece.yml
+++ b/docs/algorithms/kem/classic_mceliece.yml
@@ -369,4 +369,4 @@ parameter-sets:
auxiliary-submitters: []
primary-upstream:
spdx-license-identifier: Public domain
- source: https://github.com/PQClean/PQClean/commit/e2d82cc58dcbc75dcce9ecf70e91465a00c2a4d8
+ source: https://github.com/PQClean/PQClean/commit/f365dcfe69f15325443ce65df9798e42816f78e9
diff --git a/docs/algorithms/kem/hqc.md b/docs/algorithms/kem/hqc.md
index ab6ef3ce6..5d365a59d 100644
--- a/docs/algorithms/kem/hqc.md
+++ b/docs/algorithms/kem/hqc.md
@@ -6,7 +6,7 @@
- **Authors' website**: https://pqc-hqc.org/
- **Specification version**: NIST Round 3 submission.
- **Primary Source**:
- - **Source**: https://github.com/PQClean/PQClean/commit/e2d82cc58dcbc75dcce9ecf70e91465a00c2a4d8
+ - **Source**: https://github.com/PQClean/PQClean/commit/f365dcfe69f15325443ce65df9798e42816f78e9
- **Implementation license (SPDX-Identifier)**: Public domain
, which takes it from:
- https://github.com/jschanck/package-pqclean/tree/29f79e72/hqc, which takes it from:
diff --git a/docs/algorithms/kem/hqc.yml b/docs/algorithms/kem/hqc.yml
index b40c48308..521a2b11f 100644
--- a/docs/algorithms/kem/hqc.yml
+++ b/docs/algorithms/kem/hqc.yml
@@ -122,4 +122,4 @@ parameter-sets:
upstream: primary-upstream
primary-upstream:
spdx-license-identifier: Public domain
- source: https://github.com/PQClean/PQClean/commit/e2d82cc58dcbc75dcce9ecf70e91465a00c2a4d8
+ source: https://github.com/PQClean/PQClean/commit/f365dcfe69f15325443ce65df9798e42816f78e9
diff --git a/docs/algorithms/kem/kyber.md b/docs/algorithms/kem/kyber.md
index 4433e5de3..df02fb759 100644
--- a/docs/algorithms/kem/kyber.md
+++ b/docs/algorithms/kem/kyber.md
@@ -11,7 +11,7 @@
- **Implementation license (SPDX-Identifier)**: CC0-1.0
- **Optimized Implementation sources**: https://github.com/pq-crystals/kyber/commit/faf5c3fe33e0b61c7c8a7888dd862bf5def17ad2 with copy_from_upstream patches
- **pqclean-aarch64**:
- - **Source**: https://github.com/PQClean/PQClean/commit/e2d82cc58dcbc75dcce9ecf70e91465a00c2a4d8 with copy_from_upstream patches
+ - **Source**: https://github.com/PQClean/PQClean/commit/f365dcfe69f15325443ce65df9798e42816f78e9 with copy_from_upstream patches
- **Implementation license (SPDX-Identifier)**: CC0-1.0
diff --git a/docs/algorithms/kem/kyber.yml b/docs/algorithms/kem/kyber.yml
index da9189275..ae6701ec1 100644
--- a/docs/algorithms/kem/kyber.yml
+++ b/docs/algorithms/kem/kyber.yml
@@ -22,7 +22,7 @@ primary-upstream:
spdx-license-identifier: CC0-1.0
optimized-upstreams:
pqclean-aarch64:
- source: https://github.com/PQClean/PQClean/commit/e2d82cc58dcbc75dcce9ecf70e91465a00c2a4d8
+ source: https://github.com/PQClean/PQClean/commit/f365dcfe69f15325443ce65df9798e42816f78e9
with copy_from_upstream patches
spdx-license-identifier: CC0-1.0
parameter-sets:
diff --git a/docs/algorithms/kem/ntru.md b/docs/algorithms/kem/ntru.md
index fe72dba9b..4d15a45c4 100644
--- a/docs/algorithms/kem/ntru.md
+++ b/docs/algorithms/kem/ntru.md
@@ -7,7 +7,7 @@
- **Authors' website**: https://ntru.org/
- **Specification version**: NIST Round 3 submission.
- **Primary Source**:
- - **Source**: https://github.com/PQClean/PQClean/commit/e2d82cc58dcbc75dcce9ecf70e91465a00c2a4d8
+ - **Source**: https://github.com/PQClean/PQClean/commit/f365dcfe69f15325443ce65df9798e42816f78e9
- **Implementation license (SPDX-Identifier)**: CC0-1.0
, which takes it from:
- https://github.com/jschanck/ntru/tree/a43a4457
diff --git a/docs/algorithms/kem/ntru.yml b/docs/algorithms/kem/ntru.yml
index ffd3c94e3..cab84a55e 100644
--- a/docs/algorithms/kem/ntru.yml
+++ b/docs/algorithms/kem/ntru.yml
@@ -185,4 +185,4 @@ parameter-sets:
upstream: primary-upstream
primary-upstream:
spdx-license-identifier: CC0-1.0
- source: https://github.com/PQClean/PQClean/commit/e2d82cc58dcbc75dcce9ecf70e91465a00c2a4d8
+ source: https://github.com/PQClean/PQClean/commit/f365dcfe69f15325443ce65df9798e42816f78e9
diff --git a/docs/algorithms/kem/ntruprime.md b/docs/algorithms/kem/ntruprime.md
index 97b2d533b..2e0f1f1c3 100644
--- a/docs/algorithms/kem/ntruprime.md
+++ b/docs/algorithms/kem/ntruprime.md
@@ -6,7 +6,7 @@
- **Authors' website**: https://ntruprime.cr.yp.to
- **Specification version**: supercop-20200826.
- **Primary Source**:
- - **Source**: https://github.com/PQClean/PQClean/commit/e2d82cc58dcbc75dcce9ecf70e91465a00c2a4d8
+ - **Source**: https://github.com/PQClean/PQClean/commit/f365dcfe69f15325443ce65df9798e42816f78e9
- **Implementation license (SPDX-Identifier)**: Public domain
, which takes it from:
- https://github.com/jschanck/package-pqclean/tree/4d9f08c3/ntruprime, which takes it from:
diff --git a/docs/algorithms/kem/ntruprime.yml b/docs/algorithms/kem/ntruprime.yml
index 956c1a52f..9bd911406 100644
--- a/docs/algorithms/kem/ntruprime.yml
+++ b/docs/algorithms/kem/ntruprime.yml
@@ -285,4 +285,4 @@ parameter-sets:
upstream: primary-upstream
primary-upstream:
spdx-license-identifier: Public domain
- source: https://github.com/PQClean/PQClean/commit/e2d82cc58dcbc75dcce9ecf70e91465a00c2a4d8
+ source: https://github.com/PQClean/PQClean/commit/f365dcfe69f15325443ce65df9798e42816f78e9
diff --git a/docs/algorithms/kem/saber.md b/docs/algorithms/kem/saber.md
index 15a4ea8b1..b69ed54ce 100644
--- a/docs/algorithms/kem/saber.md
+++ b/docs/algorithms/kem/saber.md
@@ -6,7 +6,7 @@
- **Authors' website**: https://www.esat.kuleuven.be/cosic/pqcrypto/saber/
- **Specification version**: NIST Round 3 submission.
- **Primary Source**:
- - **Source**: https://github.com/PQClean/PQClean/commit/e2d82cc58dcbc75dcce9ecf70e91465a00c2a4d8
+ - **Source**: https://github.com/PQClean/PQClean/commit/f365dcfe69f15325443ce65df9798e42816f78e9
- **Implementation license (SPDX-Identifier)**: Public domain
, which takes it from:
- https://github.com/jschanck/package-pqclean/tree/1ae84c3c/saber, which takes it from:
diff --git a/docs/algorithms/kem/saber.yml b/docs/algorithms/kem/saber.yml
index 7a2d2e7a9..d2b6b4979 100644
--- a/docs/algorithms/kem/saber.yml
+++ b/docs/algorithms/kem/saber.yml
@@ -108,4 +108,4 @@ parameter-sets:
upstream: primary-upstream
primary-upstream:
spdx-license-identifier: Public domain
- source: https://github.com/PQClean/PQClean/commit/e2d82cc58dcbc75dcce9ecf70e91465a00c2a4d8
+ source: https://github.com/PQClean/PQClean/commit/f365dcfe69f15325443ce65df9798e42816f78e9
diff --git a/docs/algorithms/sig/falcon.md b/docs/algorithms/sig/falcon.md
index 8dcd3f81b..9e13a2fab 100644
--- a/docs/algorithms/sig/falcon.md
+++ b/docs/algorithms/sig/falcon.md
@@ -6,7 +6,7 @@
- **Auxiliary submitters**: Pierre-Alain Fouque, Jeffrey Hoffstein, Paul Kirchner, Vadim Lyubashevsky, Thomas Pornin, Thomas Ricosset, Gregor Seiler, William Whyte, Zhenfei Zhang.
- **Authors' website**: https://falcon-sign.info
- **Specification version**: v1.2.
-- **Implementation source**: https://github.com/PQClean/PQClean/commit/e2d82cc58dcbc75dcce9ecf70e91465a00c2a4d8, which takes it from:
+- **Implementation source**: https://github.com/PQClean/PQClean/commit/f365dcfe69f15325443ce65df9798e42816f78e9, which takes it from:
- https://github.com/jschanck/package-pqclean/tree/cea1fa5a/falcon, which takes it from:
- supercop-20201018
- **Implementation license (SPDX-Identifier)**: CC0-1.0.
diff --git a/docs/algorithms/sig/falcon.yml b/docs/algorithms/sig/falcon.yml
index efeb9480b..9ba991790 100644
--- a/docs/algorithms/sig/falcon.yml
+++ b/docs/algorithms/sig/falcon.yml
@@ -17,7 +17,7 @@ website: https://falcon-sign.info
nist-round: 3
spec-version: v1.2
spdx-license-identifier: CC0-1.0
-upstream: https://github.com/PQClean/PQClean/commit/e2d82cc58dcbc75dcce9ecf70e91465a00c2a4d8
+upstream: https://github.com/PQClean/PQClean/commit/f365dcfe69f15325443ce65df9798e42816f78e9
upstream-ancestors:
- https://github.com/jschanck/package-pqclean/tree/cea1fa5a/falcon
- supercop-20201018
diff --git a/docs/algorithms/sig/rainbow.md b/docs/algorithms/sig/rainbow.md
index f48422c8b..c59e917af 100644
--- a/docs/algorithms/sig/rainbow.md
+++ b/docs/algorithms/sig/rainbow.md
@@ -6,7 +6,7 @@
- **Auxiliary submitters**: Ming-Shing Chen, Matthias Kannwischer, Jacques Patarin, Albrecht Petzoldt, Dieter Schmidt, Bo-Yin Yang.
- **Authors' website**: https://www.pqcrainbow.org/
- **Specification version**: NIST Round 3 submission.
-- **Implementation source**: https://github.com/PQClean/PQClean/commit/e2d82cc58dcbc75dcce9ecf70e91465a00c2a4d8, which takes it from:
+- **Implementation source**: https://github.com/PQClean/PQClean/commit/f365dcfe69f15325443ce65df9798e42816f78e9, which takes it from:
- https://github.com/fast-crypto-lab/rainbow-submission-round2/commit/173ada0e077e1b9dbd8e4a78994f87acc0c92263
- **Implementation license (SPDX-Identifier)**: CC0-1.0.
diff --git a/docs/algorithms/sig/rainbow.yml b/docs/algorithms/sig/rainbow.yml
index 873563fd8..e009679e2 100644
--- a/docs/algorithms/sig/rainbow.yml
+++ b/docs/algorithms/sig/rainbow.yml
@@ -14,7 +14,7 @@ website: https://www.pqcrainbow.org/
nist-round: 3
spec-version: NIST Round 3 submission
spdx-license-identifier: CC0-1.0
-upstream: https://github.com/PQClean/PQClean/commit/e2d82cc58dcbc75dcce9ecf70e91465a00c2a4d8
+upstream: https://github.com/PQClean/PQClean/commit/f365dcfe69f15325443ce65df9798e42816f78e9
upstream-ancestors:
- https://github.com/fast-crypto-lab/rainbow-submission-round2/commit/173ada0e077e1b9dbd8e4a78994f87acc0c92263
parameter-sets:
diff --git a/docs/algorithms/sig/sphincs.md b/docs/algorithms/sig/sphincs.md
index d0ae91591..c3caafcc5 100644
--- a/docs/algorithms/sig/sphincs.md
+++ b/docs/algorithms/sig/sphincs.md
@@ -6,7 +6,7 @@
- **Auxiliary submitters**: Jean-Philippe Aumasson, Daniel J. Bernstein,, Christoph Dobraunig, Maria Eichlseder, Scott Fluhrer, Stefan-Lukas Gazdag, Panos Kampanakis, Stefan Kölbl, Tanja Lange, Martin M. Lauridsen, Florian Mendel, Ruben Niederhagen, Christian Rechberger, Joost Rijneveld, Peter Schwabe.
- **Authors' website**: https://sphincs.org/
- **Specification version**: NIST Round 3 submission.
-- **Implementation source**: https://github.com/PQClean/PQClean/commit/e2d82cc58dcbc75dcce9ecf70e91465a00c2a4d8 with copy_from_upstream patches, which takes it from:
+- **Implementation source**: https://github.com/PQClean/PQClean/commit/f365dcfe69f15325443ce65df9798e42816f78e9 with copy_from_upstream patches, which takes it from:
- https://github.com/sphincs/sphincsplus
- **Implementation license (SPDX-Identifier)**: CC0-1.0.
diff --git a/docs/algorithms/sig/sphincs.yml b/docs/algorithms/sig/sphincs.yml
index 472454d65..fe7f1620c 100644
--- a/docs/algorithms/sig/sphincs.yml
+++ b/docs/algorithms/sig/sphincs.yml
@@ -23,7 +23,7 @@ website: https://sphincs.org/
nist-round: 3
spec-version: NIST Round 3 submission
spdx-license-identifier: CC0-1.0
-upstream: https://github.com/PQClean/PQClean/commit/e2d82cc58dcbc75dcce9ecf70e91465a00c2a4d8
+upstream: https://github.com/PQClean/PQClean/commit/f365dcfe69f15325443ce65df9798e42816f78e9
with copy_from_upstream patches
upstream-ancestors:
- https://github.com/sphincs/sphincsplus
diff --git a/scripts/copy_from_upstream/copy_from_upstream.py b/scripts/copy_from_upstream/copy_from_upstream.py
index e968683b1..a8cbeb9cd 100755
--- a/scripts/copy_from_upstream/copy_from_upstream.py
+++ b/scripts/copy_from_upstream/copy_from_upstream.py
@@ -523,6 +523,8 @@ def process_families(instructions, basedir, with_kat, with_generator):
req = impl['supported_platforms'][i]
# if compiling for ARM64_V8 the asimd is implied and will cause errors
# when provided to the compiler, so we need to remove it
+ if req['architecture'] == 'arm_8':
+ req['architecture'] = 'ARM64_V8'
if req['architecture'] == 'ARM64_V8' and 'asimd' in req['required_flags']:
req['required_flags'].remove('asimd')
impl['required_flags'] = req['required_flags']
diff --git a/scripts/copy_from_upstream/copy_from_upstream.yml b/scripts/copy_from_upstream/copy_from_upstream.yml
index 3c1cf0558..c55502da9 100644
--- a/scripts/copy_from_upstream/copy_from_upstream.yml
+++ b/scripts/copy_from_upstream/copy_from_upstream.yml
@@ -3,13 +3,13 @@ upstreams:
name: pqclean
git_url: https://github.com/PQClean/PQClean.git
git_branch: master
- git_commit: e2d82cc58dcbc75dcce9ecf70e91465a00c2a4d8
+ git_commit: f365dcfe69f15325443ce65df9798e42816f78e9
kem_meta_path: 'crypto_kem/{pqclean_scheme}/META.yml'
sig_meta_path: 'crypto_sign/{pqclean_scheme}/META.yml'
kem_scheme_path: 'crypto_kem/{pqclean_scheme}'
sig_scheme_path: 'crypto_sign/{pqclean_scheme}'
ignore: ['pqclean_lightsaber_aarch64', 'pqclean_saber_aarch64', 'pqclean_firesaber_aarch64']
- patches: ['pqclean-sphincs.patch', 'pqclean-kyber-armneon-yml.patch', 'pqclean-kyber-armneon-shake.patch']
+ patches: ['pqclean-sphincs.patch', 'pqclean-kyber-armneon-shake.patch']
-
name: pqcrystals-kyber
git_url: https://github.com/pq-crystals/kyber.git
diff --git a/scripts/copy_from_upstream/patches/pqclean-kyber-armneon-yml.patch b/scripts/copy_from_upstream/patches/pqclean-kyber-armneon-yml.patch
deleted file mode 100644
index a15a0b1a2..000000000
--- a/scripts/copy_from_upstream/patches/pqclean-kyber-armneon-yml.patch
+++ /dev/null
@@ -1,54 +0,0 @@
-From acfeeed3a79552a1a7b42f9d44132833bcc08afa Mon Sep 17 00:00:00 2001
-From: Jason Goertzen
-Date: Tue, 9 Nov 2021 16:51:51 -0500
-Subject: [PATCH] Patching pqclean's META.yml files to match our arm
- architecture naming convention
-
----
- crypto_kem/kyber1024/META.yml | 2 +-
- crypto_kem/kyber512/META.yml | 2 +-
- crypto_kem/kyber768/META.yml | 2 +-
- 3 files changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/crypto_kem/kyber1024/META.yml b/crypto_kem/kyber1024/META.yml
-index 28e2014..56a4b5f 100644
---- a/crypto_kem/kyber1024/META.yml
-+++ b/crypto_kem/kyber1024/META.yml
-@@ -37,7 +37,7 @@ implementations:
- - name: aarch64
- version: https://github.com/neon-ntt/neon-ntt/tree/b011eeff3515fb168aa4dbaa671d760009d98dbb
- supported_platforms:
-- - architecture: arm_8
-+ - architecture: ARM64_V8
- operating_systems:
- - Linux
- - Darwin
-diff --git a/crypto_kem/kyber512/META.yml b/crypto_kem/kyber512/META.yml
-index 3c4d1ee..33fe01d 100644
---- a/crypto_kem/kyber512/META.yml
-+++ b/crypto_kem/kyber512/META.yml
-@@ -37,7 +37,7 @@ implementations:
- - name: aarch64
- version: https://github.com/neon-ntt/neon-ntt/tree/b011eeff3515fb168aa4dbaa671d760009d98dbb
- supported_platforms:
-- - architecture: arm_8
-+ - architecture: ARM64_V8
- operating_systems:
- - Linux
- - Darwin
-diff --git a/crypto_kem/kyber768/META.yml b/crypto_kem/kyber768/META.yml
-index 035cce6..98a0504 100644
---- a/crypto_kem/kyber768/META.yml
-+++ b/crypto_kem/kyber768/META.yml
-@@ -37,7 +37,7 @@ implementations:
- - name: aarch64
- version: https://github.com/neon-ntt/neon-ntt/tree/b011eeff3515fb168aa4dbaa671d760009d98dbb
- supported_platforms:
-- - architecture: arm_8
-+ - architecture: ARM64_V8
- operating_systems:
- - Linux
- - Darwin
---
-2.30.1 (Apple Git-130)
-
diff --git a/scripts/copy_from_upstream/update_upstream_alg_docs.py b/scripts/copy_from_upstream/update_upstream_alg_docs.py
index 9038b79c2..e289a3ba2 100755
--- a/scripts/copy_from_upstream/update_upstream_alg_docs.py
+++ b/scripts/copy_from_upstream/update_upstream_alg_docs.py
@@ -185,15 +185,6 @@ def update_upstream_kem_alg_docs(liboqs_root, kems, upstream_info, write_changes
# Logic to add Common_META.yml components
implementations = upstream_yaml['implementations']
- """
- if 'arch_specific_upstream_locations' in kem and impl['upstream'] != 'primary-upstream':
- upstream_name = impl['upstream']
- meta_yaml_path_template = ouis[upstream_name]['kem_meta_path']
- opt_upstream_root = ouis[upstream_name]['upstream_root']
- upstream_meta_path = os.path.join(opt_upstream_root, meta_yaml_path_template.format_map(scheme))
- optimized_meta = load_yaml(upstream_meta_path)
- implementations = optimized_meta['implementations']
- """
uir = get_upstream_info(implementations, impl['upstream-id'])
if (uir != None) and ('common_dep' in uir):
upstream_common_path = upstream_meta_path.replace(scheme['pretty_name_full'], "Common")
@@ -201,17 +192,19 @@ def update_upstream_kem_alg_docs(liboqs_root, kems, upstream_info, write_changes
for c in uir['common_dep'].split(' '):
ur = get_upstream_info(upstream_common_yaml['commons'], c)
if (ur != None) and ('supported_platforms' in ur):
- if 'required_flags' in ur['supported_platforms'][0].keys():
- upstream_impl['supported_platforms'][0]['required_flags']=list(set(upstream_impl['supported_platforms'][0]['required_flags']+ur['supported_platforms'][0]['required_flags']))
- upstream_impl['supported_platforms'][0]['required_flags'].sort()
+ if 'required_flags' in ur['supported_platforms'][0] and not ur['supported_platforms'][0]['required_flags']:
+ del ur['supported_platforms'][0]['required_flags']
+ if 'required_flags' in ur['supported_platforms'][0].keys():
+ upstream_impl['supported_platforms'][0]['required_flags']=list(set(upstream_impl['supported_platforms'][0]['required_flags']+ur['supported_platforms'][0]['required_flags']))
+ upstream_impl['supported_platforms'][0]['required_flags'].sort()
if 'supported_platforms' in upstream_impl:
for i in range(len(upstream_impl['supported_platforms'])):
if upstream_impl['supported_platforms'][i]['architecture'] == 'arm_8':
upstream_impl['supported_platforms'][i]['architecture'] = 'ARM64_V8'
if 'asimd' in upstream_impl['supported_platforms'][i]['required_flags']:
upstream_impl['supported_platforms'][i]['required_flags'].remove('asimd')
- if not upstream_impl['supported_platforms'][i]['required_flags']:
- del upstream_impl['supported_platforms'][i]['required_flags']
+ if not upstream_impl['supported_platforms'][i]['required_flags']:
+ del upstream_impl['supported_platforms'][i]['required_flags']
impl['supported-platforms'] = rhs_if_not_equal(impl['supported-platforms'], upstream_impl['supported_platforms'], "supported-platforms")
else:
@@ -290,9 +283,9 @@ def update_upstream_sig_alg_docs(liboqs_root, sigs, upstream_info, write_changes
for c in uir['common_dep'].split(' '):
ur = get_upstream_info(upstream_common_yaml['commons'], c)
if (ur != None) and ('supported_platforms' in ur):
- if 'required_flags' in ur['supported_platforms'][0].keys():
- upstream_impl['supported_platforms'][0]['required_flags']=list(set(upstream_impl['supported_platforms'][0]['required_flags']+ur['supported_platforms'][0]['required_flags']))
- upstream_impl['supported_platforms'][0]['required_flags'].sort()
+ if 'required_flags' in ur['supported_platforms'][0].keys():
+ upstream_impl['supported_platforms'][0]['required_flags']=list(set(upstream_impl['supported_platforms'][0]['required_flags']+ur['supported_platforms'][0]['required_flags']))
+ upstream_impl['supported_platforms'][0]['required_flags'].sort()
if 'supported_platforms' in upstream_impl:
impl['supported-platforms'] = rhs_if_not_equal(impl['supported-platforms'], upstream_impl['supported_platforms'], "supported-platforms")
diff --git a/src/kem/kyber/pqclean_kyber1024_aarch64/kem.c b/src/kem/kyber/pqclean_kyber1024_aarch64/kem.c
index d0544bdb8..d8d8a0e7f 100644
--- a/src/kem/kyber/pqclean_kyber1024_aarch64/kem.c
+++ b/src/kem/kyber/pqclean_kyber1024_aarch64/kem.c
@@ -21,8 +21,8 @@
*
* Returns 0 (success)
**************************************************/
-int PQCLEAN_KYBER1024_AARCH64_crypto_kem_keypair(uint8_t pk[KYBER_PUBLICKEYBYTES],
- uint8_t sk[KYBER_SECRETKEYBYTES]) {
+int PQCLEAN_KYBER1024_AARCH64_crypto_kem_keypair(uint8_t *pk,
+ uint8_t *sk) {
size_t i;
indcpa_keypair(pk, sk);
for (i = 0; i < KYBER_INDCPA_PUBLICKEYBYTES; i++) {
@@ -49,9 +49,9 @@ int PQCLEAN_KYBER1024_AARCH64_crypto_kem_keypair(uint8_t pk[KYBER_PUBLICKEYBYTES
*
* Returns 0 (success)
**************************************************/
-int PQCLEAN_KYBER1024_AARCH64_crypto_kem_enc(uint8_t ct[KYBER_CIPHERTEXTBYTES],
- uint8_t ss[KYBER_SSBYTES],
- const uint8_t pk[KYBER_PUBLICKEYBYTES]) {
+int PQCLEAN_KYBER1024_AARCH64_crypto_kem_enc(uint8_t *ct,
+ uint8_t *ss,
+ const uint8_t *pk) {
uint8_t buf[2 * KYBER_SYMBYTES];
/* Will contain key, coins */
uint8_t kr[2 * KYBER_SYMBYTES];
@@ -91,9 +91,9 @@ int PQCLEAN_KYBER1024_AARCH64_crypto_kem_enc(uint8_t ct[KYBER_CIPHERTEXTBYTES],
*
* On failure, ss will contain a pseudo-random value.
**************************************************/
-int PQCLEAN_KYBER1024_AARCH64_crypto_kem_dec(uint8_t ss[KYBER_SSBYTES],
- const uint8_t ct[KYBER_CIPHERTEXTBYTES],
- const uint8_t sk[KYBER_SECRETKEYBYTES]) {
+int PQCLEAN_KYBER1024_AARCH64_crypto_kem_dec(uint8_t *ss,
+ const uint8_t *ct,
+ const uint8_t *sk) {
size_t i;
int fail;
uint8_t buf[2 * KYBER_SYMBYTES];
diff --git a/src/kem/kyber/pqclean_kyber1024_aarch64/poly.c b/src/kem/kyber/pqclean_kyber1024_aarch64/poly.c
index 7ed30a204..7e55351c2 100644
--- a/src/kem/kyber/pqclean_kyber1024_aarch64/poly.c
+++ b/src/kem/kyber/pqclean_kyber1024_aarch64/poly.c
@@ -15,7 +15,7 @@
* (of length KYBER_POLYCOMPRESSEDBYTES)
* - const poly *a: pointer to input polynomial
**************************************************/
-void poly_compress(uint8_t r[KYBER_POLYCOMPRESSEDBYTES], const int16_t *a) {
+void poly_compress(uint8_t r[KYBER_POLYCOMPRESSEDBYTES], const int16_t a[KYBER_N]) {
unsigned int i, j;
int16_t u;
uint8_t t[8];
@@ -47,7 +47,7 @@ void poly_compress(uint8_t r[KYBER_POLYCOMPRESSEDBYTES], const int16_t *a) {
* - const uint8_t *a: pointer to input byte array
* (of length KYBER_POLYCOMPRESSEDBYTES bytes)
**************************************************/
-void poly_decompress(int16_t *r, const uint8_t a[KYBER_POLYCOMPRESSEDBYTES]) {
+void poly_decompress(int16_t r[KYBER_N], const uint8_t a[KYBER_POLYCOMPRESSEDBYTES]) {
unsigned int i;
unsigned int j;
@@ -78,7 +78,7 @@ void poly_decompress(int16_t *r, const uint8_t a[KYBER_POLYCOMPRESSEDBYTES]) {
* (needs space for KYBER_POLYBYTES bytes)
* - const poly *a: pointer to input polynomial
**************************************************/
-void poly_tobytes(uint8_t r[KYBER_POLYBYTES], const int16_t *a) {
+void poly_tobytes(uint8_t r[KYBER_POLYBYTES], const int16_t a[KYBER_N]) {
unsigned int i;
uint16_t t0, t1;
@@ -104,7 +104,7 @@ void poly_tobytes(uint8_t r[KYBER_POLYBYTES], const int16_t *a) {
* - const uint8_t *a: pointer to input byte array
* (of KYBER_POLYBYTES bytes)
**************************************************/
-void poly_frombytes(int16_t *r, const uint8_t a[KYBER_POLYBYTES]) {
+void poly_frombytes(int16_t r[KYBER_N], const uint8_t a[KYBER_POLYBYTES]) {
uint8x16x3_t neon_buf;
uint16x8x4_t tmp;
int16x8x4_t value;
@@ -148,7 +148,7 @@ void poly_frombytes(int16_t *r, const uint8_t a[KYBER_POLYBYTES]) {
* Arguments: - poly *r: pointer to output polynomial
* - const uint8_t *msg: pointer to input message
**************************************************/
-void poly_frommsg(int16_t *r, const uint8_t msg[KYBER_INDCPA_MSGBYTES]) {
+void poly_frommsg(int16_t r[KYBER_N], const uint8_t msg[KYBER_INDCPA_MSGBYTES]) {
unsigned int i, j;
int16_t mask;
@@ -169,7 +169,7 @@ void poly_frommsg(int16_t *r, const uint8_t msg[KYBER_INDCPA_MSGBYTES]) {
* Arguments: - uint8_t *msg: pointer to output message
* - const poly *a: pointer to input polynomial
**************************************************/
-void poly_tomsg(uint8_t msg[KYBER_INDCPA_MSGBYTES], const int16_t *a) {
+void poly_tomsg(uint8_t msg[KYBER_INDCPA_MSGBYTES], const int16_t a[KYBER_N]) {
unsigned int i, j;
uint16_t t;
diff --git a/src/kem/kyber/pqclean_kyber512_aarch64/kem.c b/src/kem/kyber/pqclean_kyber512_aarch64/kem.c
index b7b7c42be..bcd93a8b2 100644
--- a/src/kem/kyber/pqclean_kyber512_aarch64/kem.c
+++ b/src/kem/kyber/pqclean_kyber512_aarch64/kem.c
@@ -21,8 +21,8 @@
*
* Returns 0 (success)
**************************************************/
-int PQCLEAN_KYBER512_AARCH64_crypto_kem_keypair(uint8_t pk[KYBER_PUBLICKEYBYTES],
- uint8_t sk[KYBER_SECRETKEYBYTES]) {
+int PQCLEAN_KYBER512_AARCH64_crypto_kem_keypair(uint8_t *pk,
+ uint8_t *sk) {
size_t i;
indcpa_keypair(pk, sk);
for (i = 0; i < KYBER_INDCPA_PUBLICKEYBYTES; i++) {
@@ -49,9 +49,9 @@ int PQCLEAN_KYBER512_AARCH64_crypto_kem_keypair(uint8_t pk[KYBER_PUBLICKEYBYTES]
*
* Returns 0 (success)
**************************************************/
-int PQCLEAN_KYBER512_AARCH64_crypto_kem_enc(uint8_t ct[KYBER_CIPHERTEXTBYTES],
- uint8_t ss[KYBER_SSBYTES],
- const uint8_t pk[KYBER_PUBLICKEYBYTES]) {
+int PQCLEAN_KYBER512_AARCH64_crypto_kem_enc(uint8_t *ct,
+ uint8_t *ss,
+ const uint8_t *pk) {
uint8_t buf[2 * KYBER_SYMBYTES];
/* Will contain key, coins */
uint8_t kr[2 * KYBER_SYMBYTES];
@@ -91,9 +91,9 @@ int PQCLEAN_KYBER512_AARCH64_crypto_kem_enc(uint8_t ct[KYBER_CIPHERTEXTBYTES],
*
* On failure, ss will contain a pseudo-random value.
**************************************************/
-int PQCLEAN_KYBER512_AARCH64_crypto_kem_dec(uint8_t ss[KYBER_SSBYTES],
- const uint8_t ct[KYBER_CIPHERTEXTBYTES],
- const uint8_t sk[KYBER_SECRETKEYBYTES]) {
+int PQCLEAN_KYBER512_AARCH64_crypto_kem_dec(uint8_t *ss,
+ const uint8_t *ct,
+ const uint8_t *sk) {
size_t i;
int fail;
uint8_t buf[2 * KYBER_SYMBYTES];
diff --git a/src/kem/kyber/pqclean_kyber512_aarch64/poly.c b/src/kem/kyber/pqclean_kyber512_aarch64/poly.c
index 09bc264f4..6d1ecdd35 100644
--- a/src/kem/kyber/pqclean_kyber512_aarch64/poly.c
+++ b/src/kem/kyber/pqclean_kyber512_aarch64/poly.c
@@ -15,7 +15,7 @@
* (of length KYBER_POLYCOMPRESSEDBYTES)
* - const poly *a: pointer to input polynomial
**************************************************/
-void poly_compress(uint8_t r[KYBER_POLYCOMPRESSEDBYTES], const int16_t *a) {
+void poly_compress(uint8_t r[KYBER_POLYCOMPRESSEDBYTES], const int16_t a[KYBER_N]) {
unsigned int i, j;
int16_t u;
uint8_t t[8];
@@ -46,7 +46,7 @@ void poly_compress(uint8_t r[KYBER_POLYCOMPRESSEDBYTES], const int16_t *a) {
* - const uint8_t *a: pointer to input byte array
* (of length KYBER_POLYCOMPRESSEDBYTES bytes)
**************************************************/
-void poly_decompress(int16_t *r, const uint8_t a[KYBER_POLYCOMPRESSEDBYTES]) {
+void poly_decompress(int16_t r[KYBER_N], const uint8_t a[KYBER_POLYCOMPRESSEDBYTES]) {
unsigned int i;
for (i = 0; i < KYBER_N / 2; i++) {
@@ -65,7 +65,7 @@ void poly_decompress(int16_t *r, const uint8_t a[KYBER_POLYCOMPRESSEDBYTES]) {
* (needs space for KYBER_POLYBYTES bytes)
* - const poly *a: pointer to input polynomial
**************************************************/
-void poly_tobytes(uint8_t r[KYBER_POLYBYTES], const int16_t *a) {
+void poly_tobytes(uint8_t r[KYBER_POLYBYTES], const int16_t a[KYBER_N]) {
unsigned int i;
uint16_t t0, t1;
@@ -91,7 +91,7 @@ void poly_tobytes(uint8_t r[KYBER_POLYBYTES], const int16_t *a) {
* - const uint8_t *a: pointer to input byte array
* (of KYBER_POLYBYTES bytes)
**************************************************/
-void poly_frombytes(int16_t *r, const uint8_t a[KYBER_POLYBYTES]) {
+void poly_frombytes(int16_t r[KYBER_N], const uint8_t a[KYBER_POLYBYTES]) {
uint8x16x3_t neon_buf;
uint16x8x4_t tmp;
int16x8x4_t value;
@@ -135,7 +135,7 @@ void poly_frombytes(int16_t *r, const uint8_t a[KYBER_POLYBYTES]) {
* Arguments: - poly *r: pointer to output polynomial
* - const uint8_t *msg: pointer to input message
**************************************************/
-void poly_frommsg(int16_t *r, const uint8_t msg[KYBER_INDCPA_MSGBYTES]) {
+void poly_frommsg(int16_t r[KYBER_N], const uint8_t msg[KYBER_INDCPA_MSGBYTES]) {
unsigned int i, j;
int16_t mask;
@@ -156,7 +156,7 @@ void poly_frommsg(int16_t *r, const uint8_t msg[KYBER_INDCPA_MSGBYTES]) {
* Arguments: - uint8_t *msg: pointer to output message
* - const poly *a: pointer to input polynomial
**************************************************/
-void poly_tomsg(uint8_t msg[KYBER_INDCPA_MSGBYTES], const int16_t *a) {
+void poly_tomsg(uint8_t msg[KYBER_INDCPA_MSGBYTES], const int16_t a[KYBER_N]) {
unsigned int i, j;
uint16_t t;
diff --git a/src/kem/kyber/pqclean_kyber768_aarch64/kem.c b/src/kem/kyber/pqclean_kyber768_aarch64/kem.c
index 86d3acf5d..2880e6d72 100644
--- a/src/kem/kyber/pqclean_kyber768_aarch64/kem.c
+++ b/src/kem/kyber/pqclean_kyber768_aarch64/kem.c
@@ -21,8 +21,8 @@
*
* Returns 0 (success)
**************************************************/
-int PQCLEAN_KYBER768_AARCH64_crypto_kem_keypair(uint8_t pk[KYBER_PUBLICKEYBYTES],
- uint8_t sk[KYBER_SECRETKEYBYTES]) {
+int PQCLEAN_KYBER768_AARCH64_crypto_kem_keypair(uint8_t *pk,
+ uint8_t *sk) {
size_t i;
indcpa_keypair(pk, sk);
for (i = 0; i < KYBER_INDCPA_PUBLICKEYBYTES; i++) {
@@ -49,9 +49,9 @@ int PQCLEAN_KYBER768_AARCH64_crypto_kem_keypair(uint8_t pk[KYBER_PUBLICKEYBYTES]
*
* Returns 0 (success)
**************************************************/
-int PQCLEAN_KYBER768_AARCH64_crypto_kem_enc(uint8_t ct[KYBER_CIPHERTEXTBYTES],
- uint8_t ss[KYBER_SSBYTES],
- const uint8_t pk[KYBER_PUBLICKEYBYTES]) {
+int PQCLEAN_KYBER768_AARCH64_crypto_kem_enc(uint8_t *ct,
+ uint8_t *ss,
+ const uint8_t *pk) {
uint8_t buf[2 * KYBER_SYMBYTES];
/* Will contain key, coins */
uint8_t kr[2 * KYBER_SYMBYTES];
@@ -91,9 +91,9 @@ int PQCLEAN_KYBER768_AARCH64_crypto_kem_enc(uint8_t ct[KYBER_CIPHERTEXTBYTES],
*
* On failure, ss will contain a pseudo-random value.
**************************************************/
-int PQCLEAN_KYBER768_AARCH64_crypto_kem_dec(uint8_t ss[KYBER_SSBYTES],
- const uint8_t ct[KYBER_CIPHERTEXTBYTES],
- const uint8_t sk[KYBER_SECRETKEYBYTES]) {
+int PQCLEAN_KYBER768_AARCH64_crypto_kem_dec(uint8_t *ss,
+ const uint8_t *ct,
+ const uint8_t *sk) {
size_t i;
int fail;
uint8_t buf[2 * KYBER_SYMBYTES];
diff --git a/src/kem/kyber/pqclean_kyber768_aarch64/poly.c b/src/kem/kyber/pqclean_kyber768_aarch64/poly.c
index 09bc264f4..6d1ecdd35 100644
--- a/src/kem/kyber/pqclean_kyber768_aarch64/poly.c
+++ b/src/kem/kyber/pqclean_kyber768_aarch64/poly.c
@@ -15,7 +15,7 @@
* (of length KYBER_POLYCOMPRESSEDBYTES)
* - const poly *a: pointer to input polynomial
**************************************************/
-void poly_compress(uint8_t r[KYBER_POLYCOMPRESSEDBYTES], const int16_t *a) {
+void poly_compress(uint8_t r[KYBER_POLYCOMPRESSEDBYTES], const int16_t a[KYBER_N]) {
unsigned int i, j;
int16_t u;
uint8_t t[8];
@@ -46,7 +46,7 @@ void poly_compress(uint8_t r[KYBER_POLYCOMPRESSEDBYTES], const int16_t *a) {
* - const uint8_t *a: pointer to input byte array
* (of length KYBER_POLYCOMPRESSEDBYTES bytes)
**************************************************/
-void poly_decompress(int16_t *r, const uint8_t a[KYBER_POLYCOMPRESSEDBYTES]) {
+void poly_decompress(int16_t r[KYBER_N], const uint8_t a[KYBER_POLYCOMPRESSEDBYTES]) {
unsigned int i;
for (i = 0; i < KYBER_N / 2; i++) {
@@ -65,7 +65,7 @@ void poly_decompress(int16_t *r, const uint8_t a[KYBER_POLYCOMPRESSEDBYTES]) {
* (needs space for KYBER_POLYBYTES bytes)
* - const poly *a: pointer to input polynomial
**************************************************/
-void poly_tobytes(uint8_t r[KYBER_POLYBYTES], const int16_t *a) {
+void poly_tobytes(uint8_t r[KYBER_POLYBYTES], const int16_t a[KYBER_N]) {
unsigned int i;
uint16_t t0, t1;
@@ -91,7 +91,7 @@ void poly_tobytes(uint8_t r[KYBER_POLYBYTES], const int16_t *a) {
* - const uint8_t *a: pointer to input byte array
* (of KYBER_POLYBYTES bytes)
**************************************************/
-void poly_frombytes(int16_t *r, const uint8_t a[KYBER_POLYBYTES]) {
+void poly_frombytes(int16_t r[KYBER_N], const uint8_t a[KYBER_POLYBYTES]) {
uint8x16x3_t neon_buf;
uint16x8x4_t tmp;
int16x8x4_t value;
@@ -135,7 +135,7 @@ void poly_frombytes(int16_t *r, const uint8_t a[KYBER_POLYBYTES]) {
* Arguments: - poly *r: pointer to output polynomial
* - const uint8_t *msg: pointer to input message
**************************************************/
-void poly_frommsg(int16_t *r, const uint8_t msg[KYBER_INDCPA_MSGBYTES]) {
+void poly_frommsg(int16_t r[KYBER_N], const uint8_t msg[KYBER_INDCPA_MSGBYTES]) {
unsigned int i, j;
int16_t mask;
@@ -156,7 +156,7 @@ void poly_frommsg(int16_t *r, const uint8_t msg[KYBER_INDCPA_MSGBYTES]) {
* Arguments: - uint8_t *msg: pointer to output message
* - const poly *a: pointer to input polynomial
**************************************************/
-void poly_tomsg(uint8_t msg[KYBER_INDCPA_MSGBYTES], const int16_t *a) {
+void poly_tomsg(uint8_t msg[KYBER_INDCPA_MSGBYTES], const int16_t a[KYBER_N]) {
unsigned int i, j;
uint16_t t;