Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: initial commit of ESDK TestVectors #678

Open
wants to merge 122 commits into
base: mainline
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
122 commits
Select commit Hold shift + click to select a range
1c4b133
feat(support Rust): Add Rust Encryption SDK
RitvikKapila Sep 27, 2024
983bff1
fix Makefile; update externs
RitvikKapila Oct 1, 2024
83592af
add kms rsa example
RitvikKapila Oct 7, 2024
f54add3
add examples dir
RitvikKapila Oct 7, 2024
2c6d90d
add kms, discovery keyring example
RitvikKapila Oct 7, 2024
4f26918
fix keyring examples
RitvikKapila Oct 8, 2024
0323ea6
Merge branch 'mainline' into rkapila/rust
RitvikKapila Oct 8, 2024
213fe56
add discovery examples
RitvikKapila Oct 8, 2024
380b161
add
RitvikKapila Oct 8, 2024
d1c1d88
add
RitvikKapila Oct 9, 2024
484adee
add raw rsa keyring
RitvikKapila Oct 9, 2024
d9fb8f5
add hkeyring examples
RitvikKapila Oct 10, 2024
baa3fbe
renaming
RitvikKapila Oct 10, 2024
e9f5ccf
add client supplier and custom cmm examples
RitvikKapila Oct 14, 2024
d6ea973
Merge branch 'mainline' into rkapila/rust
RitvikKapila Oct 14, 2024
c13aa44
feat(support Rust): Add Rust Encryption SDK
RitvikKapila Oct 14, 2024
e0f242f
minor fixes; add misc examples
RitvikKapila Oct 15, 2024
bfb7c0c
update examples/main.rs
RitvikKapila Oct 15, 2024
2c8e891
update dependencies
RitvikKapila Oct 15, 2024
bc4ced8
fix
RitvikKapila Oct 16, 2024
b103530
add daily ci
RitvikKapila Oct 16, 2024
ef20390
add ci
RitvikKapila Oct 16, 2024
9748fd9
fix
RitvikKapila Oct 16, 2024
6eceaee
try
RitvikKapila Oct 16, 2024
0deaad8
m
RitvikKapila Oct 16, 2024
77f1344
m
RitvikKapila Oct 16, 2024
ecd4d37
m
RitvikKapila Oct 16, 2024
7d9b007
m
RitvikKapila Oct 16, 2024
2727bb5
m
RitvikKapila Oct 16, 2024
6feecc5
m
RitvikKapila Oct 16, 2024
75bb9ac
m
RitvikKapila Oct 16, 2024
5d8c7a1
fix
RitvikKapila Oct 16, 2024
6085144
fix
RitvikKapila Oct 16, 2024
30c80fa
fix
RitvikKapila Oct 16, 2024
ca93d44
fix
RitvikKapila Oct 16, 2024
3d04d91
fix
RitvikKapila Oct 16, 2024
bea5e99
m
RitvikKapila Oct 16, 2024
2e4f666
m
RitvikKapila Oct 16, 2024
a37e746
fix
RitvikKapila Oct 16, 2024
3a05ca2
fix
RitvikKapila Oct 16, 2024
33b5cb0
fix
RitvikKapila Oct 16, 2024
7d012fd
fix
RitvikKapila Oct 16, 2024
eee329c
fix
RitvikKapila Oct 17, 2024
573f51d
update
RitvikKapila Oct 17, 2024
eb3bb32
update
RitvikKapila Oct 17, 2024
445a44a
update
RitvikKapila Oct 17, 2024
743753f
fix
RitvikKapila Oct 17, 2024
383cda8
fix
RitvikKapila Oct 17, 2024
3edc4fd
fix
RitvikKapila Oct 17, 2024
760aaef
fix
RitvikKapila Oct 17, 2024
b40f500
fix
RitvikKapila Oct 17, 2024
374cfd0
add dafny env var
RitvikKapila Oct 17, 2024
207234c
add dafny env var
RitvikKapila Oct 17, 2024
ba9161c
try
RitvikKapila Oct 17, 2024
39d710a
fix version
RitvikKapila Oct 17, 2024
9b73ded
separate windows and unix polymorph
RitvikKapila Oct 17, 2024
8b8890d
revert
RitvikKapila Oct 17, 2024
57b9f8c
add shared cache example
RitvikKapila Oct 18, 2024
83af517
m
RitvikKapila Oct 18, 2024
33b5e81
m
RitvikKapila Oct 20, 2024
4b01aa1
bump Dafny / Smithy Dafny / MPL to HEAD
RitvikKapila Oct 22, 2024
c034f7c
initial commit of ESDK TestVectors
seebees Nov 2, 2023
5a24dfe
chore: add dafny test vector framework
josecorella Aug 28, 2024
1a5bb94
repoly
josecorella Aug 30, 2024
ad0c7c3
add patch
josecorella Aug 30, 2024
b8a02f7
update
josecorella Aug 30, 2024
4a8f70b
update gha
josecorella Aug 30, 2024
1f5d2f0
m
josecorella Sep 20, 2024
bccbd12
m
josecorella Sep 30, 2024
6d704b5
update
josecorella Sep 30, 2024
979e869
manually fix patch
josecorella Sep 30, 2024
619b16d
progress
josecorella Sep 30, 2024
d2df52e
good progress
josecorella Oct 8, 2024
067dd2c
better progress
josecorella Oct 10, 2024
319df1d
update primitives dafny name
josecorella Oct 22, 2024
c636f6a
Merge branch 'mainline' into jocorell/dafny-test-vectors
RitvikKapila Oct 22, 2024
d52071c
remove smithy-dafny fetch from workflows; bump mpl to HEAD
RitvikKapila Oct 22, 2024
6782bc3
bump dafny in workflows to 4.8.1; minor fix
RitvikKapila Oct 22, 2024
e4de10f
chore(examples): Add examples for Rust Encryption SDK (#685)
RitvikKapila Oct 22, 2024
aa36238
resolve conflicts
RitvikKapila Oct 22, 2024
16ccb4a
fix no ec in default cmm
josecorella Oct 22, 2024
a869fdf
regenerate code
josecorella Oct 22, 2024
d86bb32
patch
josecorella Oct 22, 2024
8b0d02b
f
josecorella Oct 22, 2024
c555231
update patch
josecorella Oct 22, 2024
078e1a6
successfully build esdk-dafny to java
josecorella Oct 22, 2024
b997aff
try
RitvikKapila Oct 22, 2024
95d0425
rename AtomicPrimitives
RitvikKapila Oct 22, 2024
135e6bc
fix
RitvikKapila Oct 22, 2024
c346e9e
fix
RitvikKapila Oct 22, 2024
2487f7f
resolve conflicts
RitvikKapila Oct 22, 2024
db291e2
bump mpl
RitvikKapila Oct 23, 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
5fc0f8b
Merge branch 'rkapila/rust-reviewed' into jocorell/dafny-test-vectors
RitvikKapila Oct 29, 2024
fb3351b
more progress
josecorella Oct 22, 2024
553742f
rewrite manifest to play well with mpl test-vectors
josecorella Oct 25, 2024
5b38632
more updates
josecorella Oct 28, 2024
c3a0141
build decrypt vector from encrypt test success
josecorella Oct 28, 2024
402d4c7
start decrypt vectors
josecorella Oct 30, 2024
4cfd906
java roundtrip works
josecorella Oct 30, 2024
0c4c889
add generated python
josecorella Oct 31, 2024
80b76bd
fix net test vectors
josecorella Oct 31, 2024
3d9f7ce
update
josecorella Oct 31, 2024
3483cb8
clean up not yet supported languages
josecorella Oct 31, 2024
16386aa
sed
josecorella Oct 31, 2024
69103b8
a
josecorella Nov 1, 2024
3c52ee4
add patch
josecorella Nov 1, 2024
41d4c79
m
josecorella Nov 1, 2024
e9af83d
update
josecorella Nov 1, 2024
1da206c
repoly java
josecorella Nov 1, 2024
9f9b6ca
repoly java and add pathc
josecorella Nov 1, 2024
15377f3
a
josecorella Nov 1, 2024
6d453b3
test in ci
josecorella Nov 1, 2024
d8a408e
sed
josecorella Nov 4, 2024
8d9b8f5
Merge branch 'mainline' into jocorell/dafny-test-vectors
josecorella Nov 4, 2024
9995bcd
add cfn policy
josecorella Nov 4, 2024
aa9776d
macos-13
josecorella Nov 4, 2024
9b1b2c7
a
josecorella Nov 4, 2024
0f14fcb
update
josecorella Nov 4, 2024
a64d028
add sha
josecorella Nov 4, 2024
64d610c
a
josecorella Nov 4, 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
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ runs:
uses: gradle/gradle-build-action@v2
with:
arguments: :codegen-client:pTML :codegen-core:pTML :rust-runtime:pTML
build-root-directory: smithy-dafny/smithy-dafny-codegen-modules/smithy-rs
build-root-directory: mpl/smithy-dafny/smithy-dafny-codegen-modules/smithy-rs

- name: Install smithy-dafny-codegen Python dependencies locally
uses: gradle/gradle-build-action@v2
with:
arguments: :smithy-python-codegen:pTML
build-root-directory: smithy-dafny/codegen/smithy-dafny-codegen-modules/smithy-python/codegen
build-root-directory: mpl/smithy-dafny/codegen/smithy-dafny-codegen-modules/smithy-python/codegen
7 changes: 7 additions & 0 deletions .github/actions/polymorph_codegen/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,13 @@ runs:
run: |
make polymorph_dotnet ${{ steps.dependencies.outputs.PROJECT_DEPENDENCIES }}

# TODO: Uncomment when checking in polymorph_rust code
# - name: Regenerate Rust code using smithy-dafny
# working-directory: ./${{ inputs.library }}
# shell: bash
# run: |
# make polymorph_rust ${{ steps.dependencies.outputs.PROJECT_DEPENDENCIES }}

- name: Check regenerated code against commited code
# Composite action inputs seem to not actually support booleans properly for some reason
if: inputs.diff-generated-code == 'true'
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/dafny_interop_test_vector_net.yml
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,6 @@ jobs:
run: |
git submodule update --init libraries
git submodule update --init --recursive mpl
git submodule update --init smithy-dafny

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
Expand Down
13 changes: 9 additions & 4 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.0'
dafny: '4.8.1'
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.0'
dafny: '4.8.1'
# daily-ci-java:
# if: github.event_name != 'schedule' || github.repository_owner == 'aws'
# uses: ./.github/workflows/library_java_tests.yml
Expand All @@ -27,10 +27,15 @@ jobs:
if: github.event_name != 'schedule' || github.repository_owner == 'aws'
uses: ./.github/workflows/library_net_tests.yml
with:
dafny: '4.8.0'
dafny: '4.8.1'
daily-ci-rust:
if: github.event_name != 'schedule' || github.repository_owner == 'aws'
uses: ./.github/workflows/library_rust_tests.yml
with:
dafny: '4.8.1'

daily-ci-interop-tests:
if: github.event_name != 'schedule' || github.repository_owner == 'aws'
uses: ./.github/workflows/library_interop_tests.yml
with:
dafny: '4.8.0'
dafny: '4.8.1'
1 change: 0 additions & 1 deletion .github/workflows/library_codegen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ jobs:
# it to verify the Dafny code. Instead we manually pull the submodules we DO need.
- run: git submodule update --init libraries
- run: git submodule update --init --recursive mpl
- run: git submodule update --init --recursive smithy-dafny

# Only used to format generated code
# and to translate version strings such as "nightly-latest"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/library_dafny_verification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ jobs:
strategy:
matrix:
library: [
AwsEncryptionSDK
AwsEncryptionSDK,
TestVectors
]
os: [ macos-13 ]
runs-on: ${{ matrix.os }}
Expand All @@ -36,7 +37,6 @@ jobs:
run: |
git submodule update --init libraries
git submodule update --init --recursive mpl
git submodule update --init smithy-dafny

# dafny-reportgenerator requires next6
# but only 7.0 is installed on macos-13-large
Expand Down
216 changes: 216 additions & 0 deletions .github/workflows/library_interop_test_vectors.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,216 @@
# This workflow performs interoperability tests across the supported runtimes of the ESDK Dafny
name: Library Interoperability Dafny TestVectors

on:
workflow_call:
inputs:
dafny:
description: "The Dafny version to use"
required: true
type: string
regenerate-code:
description: "Regenerate code using smithy-dafny"
required: false
default: false
type: boolean

jobs:
generateEncryptVectors:
strategy:
matrix:
library: [TestVectors]
os: [
# https://taskei.amazon.dev/tasks/CrypTool-5283
# windows-latest,
ubuntu-latest,
macos-13,
]
language: [java, net]
# https://taskei.amazon.dev/tasks/CrypTool-5284
dotnet-version: ["6.0.x"]
runs-on: ${{ matrix.os }}
permissions:
id-token: write
contents: read

steps:
- name: Support longpaths on Git checkout
run: |
git config --global core.longpaths true

- 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 --recursive mpl

# Set up runtimes
- name: Setup .NET Core SDK ${{ matrix.dotnet-version }}
if: matrix.language == 'net'
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ matrix.dotnet-version }}

