Skip to content

Commit df10c4f

Browse files
committed
Add basic AWS-LC integration test
This commit extends the CI with an integration test for AWS-LC. The CI checks that mlkem-native successfully integrates into AWS-LC by building and running basic tests of AWS-LC in FIPS and non-FIPS mode. Signed-off-by: Hanno Becker <beckphan@amazon.co.uk>
1 parent e00101e commit df10c4f

File tree

3 files changed

+108
-0
lines changed

3 files changed

+108
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
name: Setup AWS-LC
4+
description: Setup AWS-LC
5+
6+
inputs:
7+
dir:
8+
description: Directory to fetch AWS-LC into
9+
default: 'AWS-LC'
10+
repository:
11+
description: Repository to fetch from
12+
default: 'aws/AWS-LC'
13+
commit:
14+
description: Commit to fetch
15+
default: 'HEAD'
16+
gh_token:
17+
description: Github access token to use
18+
required: true
19+
20+
runs:
21+
using: composite
22+
steps:
23+
- name: Fetch AWS-LC
24+
shell: bash
25+
run: |
26+
mkdir ${{ inputs.dir }} && cd ${{ inputs.dir }}
27+
git config --global --add safe.directory $GITHUB_WORKSPACE/${{ inputs.dir }}
28+
git init
29+
git remote add origin $GITHUB_SERVER_URL/${{ inputs.repository }}
30+
git fetch origin --depth 1 ${{ inputs.commit }}
31+
git checkout FETCH_HEAD
32+
33+
# Remember AWS-LC directory
34+
echo AWSLC_DIR="$GITHUB_WORKSPACE/${{ inputs.dir }}" >> $GITHUB_ENV

.github/workflows/all.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,14 @@ jobs:
4747
needs: [ base ]
4848
uses: ./.github/workflows/integration-liboqs.yml
4949
secrets: inherit
50+
awslc_integration:
51+
name: Integration
52+
permissions:
53+
contents: 'read'
54+
id-token: 'write'
55+
needs: [ base ]
56+
uses: ./.github/workflows/integration-awslc.yml
57+
secrets: inherit
5058
ct-test:
5159
name: Constant-time
5260
permissions:
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
name: Test AWS-LC integration
4+
permissions:
5+
contents: read
6+
on:
7+
workflow_call:
8+
workflow_dispatch:
9+
10+
jobs:
11+
aws_lc_integration_fips:
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
system: [ubuntu-latest, pqcp-arm64]
16+
fips: [0,1]
17+
name: AWS-LC FIPS test (${{ matrix.system }}, FIPS=${{ matrix.fips }})
18+
runs-on: ${{ matrix.system }}
19+
steps:
20+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
21+
- uses: ./.github/actions/setup-os
22+
with:
23+
packages: 'cmake'
24+
- uses: ./.github/actions/setup-aws-lc
25+
with:
26+
repository: 'aws/aws-lc'
27+
commit: 'main`
28+
- name: Run importer
29+
run: |
30+
cd $AWSLC_DIR/crypto/fipsmodule/ml_kem
31+
rm -rf mlkem
32+
GITHUB_REPOSITORY=$GITHUB_REPOSITORY GITHUB_SHA=$GITHUB_SHA ./importer.sh
33+
- name: Build+Test AWS-LC (FIPS=${{ matrix.fips }})
34+
run: |
35+
cd $AWSLC_DIR
36+
mkdir build
37+
cd build
38+
cmake -DFIPS=${{ matrix.fips }} ..
39+
cd ..
40+
41+
cmake --build ./build --target all
42+
cmake --build ./build --target run_tests
43+
aws_lc_integration_posix:
44+
strategy:
45+
fail-fast: false
46+
matrix:
47+
system: [ubuntu-latest, pqcp-arm64, macos-latest]
48+
name: AWS-LC Posix test (${{ matrix.system }})
49+
runs-on: ${{ matrix.system }}
50+
steps:
51+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
52+
- uses: ./.github/actions/setup-os
53+
with:
54+
packages: 'cmake golang'
55+
- uses: ./.github/actions/setup-aws-lc
56+
with:
57+
repository: 'aws/aws-lc'
58+
commit: 'main'
59+
- name: Run importer
60+
run: |
61+
cd $AWSLC_DIR/crypto/fipsmodule/ml_kem
62+
GITHUB_REPOSITORY=$GITHUB_REPOSITORY GITHUB_SHA=$GITHUB_SHA ./importer.sh
63+
- name: Run POSIX tests
64+
run: |
65+
cd $AWSLC_DIR
66+
./tests/ci/run_posix_tests.sh

0 commit comments

Comments
 (0)