Skip to content

Commit 414b211

Browse files
committed
Add basic AWS-LC integration test
This commit extends the CI with an integration test for AWS-LC. The integration test currently works with the `mlkem_native` branch from the fork `hanno-becker/aws-lc`, which - Removes the reference implementation - Provides an importer.sh for importing mlkem-native - Provides the glue code between mlkem-native's own API and the API expected by AWS-LC. - As a temporary change, it disables `-Werror=redundant-decls`, because mlkem-native does not yet support it. The CI checks that mlkem-native successfully integrated to this fork, 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 dd56e26 commit 414b211

2 files changed

Lines changed: 75 additions & 0 deletions

File tree

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/ci.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,47 @@ jobs:
209209
./scripts/autogen ${{ matrix.backend.arg }} ${{ matrix.simplify.arg }}
210210
make clean
211211
OPT=1 make quickcheck
212+
aws_lc_integration:
213+
strategy:
214+
matrix:
215+
system: [Ubuntu-latest]
216+
name: AWS-LC integration test
217+
runs-on: ${{ matrix.system }}
218+
steps:
219+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
220+
- uses: ./.github/actions/setup-os
221+
with:
222+
packages: 'cmake'
223+
- uses: ./.github/actions/setup-aws-lc
224+
with:
225+
repository: 'hanno-becker/aws-lc'
226+
commit: 'mlkem_native'
227+
- name: Run importer
228+
run: |
229+
cd $AWSLC_DIR/crypto/fipsmodule/ml_kem
230+
GITHUB_REPOSITORY=$GITHUB_REPOSITORY GITHUB_SHA=$GITHUB_SHA ./importer.sh
231+
- name: Build AWS-LC (FIPS=1)
232+
run: |
233+
cd $AWSLC_DIR
234+
mkdir build_fips
235+
cd build_fips
236+
cmake -DFIPS=1 ..
237+
cd ..
238+
239+
cmake --build ./build_fips --target all
240+
cmake --build ./build_fips --target run_tests
241+
- name: Build AWS-LC (FIPS=0)
242+
run: |
243+
cd $AWSLC_DIR
244+
mkdir build_no_fips
245+
cd build_no_fips
246+
cmake ..
247+
cd ..
248+
249+
cmake --build ./build_no_fips --target all
250+
cmake --build ./build_no_fips --target run_tests
251+
>>>>>>> 10ee5b56 (Add basic AWS-LC integration test)
252+
>>>>>>> 730116b7 (Add basic AWS-LC integration test)
212253
build_kat:
213254
needs: [quickcheck, quickcheck-windows, quickcheck-c90, quickcheck-lib, examples, lint, lint-markdown-link]
214255
strategy:

0 commit comments

Comments
 (0)