- name: Setup Java 17
if: matrix.language == 'java'
uses: actions/setup-java@v3
with:
distribution: "corretto"
java-version: 17

- name: Setup Dafny
uses: dafny-lang/[email protected]
with:
dafny-version: ${{ inputs.dafny }}

- name: Regenerate code using smithy-dafny if necessary
if: ${{ inputs.regenerate-code }}
uses: ./.github/actions/polymorph_codegen
with:
dafny: ${{ inputs.dafny }}
library: ${{ matrix.library }}
diff-generated-code: false

# Build implementation for each runtime
- name: Build ${{ matrix.library }} implementation in Java
if: matrix.language == 'java'
shell: bash
working-directory: ./${{ matrix.library }}
run: |
# This works because `node` is installed by default on GHA runners
CORES=$(node -e 'console.log(os.cpus().length)')
make build_java CORES=$CORES

- name: Build ${{ matrix.library }} implementation in .NET
if: matrix.language == 'net'
shell: bash
working-directory: ./${{ matrix.library }}
run: |
# This works because `node` is installed by default on GHA runners
CORES=$(node -e 'console.log(os.cpus().length)')
make transpile_net

- 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 }}

- name: Create Encrypt Manifests
working-directory: ./${{ matrix.library }}
run: make test_encrypt_vectors_${{ matrix.language }}

