Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
c13aa44
feat(support Rust): Add Rust Encryption SDK
RitvikKapila Oct 14, 2024
e4de10f
chore(examples): Add examples for Rust Encryption SDK (#685)
RitvikKapila Oct 22, 2024
a0d261a
Merge branch 'mainline' into rkapila/rust-reviewed
RitvikKapila Oct 23, 2024
d694399
chore(dafny-rust): setup and test check-in polymorph rust code (comme…
RitvikKapila Oct 29, 2024
e4e6294
Merge branch mainline into feature/rust-support
RitvikKapila Nov 14, 2024
a4935a6
feat(TestVectors): Add Rust support (#693)
RitvikKapila Nov 14, 2024
0656fec
chore: update for latest MPL and smithy-dafny
ajewellamz Nov 15, 2024
067609c
m
ajewellamz Nov 15, 2024
3fdf6d6
-
ajewellamz Nov 15, 2024
b017876
m
ajewellamz Nov 15, 2024
ef994cc
m
ajewellamz Nov 15, 2024
8aa31cb
m
ajewellamz Nov 15, 2024
a2557bd
m
ajewellamz Nov 15, 2024
63256e3
Merge pull request #696 from aws/ajewell/rust-smithy-update
ajewellamz Nov 15, 2024
2b07e87
Merge branch 'mainline' into rkapila/rust-reviewed
RitvikKapila Nov 17, 2024
4aa5367
chore(dafny): fix version (#697)
RitvikKapila Nov 18, 2024
ff2f121
chore: simplify by using global aes_kdf_ctr.rs
ajewellamz Nov 18, 2024
847a02f
Merge pull request #699 from aws/ajewell/simplify
ajewellamz Nov 18, 2024
71fc04d
fix(test-vec-dir): fix make test_rust in TestVectors (#700)
RitvikKapila Nov 19, 2024
6cc271e
Merge branch 'mainline' into rkapila/rust-reviewed
RitvikKapila Nov 19, 2024
4786b94
chore: bump mpl
ajewellamz Nov 21, 2024
94675c3
m
ajewellamz Nov 21, 2024
792fd2a
Merge pull request #701 from aws/ajewell/mpl-update
ajewellamz Nov 21, 2024
01022a8
chore(docs): Update docs for Rust; add TRANSPILE_TESTS_IN_RUST to Mak…
RitvikKapila Nov 22, 2024
d5b7218
chore(dafny;mpl): bump dafny to 4.9.0; mpl to 1.8.0 in java build.gra…
RitvikKapila Dec 2, 2024
2e76dd7
chore(examples): Raw ECDH and KMS ECDH (#692)
RitvikKapila Dec 4, 2024
6c1286f
chore(rust-fixes): final fixes before merge to main (#705)
RitvikKapila Dec 5, 2024
5395860
update cargo.toml
RitvikKapila Dec 5, 2024
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
10 changes: 5 additions & 5 deletions .github/workflows/daily_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ jobs:
if: github.event_name != 'schedule' || github.repository_owner == 'aws'
uses: ./.github/workflows/library_codegen.yml
with:
dafny: '4.8.1'
dafny: '4.9.0'
daily-ci-verification:
# Don't run the cron builds on forks
if: github.event_name != 'schedule' || github.repository_owner == 'aws'
uses: ./.github/workflows/library_dafny_verification.yml
with:
dafny: '4.8.1'
dafny: '4.9.0'
# daily-ci-java:
# if: github.event_name != 'schedule' || github.repository_owner == 'aws'
# uses: ./.github/workflows/library_java_tests.yml
Expand All @@ -27,15 +27,15 @@ jobs:
if: github.event_name != 'schedule' || github.repository_owner == 'aws'
uses: ./.github/workflows/library_net_tests.yml
with:
dafny: '4.8.1'
dafny: '4.9.0'
daily-ci-rust:
if: github.event_name != 'schedule' || github.repository_owner == 'aws'
uses: ./.github/workflows/library_rust_tests.yml
with:
dafny: '4.8.1'
dafny: '4.9.0'

daily-ci-interop-tests:
if: github.event_name != 'schedule' || github.repository_owner == 'aws'
uses: ./.github/workflows/library_interop_tests.yml
with:
dafny: '4.8.1'
dafny: '4.9.0'
122 changes: 107 additions & 15 deletions .github/workflows/library_interop_test_vectors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
ubuntu-latest,
macos-13,
]
language: [java, net]
language: [java, net, rust]
# https://taskei.amazon.dev/tasks/CrypTool-5284
dotnet-version: ["6.0.x"]
runs-on: ${{ matrix.os }}
Expand All @@ -38,6 +38,14 @@ jobs:
run: |
git config --global core.longpaths true

# TestVectors will call KMS
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
with:
aws-region: us-west-2
role-to-assume: arn:aws:iam::370957321024:role/GitHub-CI-Public-ESDK-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.
Expand All @@ -51,15 +59,40 @@ 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"
java-version: 17

- name: Setup Rust Toolchain for GitHub CI
if: matrix.language == 'rust'
uses: actions-rust-lang/setup-rust-toolchain@v1.10.1
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|#&|' mpl/smithy-dafny/SmithyDafnyMakefile.mk
else
sed -i 's|rustfmt --edition 2021 runtimes/rust/src/implementation_from_dafny.rs|#&|' mpl/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 }}

Expand Down Expand Up @@ -89,21 +122,33 @@ jobs:
# This works because `node` is installed by default on GHA runners
CORES=$(node -e 'console.log(os.cpus().length)')
make transpile_net


- 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 CORES=$CORES

- name: Setup gradle
if: matrix.language == 'java'
uses: gradle/gradle-build-action@v2
with:
gradle-version: 7.2

# TestVectors will call KMS
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
with:
aws-region: us-west-2
role-to-assume: arn:aws:iam::370957321024:role/GitHub-CI-Public-ESDK-Dafny-Role-us-west-2
role-session-name: InterOpTests

- name: Create Manifests
working-directory: ./${{ matrix.library }}
run: make test_generate_vectors_${{ matrix.language }}
Expand Down Expand Up @@ -132,8 +177,8 @@ jobs:
ubuntu-latest,
macos-13,
]
encrypting_language: [java, net]
decrypting_language: [java, net]
encrypting_language: [java, net, rust]
decrypting_language: [java, net, rust]
# https://taskei.amazon.dev/tasks/CrypTool-5284
dotnet-version: ["6.0.x"]
runs-on: ${{ matrix.os }}
Expand All @@ -145,6 +190,7 @@ jobs:
- name: Support longpaths on Git checkout
run: |
git config --global core.longpaths true

# TestVectors will call KMS
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
Expand All @@ -159,19 +205,45 @@ jobs:
- run: git submodule update --init libraries
- run: git submodule update --init --recursive mpl

# Set up runtimes
- name: Setup .NET Core SDK ${{ matrix.dotnet-version }}
if: matrix.decrypting_language == 'net'
uses: actions/setup-dotnet@v3
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"
java-version: 17

- name: Setup Rust Toolchain for GitHub CI
if: matrix.decrypting_language == 'rust'
uses: actions-rust-lang/setup-rust-toolchain@v1.10.1
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|#&|' mpl/smithy-dafny/SmithyDafnyMakefile.mk
else
sed -i 's|rustfmt --edition 2021 runtimes/rust/src/implementation_from_dafny.rs|#&|' mpl/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/setup-dafny-action@v1.6.1
with:
Expand Down Expand Up @@ -204,6 +276,26 @@ jobs:
CORES=$(node -e 'console.log(os.cpus().length)')
make transpile_net

- 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 CORES=$CORES

- name: Download Encrypt Manifest Artifact
uses: actions/download-artifact@v4
with:
Expand Down
16 changes: 6 additions & 10 deletions .github/workflows/library_rust_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,17 @@ jobs:
os: [
windows-latest,
ubuntu-latest,
macos-12,
macos-13,
]
runs-on: ${{ matrix.os }}
permissions:
id-token: write
contents: read
env:
# TODO: do we need this here?
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_NOLOGO: 1
steps:
- name: Support longpaths on Git checkout
run: |
git config --global core.longpaths true
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Init Submodules
shell: bash
run: |
Expand All @@ -58,11 +54,10 @@ jobs:
# - name: Rustfmt Check
# uses: actions-rust-lang/rustfmt@v1

# TODO: Use setup-dafny-actions with correct version when Dafny releases 4.8.2
- name: Setup Dafny
uses: dafny-lang/setup-dafny-action@v1.7.0
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
Expand All @@ -81,6 +76,7 @@ jobs:
java-version: "17"

- name: Setup NASM for Windows (aws-lc-sys)
if: matrix.os == 'windows-latest'
uses: ilammy/setup-nasm@v1

- name: Install Smithy-Dafny codegen dependencies
Expand Down Expand Up @@ -108,7 +104,7 @@ jobs:
run: |
# This works because `node` is installed by default on GHA runners
CORES=$(node -e 'console.log(os.cpus().length)')
make transpile_rust TRANSPILE_TESTS_IN_RUST=1 CORES=$CORES
make transpile_rust CORES=$CORES

# Remove Rust hacks once Dafny fixes this
- name: Update implementation_from_dafny.rs to add deps
Expand Down Expand Up @@ -139,4 +135,4 @@ jobs:
working-directory: ./AwsEncryptionSDK/runtimes/rust
shell: bash
run: |
cargo test --examples
cargo test --release --examples
16 changes: 10 additions & 6 deletions .github/workflows/pull.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,32 @@ jobs:
pr-ci-codegen:
uses: ./.github/workflows/library_codegen.yml
with:
dafny: '4.8.1'
dafny: '4.9.0'
pr-ci-verification:
uses: ./.github/workflows/library_dafny_verification.yml
with:
dafny: '4.8.1'
dafny: '4.9.0'
# pr-ci-java:
# uses: ./.github/workflows/library_java_tests.yml
# with:
# dafny: '4.2.0'
pr-ci-net:
uses: ./.github/workflows/library_net_tests.yml
with:
dafny: '4.8.1'
dafny: '4.9.0'
pr-ci-rust:
uses: ./.github/workflows/library_rust_tests.yml
with:
dafny: '4.9.0'
pr-test-vectors:
uses: ./.github/workflows/library_interop_tests.yml
with:
dafny: '4.8.1'
dafny: '4.9.0'
pr-dafny-test-vectors:
uses: ./.github/workflows/library_interop_test_vectors.yml
with:
dafny: '4.8.1'
dafny: '4.9.0'
pr-dafny-legacy-test-vectors:
uses: ./.github/workflows/library_legacy_interop_test_vectors.yml
with:
dafny: '4.8.1'
dafny: '4.9.0'
10 changes: 5 additions & 5 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,24 @@ jobs:
pr-ci-codegen:
uses: ./.github/workflows/library_codegen.yml
with:
dafny: '4.8.1'
dafny: '4.9.0'
push-ci-verification:
uses: ./.github/workflows/library_dafny_verification.yml
with:
dafny: '4.8.1'
dafny: '4.9.0'
# push-ci-java:
# uses: ./.github/workflows/library_java_tests.yml
# with:
# dafny: '4.2.0'
push-ci-net:
uses: ./.github/workflows/library_net_tests.yml
with:
dafny: '4.8.1'
dafny: '4.9.0'
push-ci-rust:
uses: ./.github/workflows/library_rust_tests.yml
with:
dafny: '4.8.1'
dafny: '4.9.0'
pr-test-vectors:
uses: ./.github/workflows/library_interop_tests.yml
with:
dafny: '4.8.1'
dafny: '4.9.0'
Loading
Loading