Skip to content

Commit daca1a3

Browse files
authored
Merge pull request #654 from pq-code-package/aws_lc_integration
Add AWS-LC integration test
2 parents d0d4b27 + 8213bee commit daca1a3

File tree

3 files changed

+192
-1
lines changed

3 files changed

+192
-1
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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
35+
AWSLC_DIR=$GITHUB_WORKSPACE/${{ inputs.dir }}
36+
37+
# TEMPORARY: Patch up importer
38+
if [[ "$(uname)" == "Darwin" ]]; then
39+
sed -i '' 's/\$SED_I/"${SED_I[@]}"/g' $AWSLC_DIR/crypto/fipsmodule/ml_kem/importer.sh
40+
fi

.github/workflows/all.yml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,33 @@ jobs:
4040
uses: ./.github/workflows/cbmc.yml
4141
secrets: inherit
4242
oqs_integration:
43-
name: Integration
43+
name: libOQS
4444
permissions:
4545
contents: 'read'
4646
id-token: 'write'
4747
needs: [ base ]
4848
uses: ./.github/workflows/integration-liboqs.yml
4949
secrets: inherit
50+
awslc_integration_fixed:
51+
name: AWS-LC (412be9)
52+
permissions:
53+
contents: 'read'
54+
id-token: 'write'
55+
needs: [ base ]
56+
uses: ./.github/workflows/integration-awslc.yml
57+
with:
58+
commit: 412be9d1bb4f9d2f962dba1beac41249dbacdb55
59+
secrets: inherit
60+
awslc_integration_head:
61+
name: AWS-LC (HEAD)
62+
permissions:
63+
contents: 'read'
64+
id-token: 'write'
65+
needs: [ base ]
66+
uses: ./.github/workflows/integration-awslc.yml
67+
with:
68+
commit: main
69+
secrets: inherit
5070
ct-test:
5171
name: Constant-time
5272
permissions:
Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
name: AWS-LC
4+
permissions:
5+
contents: read
6+
on:
7+
workflow_call:
8+
inputs:
9+
commit:
10+
type: string
11+
description: Commit to test against
12+
default: main
13+
repository:
14+
type: string
15+
description: Repository to fetch
16+
default: aws/aws-lc
17+
18+
concurrency:
19+
group: ${{ github.workflow }}-${{ github.ref }}-${{ inputs.commit }}
20+
cancel-in-progress: true
21+
22+
env:
23+
DEPENDENCIES: 'cmake golang unifdef'
24+
25+
jobs:
26+
aws_lc_integration_fips:
27+
strategy:
28+
fail-fast: false
29+
matrix:
30+
system: [ubuntu-latest, pqcp-arm64]
31+
fips: [0,1]
32+
name: AWS-LC FIPS test (${{ matrix.system }}, FIPS=${{ matrix.fips }})
33+
runs-on: ${{ matrix.system }}
34+
steps:
35+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
36+
- uses: ./.github/actions/setup-os
37+
with:
38+
packages: ${{ env.DEPENDENCIES }}
39+
- uses: ./.github/actions/setup-aws-lc
40+
with:
41+
repository: ${{ inputs.repository }}
42+
commit: ${{ inputs.commit }}
43+
- name: Run importer
44+
run: |
45+
cd $AWSLC_DIR/crypto/fipsmodule/ml_kem
46+
rm -rf mlkem
47+
GITHUB_REPOSITORY=$GITHUB_REPOSITORY GITHUB_SHA=$GITHUB_SHA ./importer.sh --force
48+
- name: Build+Test AWS-LC (FIPS=${{ matrix.fips }})
49+
run: |
50+
cd $AWSLC_DIR
51+
mkdir build
52+
cd build
53+
cmake -DFIPS=${{ matrix.fips }} ..
54+
cd ..
55+
56+
cmake --build ./build --target all
57+
cmake --build ./build --target run_tests
58+
posix:
59+
# This is a partial parallelization of the run_posix_tests.sh script
60+
strategy:
61+
max-parallel: 16
62+
fail-fast: false
63+
matrix:
64+
system: [ubuntu-latest, pqcp-arm64]
65+
test:
66+
- name: Debug mode
67+
flags: -DENABLE_DILITHIUM=ON
68+
- name: Release mode
69+
flags: -DCMAKE_BUILD_TYPE=Release -DENABLE_DILITHIUM=ON
70+
- name: Small compilation
71+
flags: -DOPENSSL_SMALL=1 -DCMAKE_BUILD_TYPE=Release -DENABLE_DILITHIUM=ON
72+
- name: No-ASM
73+
flags: -DOPENSSL_NO_ASM=1 -DCMAKE_BUILD_TYPE=Release -DENABLE_DILITHIUM=ON
74+
- name: Shared
75+
flags: -DBUILD_SHARED_LIBS=1 -DCMAKE_BUILD_TYPE=Release -DENABLE_DILITHIUM=ON
76+
- name: Pre-Gen ASM
77+
flags: -DDISABLE_PERL=ON -DENABLE_DILITHIUM=ON
78+
- name: DIT
79+
flags: -DENABLE_DATA_INDEPENDENT_TIMING=ON -DCMAKE_BUILD_TYPE=Release -DENABLE_DILITHIUM=ON
80+
name: Posix test (${{ matrix.test.name }}, ${{ matrix.system }})
81+
runs-on: ${{ matrix.system }}
82+
steps:
83+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
84+
- uses: ./.github/actions/setup-os
85+
with:
86+
packages: ${{ env.DEPENDENCIES }}
87+
- uses: ./.github/actions/setup-aws-lc
88+
with:
89+
repository: ${{ inputs.repository }}
90+
commit: ${{ inputs.commit }}
91+
- name: Run importer
92+
run: |
93+
cd $AWSLC_DIR/crypto/fipsmodule/ml_kem
94+
GITHUB_REPOSITORY=$GITHUB_REPOSITORY GITHUB_SHA=$GITHUB_SHA ./importer.sh --force
95+
- name: Run test
96+
run: |
97+
cd $AWSLC_DIR
98+
source tests/ci/common_posix_setup.sh
99+
build_and_test ${{ matrix.test.flags }}
100+
prefix:
101+
# This is a parallelization of the run_prefix_tests.sh script
102+
strategy:
103+
max-parallel: 8
104+
fail-fast: false
105+
matrix:
106+
system: [ubuntu-latest, pqcp-arm64, macos-latest, macos-13]
107+
test:
108+
- name: Prefix+Debug
109+
flags:
110+
- name: Prefix+Release
111+
flags: -DCMAKE_BUILD_TYPE=Release
112+
name: Prefix test (${{ matrix.test.name }}, ${{ matrix.system }})
113+
runs-on: ${{ matrix.system }}
114+
steps:
115+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
116+
- uses: ./.github/actions/setup-os
117+
with:
118+
packages: ${{ env.DEPENDENCIES }}
119+
- uses: ./.github/actions/setup-aws-lc
120+
with:
121+
repository: ${{ inputs.repository }}
122+
commit: ${{ inputs.commit }}
123+
- name: Run importer
124+
run: |
125+
cd $AWSLC_DIR/crypto/fipsmodule/ml_kem
126+
GITHUB_REPOSITORY=$GITHUB_REPOSITORY GITHUB_SHA=$GITHUB_SHA ./importer.sh --force
127+
- name: Run test
128+
run: |
129+
cd $AWSLC_DIR
130+
source tests/ci/common_posix_setup.sh
131+
build_prefix_and_test ${{ matrix.flags }}

0 commit comments

Comments
 (0)