feat(native-rust): test vectors, misc legacy mpl stuff#926
Closed
lucasmcdonald3 wants to merge 9 commits into
Closed
feat(native-rust): test vectors, misc legacy mpl stuff#926lucasmcdonald3 wants to merge 9 commits into
lucasmcdonald3 wants to merge 9 commits into
Conversation
added 2 commits
June 15, 2026 16:16
There was a problem hiding this comment.
Pull request overview
Adds a native-Rust test-vector harness (encrypt/decrypt manifest parsing + execution) plus legacy aws_mpl_legacy compatibility conversions, along with a CLI entrypoint and integration tests intended to run against committed interop vectors.
Changes:
- Introduces a
test_vectorsmodule with manifest parsing, vector execution, and result reporting for encrypt/decrypt workflows. - Adds a
test_vectorCLI binary to run encrypt/decrypt harness operations from the command line. - Adds legacy conversion helpers (
legacy_compat.rs) and initial keystore scaffolding for hierarchical keyring vectors.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 13 comments.
Show a summary per file
| File | Description |
|---|---|
| esdk/tests/test_vectors_integration.rs | Feature-gated integration tests for running the harness against fixture directories. |
| esdk/src/test_vectors.rs | Module wiring + re-exports for the test-vector harness. |
| esdk/src/test_vectors/run_tests.rs | Public encrypt_test_vectors / decrypt_test_vectors entrypoints and manifest validation. |
| esdk/src/test_vectors/do_encrypt.rs | Encrypt-runner that generates ciphertexts + a decrypt-manifest JSON output. |
| esdk/src/test_vectors/do_decrypt.rs | Decrypt-runner that builds keyrings/CMMs from manifests and verifies plaintext outputs. |
| esdk/src/test_vectors/parse_keys.rs | Parses keys manifest (v1/v2) and decodes key materials/EDKs. |
| esdk/src/test_vectors/parse_encrypt.rs | Parses encrypt/decrypt scenario manifests (v1/v5) into typed test cases. |
| esdk/src/test_vectors/types.rs | Data structures representing keys, scenarios, key descriptions, and test result counters. |
| esdk/src/test_vectors/static_keystore.rs | Static keystore implementation (for hierarchical keyring vectors). |
| esdk/src/test_vectors/legacy_static_keystore.rs | Stub legacy keystore client implementation (currently todo!() methods). |
| esdk/src/legacy_compat.rs | Legacy type conversion layer between Dafny-generated types and suites/material structs. |
| esdk/src/bin/test_vector/main.rs | CLI wrapper around the harness entrypoints. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+41
to
+43
| if manifest_version != 5 && manifest_version != 1 { | ||
| anyhow::bail!("Decrypt manifest version was {manifest_version} instead of 5"); | ||
| } |
Comment on lines
+27
to
+33
| #[tokio::test(flavor = "multi_thread")] | ||
| async fn test_rust_encrypt_decrypt() { | ||
| let manifest_path = "test_vectors_rust"; | ||
| encrypt_test_vectors(manifest_path, manifest_path, "") | ||
| .await | ||
| .expect("Rust encrypt test vectors must pass"); | ||
| decrypt_test_vectors(manifest_path, "decrypt-manifest.json", "") |
Comment on lines
+476
to
+479
| .kms_key_id(key.key_id.clone()) | ||
| .public_key(key.material.clone()) | ||
| .encryption_algorithm(get_kms_enc_alg(&keydesc.encryption_algorithm)) | ||
| .kms_client(kms.clone()) |
Comment on lines
+18
to
+46
| impl aws_mpl_legacy::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::IKeyStoreClient for StaticKeyStore { | ||
| fn GetKeyStoreInfo( | ||
| &self, | ||
| ) -> Arc<Result<Arc<GetKeyStoreInfoOutput>, Arc<Error>>> | ||
| {todo!()} | ||
| fn CreateKeyStore( | ||
| &self, | ||
| input: &Arc<CreateKeyStoreInput>, | ||
| ) -> Arc<Result<Arc<CreateKeyStoreOutput>, Arc<Error>>>{todo!()} | ||
| fn CreateKey( | ||
| &self, | ||
| input: &Arc<CreateKeyInput>, | ||
| ) -> Arc<Result<Arc<CreateKeyOutput>, Arc<Error>>>{todo!()} | ||
| fn VersionKey( | ||
| &self, | ||
| input: &Arc<VersionKeyInput>, | ||
| ) -> Arc<Result<Arc<VersionKeyOutput>, Arc<Error>>>{todo!()} | ||
| fn GetActiveBranchKey( | ||
| &self, | ||
| input: &Arc<GetActiveBranchKeyInput>, | ||
| ) -> Arc<Result<Arc<GetActiveBranchKeyOutput>, Arc<Error>>>{todo!()} | ||
| fn GetBranchKeyVersion( | ||
| &self, | ||
| input: &Arc<GetBranchKeyVersionInput>, | ||
| ) -> Arc<Result<Arc<GetBranchKeyVersionOutput>, Arc<Error>>>{todo!()} | ||
| fn GetBeaconKey( | ||
| &self, | ||
| input: &Arc<GetBeaconKeyInput>, | ||
| ) -> Arc<Result<Arc<GetBeaconKeyOutput>, Arc<Error>>>{todo!()} |
added 5 commits
July 1, 2026 10:35
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue #, if available:
Description of changes: Adds the native-Rust test-vector harness and legacy-MPL compatibility shims (
legacy_compat.rs,test_vectors.rs,test_vectors/,bin/test_vector/main.rs,tests/test_vectors_integration.rs).Note I'm planning to remove the legacy MPL and maybe these test vectors before launch, so not sure how much attention to give to this code.
Note: CI does not run on this PR. This branch is scoped for focused review and intentionally omits test helpers, scaffolding, and other supporting code. Full code including helpers and working tests lives on the
aws-crypto-rust/unreviewedbranch.If you want more context or to run the tests, see
aws-crypto-rust/unreviewed: https://github.com/aws/aws-encryption-sdk/tree/aws-crypto-rust/unreviewedThis is a miscellaneous (non-spec) support PR for interop test-vector execution and legacy compatibility; it does not map to a single data-format spec section.
Squash/merge commit message, if applicable:
feat(native-rust): test vectors and legacy compatibilityBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.