- name: Upload Encrypt Manifest and keys.json files
uses: actions/upload-artifact@v4
with:
name: ${{matrix.os}}_vector_artifact_${{matrix.language}}_${{github.sha}}
path: |
./${{matrix.library}}/runtimes/${{matrix.language}}/*.json
./${{matrix.library}}/runtimes/${{matrix.language}}/plaintexts
./${{matrix.library}}/runtimes/${{matrix.language}}/ciphertexts

testInteroperablity:
needs: generateEncryptVectors
strategy:
matrix:
library: [TestVectors]
os: [
# https://taskei.amazon.dev/tasks/CrypTool-5283
# windows-latest,
ubuntu-latest,
macos-13,
]
encrypting_language: [java, net]
decrypting_language: [java, net]
# https://taskei.amazon.dev/tasks/CrypTool-5284
dotnet-version: ["6.0.x"]
runs-on: ${{ matrix.os }}
permissions:
id-token: write
contents: read

steps:
- 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
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.
- run: git submodule update --init libraries
- run: git submodule update --init --recursive mpl

- name: Setup .NET Core SDK ${{ matrix.dotnet-version }}
if: matrix.decrypting_language == 'net'
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ matrix.dotnet-version }}

- name: Setup Java 17
if: matrix.decrypting_language == 'java'
uses: actions/setup-java@v3
with:
distribution: "corretto"
java-version: 17

- name: Setup Dafny
uses: dafny-lang/[email protected]
with:
dafny-version: ${{ inputs.dafny }}

- name: Regenerate code using smithy-dafny if necessary
if: ${{ inputs.regenerate-code }}
uses: ./.github/actions/polymorph_codegen
with:
dafny: ${{ inputs.dafny }}
library: ${{ matrix.library }}
diff-generated-code: false

# Build implementation for each runtime
- name: Build ${{ matrix.library }} implementation in Java
if: matrix.decrypting_language == 'java'
working-directory: ./${{ matrix.library }}
shell: bash
run: |
# This works because `node` is installed by default on GHA runners
CORES=$(node -e 'console.log(os.cpus().length)')
make build_java CORES=$CORES

- name: Build ${{ matrix.library }} implementation in .NET
if: matrix.decrypting_language == 'net'
working-directory: ./${{ matrix.library }}
shell: bash
run: |
# This works because `node` is installed by default on GHA runners
CORES=$(node -e 'console.log(os.cpus().length)')
make transpile_net

- name: Download Encrypt Manifest Artifact
uses: actions/download-artifact@v4
with:
name: ${{matrix.os}}_vector_artifact_${{matrix.encrypting_language}}_${{github.sha}}
path: ./${{matrix.library}}/runtimes/${{matrix.decrypting_language}}

- name: Decrypt Encrypt Manifest
working-directory: ./${{ matrix.library }}
run: make test_decrypt_encrypt_vectors_${{matrix.decrypting_language}}

5 changes: 2 additions & 3 deletions .github/workflows/library_interop_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ jobs:
run: |
git submodule update --init libraries
git submodule update --init --recursive mpl
git submodule update --init smithy-dafny

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
Expand Down Expand Up @@ -144,7 +143,7 @@ jobs:
run: |
git submodule update --init libraries
git submodule update --init --recursive mpl
git submodule update --init smithy-dafny


- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
Expand Down Expand Up @@ -246,7 +245,7 @@ jobs:
run: |
git submodule update --init libraries
git submodule update --init --recursive mpl
git submodule update --init smithy-dafny


- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/library_java_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ jobs:
run: |
git submodule update --init libraries
git submodule update --init --recursive mpl
git submodule update --init smithy-dafny

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/library_net_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ jobs:
run: |
git submodule update --init libraries
git submodule update --init --recursive mpl
git submodule update --init smithy-dafny

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
Expand Down
Loading
Loading