Skip to content

Commit

Permalink
pull update [run tests] [extended tests]
Browse files Browse the repository at this point in the history
Signed-off-by: Basil Hess <[email protected]>
  • Loading branch information
bhess committed Jan 30, 2025
1 parent bb69318 commit df95edc
Show file tree
Hide file tree
Showing 118 changed files with 9,445 additions and 12,730 deletions.
4 changes: 2 additions & 2 deletions docs/algorithms/kem/ml_kem.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
- **Authors' website**: https://pq-crystals.org/kyber/ and https://csrc.nist.gov/pubs/fips/203
- **Specification version**: ML-KEM.
- **Primary Source**<a name="primary-source"></a>:
- **Source**: https://github.com/pq-code-package/mlkem-native/commit/84398e7230fa31ba4241f5eb36bdc3c1dbbd5bcd with copy_from_upstream patches
- **Source**: https://github.com/pq-code-package/mlkem-native/commit/d830bc22eb1613bbe38028cfefc33f1a52a40b2f with copy_from_upstream patches
- **Implementation license (SPDX-Identifier)**: CC0-1.0 or Apache-2.0
- **Optimized Implementation sources**: https://github.com/pq-code-package/mlkem-native/commit/84398e7230fa31ba4241f5eb36bdc3c1dbbd5bcd with copy_from_upstream patches
- **Optimized Implementation sources**: https://github.com/pq-code-package/mlkem-native/commit/d830bc22eb1613bbe38028cfefc33f1a52a40b2f with copy_from_upstream patches
- **cupqc-cuda**:<a name="cupqc-cuda"></a>
- **Source**: https://github.com/praveksharma/cupqc-mlkem/commit/b026f4e5475cd9c20c2082c7d9bad80e5b0ba89e
- **Implementation license (SPDX-Identifier)**: Apache-2.0
Expand Down
2 changes: 1 addition & 1 deletion docs/algorithms/kem/ml_kem.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ website: https://pq-crystals.org/kyber/ and https://csrc.nist.gov/pubs/fips/203
nist-round: FIPS203
spec-version: ML-KEM
primary-upstream:
source: https://github.com/pq-code-package/mlkem-native/commit/84398e7230fa31ba4241f5eb36bdc3c1dbbd5bcd
source: https://github.com/pq-code-package/mlkem-native/commit/d830bc22eb1613bbe38028cfefc33f1a52a40b2f
with copy_from_upstream patches
spdx-license-identifier: CC0-1.0 or Apache-2.0
optimized-upstreams:
Expand Down
2 changes: 1 addition & 1 deletion scripts/copy_from_upstream/copy_from_upstream.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ upstreams:
name: mlkem-native
git_url: https://github.com/pq-code-package/mlkem-native.git
git_branch: main
git_commit: 84398e7230fa31ba4241f5eb36bdc3c1dbbd5bcd
git_commit: d830bc22eb1613bbe38028cfefc33f1a52a40b2f
kem_meta_path: 'integration/liboqs/{pretty_name_full}_META.yml'
kem_scheme_path: '.'
patches: [mlkem-native-ml_kem.patch]
Expand Down
12 changes: 6 additions & 6 deletions src/kem/ml_kem/CMakeLists.txt

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@ works:
- _Fast and Clean: Auditable high-performance assembly via constraint solving_, Amin Abdulrahman, Hanno Becker, Matthias
J. Kannwischer, Fabien Klein, [https://eprint.iacr.org/2022/1303](https://eprint.iacr.org/2022/1303)

## Profiles

This backend comes with two profiles: "clean" and optimized. The "clean" backend is handwritten and meant to be easy to
read and modify; for example, is heavily leverages register aliases and assembly macros. The optimized profile is
automatically generated from the clean profile via [SLOTHY](https://github.com/slothy-optimizer/slothy). Currently, the
## Variants

This backend comes in two versions: "clean" and optimized. The "clean" backend is handwritten and meant to be easy to read and modify; for example, is heavily leverages register aliases and assembly macros. This directory contains the optimized version, which is automatically generated from the clean one via [SLOTHY](https://github.com/slothy-optimizer/slothy). Currently, the
target architecture is Cortex-A55, but you can easily re-optimize the code for a different microarchitecture supported
by SLOTHY, by adjusting the parameters in [optimize.sh](src/optimize.sh).
by SLOTHY, by adjusting the parameters in [optimize.sh](../../../test/aarch64_clean/src/optimize.sh).

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
* SPDX-License-Identifier: Apache-2.0
*/

/* ML-KEM arithmetic native profile for clean assembly */

#ifdef MLKEM_NATIVE_ARITH_PROFILE_H
#error Only one MLKEM_ARITH assembly profile can be defined -- did you include multiple profiles?
#else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@

#include "../../../common.h"

#if defined(MLKEM_NATIVE_ARITH_BACKEND_AARCH64_CLEAN) || \
defined(MLKEM_NATIVE_ARITH_BACKEND_AARCH64_OPT)
#if defined(MLKEM_NATIVE_ARITH_BACKEND_AARCH64_OPT)

#include <stdint.h>
#include "arith_native_aarch64.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,62 +29,49 @@ extern const int16_t aarch64_zetas_mulcache_native[];
extern const int16_t aarch64_zetas_mulcache_twisted_native[];
extern const uint8_t rej_uniform_table[];

#define ntt_asm_clean MLKEM_NAMESPACE(ntt_asm_clean)
void ntt_asm_clean(int16_t *, const int16_t *, const int16_t *);

#define ntt_asm_opt MLKEM_NAMESPACE(ntt_asm_opt)
void ntt_asm_opt(int16_t *, const int16_t *, const int16_t *);

#define intt_asm_clean MLKEM_NAMESPACE(intt_asm_clean)
void intt_asm_clean(int16_t *, const int16_t *, const int16_t *);

#define intt_asm_opt MLKEM_NAMESPACE(intt_asm_opt)
void intt_asm_opt(int16_t *, const int16_t *, const int16_t *);

#define rej_uniform_asm_clean MLKEM_NAMESPACE(rej_uniform_asm_clean)
unsigned rej_uniform_asm_clean(int16_t *r, const uint8_t *buf, unsigned buflen,
const uint8_t *table);

#define poly_reduce_asm_clean MLKEM_NAMESPACE(poly_reduce_asm_clean)
void poly_reduce_asm_clean(int16_t *);

#define poly_reduce_asm_opt MLKEM_NAMESPACE(poly_reduce_asm_opt)
void poly_reduce_asm_opt(int16_t *);

#define poly_tomont_asm_clean MLKEM_NAMESPACE(poly_tomont_asm_clean)
void poly_tomont_asm_clean(int16_t *);

#define poly_tomont_asm_opt MLKEM_NAMESPACE(poly_tomont_asm_opt)
void poly_tomont_asm_opt(int16_t *);

#define poly_mulcache_compute_asm_clean \
MLKEM_NAMESPACE(poly_mulcache_compute_asm_clean)
void poly_mulcache_compute_asm_clean(int16_t *, const int16_t *,
const int16_t *, const int16_t *);


#define poly_mulcache_compute_asm_opt \
MLKEM_NAMESPACE(poly_mulcache_compute_asm_opt)
void poly_mulcache_compute_asm_opt(int16_t *, const int16_t *, const int16_t *,
const int16_t *);

#define poly_tobytes_asm_clean MLKEM_NAMESPACE(poly_tobytes_asm_clean)
void poly_tobytes_asm_clean(uint8_t *r, const int16_t *a);

#define poly_tobytes_asm_opt MLKEM_NAMESPACE(poly_tobytes_asm_opt)
void poly_tobytes_asm_opt(uint8_t *r, const int16_t *a);

#define polyvec_basemul_acc_montgomery_cached_asm_clean \
MLKEM_NAMESPACE_K(polyvec_basemul_acc_montgomery_cached_asm_clean)
void polyvec_basemul_acc_montgomery_cached_asm_clean(int16_t *r,
const int16_t *a,
const int16_t *b,
const int16_t *b_cache);
#define polyvec_basemul_acc_montgomery_cached_asm_k2_opt \
MLKEM_NAMESPACE(polyvec_basemul_acc_montgomery_cached_asm_k2_opt)
void polyvec_basemul_acc_montgomery_cached_asm_k2_opt(int16_t *r,
const int16_t *a,
const int16_t *b,
const int16_t *b_cache);

#define polyvec_basemul_acc_montgomery_cached_asm_k3_opt \
MLKEM_NAMESPACE(polyvec_basemul_acc_montgomery_cached_asm_k3_opt)
void polyvec_basemul_acc_montgomery_cached_asm_k3_opt(int16_t *r,
const int16_t *a,
const int16_t *b,
const int16_t *b_cache);

#define polyvec_basemul_acc_montgomery_cached_asm_k4_opt \
MLKEM_NAMESPACE(polyvec_basemul_acc_montgomery_cached_asm_k4_opt)
void polyvec_basemul_acc_montgomery_cached_asm_k4_opt(int16_t *r,
const int16_t *a,
const int16_t *b,
const int16_t *b_cache);

#define polyvec_basemul_acc_montgomery_cached_asm_opt \
MLKEM_NAMESPACE_K(polyvec_basemul_acc_montgomery_cached_asm_opt)
void polyvec_basemul_acc_montgomery_cached_asm_opt(int16_t *r, const int16_t *a,
const int16_t *b,
const int16_t *b_cache);
#define rej_uniform_asm_clean MLKEM_NAMESPACE(rej_uniform_asm_clean)
unsigned rej_uniform_asm_clean(int16_t *r, const uint8_t *buf, unsigned buflen,
const uint8_t *table);

#endif /* MLKEM_AARCH64_NATIVE_H */

This file was deleted.

Loading

0 comments on commit df95edc

Please sign in to comment.