Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
154 changes: 77 additions & 77 deletions .github/workflows/all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,87 +26,87 @@ jobs:
contents: 'read'
id-token: 'write'
uses: ./.github/workflows/lint_markdown.yml
nix:
name: Nix
permissions:
actions: 'write'
contents: 'read'
id-token: 'write'
uses: ./.github/workflows/nix.yml
secrets: inherit
ci:
name: Extended
permissions:
contents: 'read'
id-token: 'write'
needs: [ base, nix ]
uses: ./.github/workflows/ci.yml
secrets: inherit
# nix:
# name: Nix
# permissions:
# actions: 'write'
# contents: 'read'
# id-token: 'write'
# uses: ./.github/workflows/nix.yml
# secrets: inherit
# ci:
# name: Extended
# permissions:
# contents: 'read'
# id-token: 'write'
# needs: [ base, nix ]
# uses: ./.github/workflows/ci.yml
# secrets: inherit
cbmc:
name: CBMC
permissions:
contents: 'read'
id-token: 'write'
needs: [ base, nix ]
# needs: [ base, nix ]
uses: ./.github/workflows/cbmc.yml
secrets: inherit
oqs_integration:
name: libOQS
permissions:
contents: 'read'
id-token: 'write'
needs: [ base ]
uses: ./.github/workflows/integration-liboqs.yml
secrets: inherit
opentitan_integration:
name: OpenTitan
permissions:
contents: 'read'
id-token: 'write'
needs: [ base ]
uses: ./.github/workflows/integration-opentitan.yml
secrets: inherit
awslc_integration_fixed:
name: AWS-LC (v1.64.0)
permissions:
contents: 'read'
id-token: 'write'
needs: [ base ]
uses: ./.github/workflows/integration-awslc.yml
with:
commit: 7187ab572ddcdae4fa408e932d3e878c9941137b # v1.64.0
secrets: inherit
awslc_integration_head:
name: AWS-LC (HEAD)
permissions:
contents: 'read'
id-token: 'write'
needs: [ base ]
uses: ./.github/workflows/integration-awslc.yml
with:
commit: main
secrets: inherit
ct-test:
name: Constant-time
permissions:
contents: 'read'
id-token: 'write'
needs: [ base, nix ]
uses: ./.github/workflows/ct-tests.yml
secrets: inherit
slothy:
name: SLOTHY
permissions:
contents: 'read'
id-token: 'write'
needs: [ base, nix ]
uses: ./.github/workflows/slothy.yml
secrets: inherit
baremetal:
name: Baremetal
permissions:
contents: 'read'
id-token: 'write'
needs: [ base ]
uses: ./.github/workflows/baremetal.yml
secrets: inherit
# oqs_integration:
# name: libOQS
# permissions:
# contents: 'read'
# id-token: 'write'
# needs: [ base ]
# uses: ./.github/workflows/integration-liboqs.yml
# secrets: inherit
# opentitan_integration:
# name: OpenTitan
# permissions:
# contents: 'read'
# id-token: 'write'
# needs: [ base ]
# uses: ./.github/workflows/integration-opentitan.yml
# secrets: inherit
# awslc_integration_fixed:
# name: AWS-LC (v1.64.0)
# permissions:
# contents: 'read'
# id-token: 'write'
# needs: [ base ]
# uses: ./.github/workflows/integration-awslc.yml
# with:
# commit: 7187ab572ddcdae4fa408e932d3e878c9941137b # v1.64.0
# secrets: inherit
# awslc_integration_head:
# name: AWS-LC (HEAD)
# permissions:
# contents: 'read'
# id-token: 'write'
# needs: [ base ]
# uses: ./.github/workflows/integration-awslc.yml
# with:
# commit: main
# secrets: inherit
# ct-test:
# name: Constant-time
# permissions:
# contents: 'read'
# id-token: 'write'
# needs: [ base, nix ]
# uses: ./.github/workflows/ct-tests.yml
# secrets: inherit
# slothy:
# name: SLOTHY
# permissions:
# contents: 'read'
# id-token: 'write'
# needs: [ base, nix ]
# uses: ./.github/workflows/slothy.yml
# secrets: inherit
# baremetal:
# name: Baremetal
# permissions:
# contents: 'read'
# id-token: 'write'
# needs: [ base ]
# uses: ./.github/workflows/baremetal.yml
# secrets: inherit
10 changes: 10 additions & 0 deletions dev/aarch64_clean/meta.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,32 +25,37 @@
#include "../api.h"
#include "src/arith_native_aarch64.h"

