-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Rust): Interop test vectors; bump Dafny to 4.9.0 (#1004)
- Loading branch information
1 parent
8377acf
commit a505a30
Showing
14 changed files
with
189 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,7 @@ jobs: | |
ubuntu-latest, | ||
macos-13, | ||
] | ||
language: [java, net, python] | ||
language: [java, net, python, rust] | ||
# https://taskei.amazon.dev/tasks/CrypTool-5284 | ||
dotnet-version: ["6.0.x"] | ||
runs-on: ${{ matrix.os }} | ||
|
@@ -37,11 +37,19 @@ jobs: | |
run: | | ||
git config --global core.longpaths true | ||
# Test Vectors need to call KMS | ||
- name: Configure AWS Credentials for Tests | ||
uses: aws-actions/configure-aws-credentials@v2 | ||
with: | ||
aws-region: us-west-2 | ||
role-to-assume: arn:aws:iam::370957321024:role/GitHub-CI-MPL-Dafny-Role-us-west-2 | ||
role-session-name: InterOpTests | ||
|
||
- uses: actions/checkout@v3 | ||
# Not all submodules are needed. | ||
# We manually pull the submodule we DO need. | ||
- run: git submodule update --init libraries | ||
- run: git submodule update --init smithy-dafny | ||
- run: git submodule update --init --recursive smithy-dafny | ||
|
||
# Set up runtimes | ||
- name: Setup .NET Core SDK ${{ matrix.dotnet-version }} | ||
|
@@ -50,8 +58,9 @@ jobs: | |
with: | ||
dotnet-version: ${{ matrix.dotnet-version }} | ||
|
||
# Setup Java in Rust is needed for running polymorph | ||
- name: Setup Java 17 | ||
if: matrix.language == 'java' | ||
if: matrix.language == 'java' || matrix.language == 'rust' | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: "corretto" | ||
|
@@ -67,8 +76,32 @@ jobs: | |
pip install --upgrade tox | ||
pip install poetry | ||
- name: Setup Rust Toolchain for GitHub CI | ||
if: matrix.language == 'rust' | ||
uses: actions-rust-lang/[email protected] | ||
with: | ||
components: rustfmt | ||
# TODO - uncomment this after Rust formatter works | ||
# - name: Rustfmt Check | ||
# uses: actions-rust-lang/rustfmt@v1 | ||
|
||
# TODO: Remove this after the formatting in Rust starts working | ||
- name: smithy-dafny Rust hacks | ||
if: matrix.language == 'rust' | ||
shell: bash | ||
run: | | ||
if [ "$RUNNER_OS" == "macOS" ]; then | ||
sed -i '' 's|rustfmt --edition 2021 runtimes/rust/src/implementation_from_dafny.rs|#&|' smithy-dafny/SmithyDafnyMakefile.mk | ||
else | ||
sed -i 's|rustfmt --edition 2021 runtimes/rust/src/implementation_from_dafny.rs|#&|' smithy-dafny/SmithyDafnyMakefile.mk | ||
fi | ||
- name: Setup NASM for Windows in Rust (aws-lc-sys) | ||
if: matrix.language == 'rust' && matrix.os == 'windows-latest' | ||
uses: ilammy/setup-nasm@v1 | ||
|
||
- name: Setup Dafny | ||
uses: dafny-lang/setup-dafny-action@v1.6.1 | ||
uses: dafny-lang/setup-dafny-action@v1.7.0 | ||
with: | ||
dafny-version: ${{ inputs.dafny }} | ||
|
||
|
@@ -108,20 +141,32 @@ jobs: | |
CORES=$(node -e 'console.log(os.cpus().length)') | ||
make transpile_python | ||
- name: Install Smithy-Dafny codegen dependencies | ||
if: matrix.language == 'rust' | ||
uses: ./.github/actions/install_smithy_dafny_codegen_dependencies | ||
|
||
# TODO: Remove this after checking in Rust polymorph code | ||
- name: Run make polymorph_rust | ||
if: matrix.language == 'rust' | ||
shell: bash | ||
working-directory: ./${{ matrix.library }} | ||
run: | | ||
make polymorph_rust | ||
- name: Build ${{ matrix.library }} implementation in Rust | ||
if: matrix.language == 'rust' | ||
shell: bash | ||
working-directory: ./${{ matrix.library }} | ||
run: | | ||
CORES=$(node -e 'console.log(os.cpus().length)') | ||
make transpile_rust TRANSPILE_TESTS_IN_RUST=1 CORES=$CORES | ||
- name: Setup gradle | ||
if: matrix.language == 'java' | ||
uses: gradle/gradle-build-action@v2 | ||
with: | ||
gradle-version: 7.2 | ||
|
||
# Test Vectors need to call KMS | ||
- name: Configure AWS Credentials for Tests | ||
uses: aws-actions/configure-aws-credentials@v2 | ||
with: | ||
aws-region: us-west-2 | ||
role-to-assume: arn:aws:iam::370957321024:role/GitHub-CI-MPL-Dafny-Role-us-west-2 | ||
role-session-name: InterOpTests | ||
|
||
- name: Create Manifests | ||
working-directory: ./${{ matrix.library }} | ||
run: make test_generate_vectors_${{ matrix.language }} | ||
|
@@ -147,8 +192,8 @@ jobs: | |
ubuntu-latest, | ||
macos-13, | ||
] | ||
encrypting_language: [java, net, python] | ||
decrypting_language: [java, net, python] | ||
encrypting_language: [java, net, python, rust] | ||
decrypting_language: [java, net, python, rust] | ||
dotnet-version: ["6.0.x"] | ||
runs-on: ${{ matrix.os }} | ||
permissions: | ||
|
@@ -158,6 +203,7 @@ jobs: | |
- name: Support longpaths on Git checkout | ||
run: | | ||
git config --global core.longpaths true | ||
# KMS and MPL tests need to use credentials which can call KMS | ||
- name: Configure AWS Credentials for Tests | ||
uses: aws-actions/configure-aws-credentials@v2 | ||
|
@@ -170,7 +216,7 @@ jobs: | |
# Not all submodules are needed. | ||
# We manually pull the submodule we DO need. | ||
- run: git submodule update --init libraries | ||
- run: git submodule update --init smithy-dafny | ||
- run: git submodule update --init --recursive smithy-dafny | ||
|
||
# Set up runtimes | ||
- name: Setup .NET Core SDK ${{ matrix.dotnet-version }} | ||
|
@@ -179,8 +225,9 @@ jobs: | |
with: | ||
dotnet-version: ${{ matrix.dotnet-version }} | ||
|
||
# Setup Java in Rust is needed for running polymorph | ||
- name: Setup Java 17 | ||
if: matrix.decrypting_language == 'java' | ||
if: matrix.decrypting_language == 'java' || matrix.decrypting_language == 'rust' | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: "corretto" | ||
|
@@ -196,6 +243,30 @@ jobs: | |
pip install --upgrade tox | ||
pip install poetry | ||
- name: Setup Rust Toolchain for GitHub CI | ||
if: matrix.decrypting_language == 'rust' | ||
uses: actions-rust-lang/[email protected] | ||
with: | ||
components: rustfmt | ||
# TODO - uncomment this after Rust formatter works | ||
# - name: Rustfmt Check | ||
# uses: actions-rust-lang/rustfmt@v1 | ||
|
||
# TODO: Remove this after the formatting in Rust starts working | ||
- name: smithy-dafny Rust hacks | ||
if: matrix.decrypting_language == 'rust' | ||
shell: bash | ||
run: | | ||
if [ "$RUNNER_OS" == "macOS" ]; then | ||
sed -i '' 's|rustfmt --edition 2021 runtimes/rust/src/implementation_from_dafny.rs|#&|' smithy-dafny/SmithyDafnyMakefile.mk | ||
else | ||
sed -i 's|rustfmt --edition 2021 runtimes/rust/src/implementation_from_dafny.rs|#&|' smithy-dafny/SmithyDafnyMakefile.mk | ||
fi | ||
- name: Setup NASM for Windows in Rust (aws-lc-sys) | ||
if: matrix.decrypting_language == 'rust' && matrix.os == 'windows-latest' | ||
uses: ilammy/setup-nasm@v1 | ||
|
||
- name: Setup Dafny | ||
uses: dafny-lang/[email protected] | ||
with: | ||
|
@@ -237,6 +308,26 @@ jobs: | |
CORES=$(node -e 'console.log(os.cpus().length)') | ||
make transpile_python | ||
- name: Install Smithy-Dafny codegen dependencies | ||
if: matrix.decrypting_language == 'rust' | ||
uses: ./.github/actions/install_smithy_dafny_codegen_dependencies | ||
|
||
# TODO: Remove this after checking in Rust polymorph code | ||
- name: Run make polymorph_rust | ||
if: matrix.decrypting_language == 'rust' | ||
shell: bash | ||
working-directory: ./${{ matrix.library }} | ||
run: | | ||
make polymorph_rust | ||
- name: Build ${{ matrix.library }} implementation in Rust | ||
if: matrix.decrypting_language == 'rust' | ||
shell: bash | ||
working-directory: ./${{ matrix.library }} | ||
run: | | ||
CORES=$(node -e 'console.log(os.cpus().length)') | ||
make transpile_rust TRANSPILE_TESTS_IN_RUST=1 CORES=$CORES | ||
- name: Download Encrypt Manifest Artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,7 +66,7 @@ jobs: | |
- name: Setup Dafny | ||
uses: dafny-lang/[email protected] | ||
with: | ||
dafny-version: nightly-latest | ||
dafny-version: 4.9.0 | ||
|
||
# TODO: Remove this after the formatting in Rust starts working | ||
- name: smithy-dafny Rust hacks | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# This file stores the top level dafny version information. | ||
# All elements of the project need to agree on this version. | ||
dafnyVersion=4.8.0 | ||
dafnyRuntimeJavaVersion=4.8.0 | ||
dafnyVersion=4.9.0 | ||
dafnyRuntimeJavaVersion=4.9.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# This file stores the top level dafny version information. | ||
# All elements of the project need to agree on this version. | ||
dafnyVersion=4.8.0 | ||
dafnyRuntimeJavaVersion=4.8.0 | ||
dafnyVersion=4.9.0 | ||
dafnyRuntimeJavaVersion=4.9.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# This file stores the top level dafny version information. | ||
# All elements of the project need to agree on this version. | ||
dafnyVersion=4.8.0 | ||
dafnyRuntimeJavaVersion=4.8.0 | ||
dafnyVersion=4.9.0 | ||
dafnyRuntimeJavaVersion=4.9.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# This file stores the top level dafny version information. | ||
# All elements of the project need to agree on this version. | ||
dafnyVersion=4.8.0 | ||
dafnyRuntimeJavaVersion=4.8.0 | ||
dafnyVersion=4.9.0 | ||
dafnyRuntimeJavaVersion=4.9.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
TestVectorsAwsCryptographicMaterialProviders/project.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# This file stores the top level dafny version information. | ||
# All elements of the project need to agree on this version. | ||
dafnyVersion=4.8.0 | ||
dafnyRuntimeJavaVersion=4.8.0 | ||
dafnyVersion=4.9.0 | ||
dafnyRuntimeJavaVersion=4.9.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,3 +36,5 @@ src/client.rs | |
src/aes_kdf_ctr.rs | ||
src/aes_gcm.rs | ||
Cargo.lock | ||
|
||
/*.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.