MLK_MUST_CHECK_RETURN_VALUE
static MLK_INLINE int mlk_ntt_native(int16_t data[MLKEM_N])
{
mlk_ntt_asm(data, mlk_aarch64_ntt_zetas_layer12345,
mlk_aarch64_ntt_zetas_layer67);
return MLK_NATIVE_FUNC_SUCCESS;
}

MLK_MUST_CHECK_RETURN_VALUE
static MLK_INLINE int mlk_intt_native(int16_t data[MLKEM_N])
{
mlk_intt_asm(data, mlk_aarch64_invntt_zetas_layer12345,
mlk_aarch64_invntt_zetas_layer67);
return MLK_NATIVE_FUNC_SUCCESS;
}

MLK_MUST_CHECK_RETURN_VALUE
static MLK_INLINE int mlk_poly_reduce_native(int16_t data[MLKEM_N])
{
mlk_poly_reduce_asm(data);
return MLK_NATIVE_FUNC_SUCCESS;
}

MLK_MUST_CHECK_RETURN_VALUE
static MLK_INLINE int mlk_poly_tomont_native(int16_t data[MLKEM_N])
{
mlk_poly_tomont_asm(data);
return MLK_NATIVE_FUNC_SUCCESS;
}

MLK_MUST_CHECK_RETURN_VALUE
static MLK_INLINE int mlk_poly_mulcache_compute_native(int16_t x[MLKEM_N / 2],
const int16_t y[MLKEM_N])
{
Expand All @@ -60,6 +65,7 @@ static MLK_INLINE int mlk_poly_mulcache_compute_native(int16_t x[MLKEM_N / 2],
}

#if defined(MLK_CONFIG_MULTILEVEL_WITH_SHARED) || MLKEM_K == 2
MLK_MUST_CHECK_RETURN_VALUE
static MLK_INLINE int mlk_polyvec_basemul_acc_montgomery_cached_k2_native(
int16_t r[MLKEM_N], const int16_t a[2 * MLKEM_N],
const int16_t b[2 * MLKEM_N], const int16_t b_cache[2 * (MLKEM_N / 2)])
Expand All @@ -70,6 +76,7 @@ static MLK_INLINE int mlk_polyvec_basemul_acc_montgomery_cached_k2_native(
#endif /* MLK_CONFIG_MULTILEVEL_WITH_SHARED || MLKEM_K == 2 */

#if defined(MLK_CONFIG_MULTILEVEL_WITH_SHARED) || MLKEM_K == 3
MLK_MUST_CHECK_RETURN_VALUE
static MLK_INLINE int mlk_polyvec_basemul_acc_montgomery_cached_k3_native(
int16_t r[MLKEM_N], const int16_t a[3 * MLKEM_N],
const int16_t b[3 * MLKEM_N], const int16_t b_cache[3 * (MLKEM_N / 2)])
Expand All @@ -80,6 +87,7 @@ static MLK_INLINE int mlk_polyvec_basemul_acc_montgomery_cached_k3_native(
#endif /* MLK_CONFIG_MULTILEVEL_WITH_SHARED || MLKEM_K == 3 */

#if defined(MLK_CONFIG_MULTILEVEL_WITH_SHARED) || MLKEM_K == 4
MLK_MUST_CHECK_RETURN_VALUE
static MLK_INLINE int mlk_polyvec_basemul_acc_montgomery_cached_k4_native(
int16_t r[MLKEM_N], const int16_t a[4 * MLKEM_N],
const int16_t b[4 * MLKEM_N], const int16_t b_cache[4 * (MLKEM_N / 2)])
Expand All @@ -89,13 +97,15 @@ static MLK_INLINE int mlk_polyvec_basemul_acc_montgomery_cached_k4_native(
}
#endif /* MLK_CONFIG_MULTILEVEL_WITH_SHARED || MLKEM_K == 4 */

MLK_MUST_CHECK_RETURN_VALUE
static MLK_INLINE int mlk_poly_tobytes_native(uint8_t r[MLKEM_POLYBYTES],
const int16_t a[MLKEM_N])
{
mlk_poly_tobytes_asm(r, a);
return MLK_NATIVE_FUNC_SUCCESS;
}

MLK_MUST_CHECK_RETURN_VALUE
static MLK_INLINE int mlk_rej_uniform_native(int16_t *r, unsigned len,
const uint8_t *buf,
unsigned buflen)
Expand Down
1 change: 1 addition & 0 deletions dev/aarch64_clean/src/arith_native_aarch64.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ __contract__(
);

#define mlk_rej_uniform_asm MLK_NAMESPACE(rej_uniform_asm)
MLK_MUST_CHECK_RETURN_VALUE
uint64_t mlk_rej_uniform_asm(int16_t r[256], const uint8_t *buf,
unsigned buflen, const uint8_t table[2048])
/* This must be kept in sync with the HOL-Light specification
Expand Down
10 changes: 10 additions & 0 deletions dev/aarch64_opt/meta.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,32 +25,37 @@
#include "../api.h"
#include "src/arith_native_aarch64.h"

MLK_MUST_CHECK_RETURN_VALUE
static MLK_INLINE int mlk_ntt_native(int16_t data[MLKEM_N])
{
mlk_ntt_asm(data, mlk_aarch64_ntt_zetas_layer12345,
mlk_aarch64_ntt_zetas_layer67);
return MLK_NATIVE_FUNC_SUCCESS;
}

MLK_MUST_CHECK_RETURN_VALUE
static MLK_INLINE int mlk_intt_native(int16_t data[MLKEM_N])
{
mlk_intt_asm(data, mlk_aarch64_invntt_zetas_layer12345,
mlk_aarch64_invntt_zetas_layer67);
return MLK_NATIVE_FUNC_SUCCESS;
}

MLK_MUST_CHECK_RETURN_VALUE
static MLK_INLINE int mlk_poly_reduce_native(int16_t data[MLKEM_N])
{
mlk_poly_reduce_asm(data);
return MLK_NATIVE_FUNC_SUCCESS;
}

MLK_MUST_CHECK_RETURN_VALUE
static MLK_INLINE int mlk_poly_tomont_native(int16_t data[MLKEM_N])
{
mlk_poly_tomont_asm(data);
return MLK_NATIVE_FUNC_SUCCESS;
}

MLK_MUST_CHECK_RETURN_VALUE
static MLK_INLINE int mlk_poly_mulcache_compute_native(int16_t x[MLKEM_N / 2],
const int16_t y[MLKEM_N])
{
Expand All @@ -60,6 +65,7 @@ static MLK_INLINE int mlk_poly_mulcache_compute_native(int16_t x[MLKEM_N / 2],
}

#if defined(MLK_CONFIG_MULTILEVEL_WITH_SHARED) || MLKEM_K == 2
MLK_MUST_CHECK_RETURN_VALUE
static MLK_INLINE int mlk_polyvec_basemul_acc_montgomery_cached_k2_native(
int16_t r[MLKEM_N], const int16_t a[2 * MLKEM_N],
const int16_t b[2 * MLKEM_N], const int16_t b_cache[2 * (MLKEM_N / 2)])
Expand All @@ -70,6 +76,7 @@ static MLK_INLINE int mlk_polyvec_basemul_acc_montgomery_cached_k2_native(
#endif /* MLK_CONFIG_MULTILEVEL_WITH_SHARED || MLKEM_K == 2 */

#if defined(MLK_CONFIG_MULTILEVEL_WITH_SHARED) || MLKEM_K == 3
MLK_MUST_CHECK_RETURN_VALUE
static MLK_INLINE int mlk_polyvec_basemul_acc_montgomery_cached_k3_native(
int16_t r[MLKEM_N], const int16_t a[3 * MLKEM_N],
const int16_t b[3 * MLKEM_N], const int16_t b_cache[3 * (MLKEM_N / 2)])
Expand All @@ -80,6 +87,7 @@ static MLK_INLINE int mlk_polyvec_basemul_acc_montgomery_cached_k3_native(
#endif /* MLK_CONFIG_MULTILEVEL_WITH_SHARED || MLKEM_K == 3 */

#if defined(MLK_CONFIG_MULTILEVEL_WITH_SHARED) || MLKEM_K == 4
MLK_MUST_CHECK_RETURN_VALUE
static MLK_INLINE int mlk_polyvec_basemul_acc_montgomery_cached_k4_native(
int16_t r[MLKEM_N], const int16_t a[4 * MLKEM_N],
const int16_t b[4 * MLKEM_N], const int16_t b_cache[4 * (MLKEM_N / 2)])
Expand All @@ -89,13 +97,15 @@ static MLK_INLINE int mlk_polyvec_basemul_acc_montgomery_cached_k4_native(
}
#endif /* MLK_CONFIG_MULTILEVEL_WITH_SHARED || MLKEM_K == 4 */

MLK_MUST_CHECK_RETURN_VALUE
static MLK_INLINE int mlk_poly_tobytes_native(uint8_t r[MLKEM_POLYBYTES],
const int16_t a[MLKEM_N])
{
mlk_poly_tobytes_asm(r, a);
return MLK_NATIVE_FUNC_SUCCESS;
}

MLK_MUST_CHECK_RETURN_VALUE
static MLK_INLINE int mlk_rej_uniform_native(int16_t *r, unsigned len,
const uint8_t *buf,
unsigned buflen)
Expand Down
1 change: 1 addition & 0 deletions dev/aarch64_opt/src/arith_native_aarch64.h
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ __contract__(
);

#define mlk_rej_uniform_asm MLK_NAMESPACE(rej_uniform_asm)
MLK_MUST_CHECK_RETURN_VALUE
uint64_t mlk_rej_uniform_asm(int16_t r[256], const uint8_t *buf,
unsigned buflen, const uint8_t table[2048])
/* This must be kept in sync with the HOL-Light specification
Expand Down
1 change: 1 addition & 0 deletions dev/fips202/aarch64/x1_scalar.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#if !defined(__ASSEMBLER__)
#include "../api.h"
#include "src/fips202_native_aarch64.h"
MLK_MUST_CHECK_RETURN_VALUE
static MLK_INLINE int mlk_keccak_f1600_x1_native(uint64_t *state)
{
mlk_keccak_f1600_x1_scalar_asm(state, mlk_keccakf1600_round_constants);
Expand Down
1 change: 1 addition & 0 deletions dev/fips202/aarch64/x1_v84a.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#if !defined(__ASSEMBLER__)
#include "../api.h"
#include "src/fips202_native_aarch64.h"
MLK_MUST_CHECK_RETURN_VALUE
static MLK_INLINE int mlk_keccak_f1600_x1_native(uint64_t *state)
{
if (!mlk_sys_check_capability(MLK_SYS_CAP_SHA3))
Expand Down
1 change: 1 addition & 0 deletions dev/fips202/aarch64/x2_v84a.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#if !defined(__ASSEMBLER__)
#include "../api.h"
#include "src/fips202_native_aarch64.h"
MLK_MUST_CHECK_RETURN_VALUE
static MLK_INLINE int mlk_keccak_f1600_x4_native(uint64_t *state)
{
if (!mlk_sys_check_capability(MLK_SYS_CAP_SHA3))
Expand Down
1 change: 1 addition & 0 deletions dev/fips202/aarch64/x4_v8a_scalar.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#if !defined(__ASSEMBLER__)
#include "../api.h"
#include "src/fips202_native_aarch64.h"
MLK_MUST_CHECK_RETURN_VALUE
static MLK_INLINE int mlk_keccak_f1600_x4_native(uint64_t *state)
{
mlk_keccak_f1600_x4_v8a_scalar_hybrid_asm(state,
Expand Down
1 change: 1 addition & 0 deletions dev/fips202/aarch64/x4_v8a_v84a_scalar.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#if !defined(__ASSEMBLER__)
#include "../api.h"
#include "src/fips202_native_aarch64.h"
MLK_MUST_CHECK_RETURN_VALUE
static MLK_INLINE int mlk_keccak_f1600_x4_native(uint64_t *state)
{
if (!mlk_sys_check_capability(MLK_SYS_CAP_SHA3))
Expand Down
Loading
Loading