Skip to content

feat(native-rust): test vectors, misc legacy mpl stuff#926

Closed
lucasmcdonald3 wants to merge 9 commits into
aws-crypto-rust/mainlinefrom
aws-crypto-rust/test-vectors-review
Closed

feat(native-rust): test vectors, misc legacy mpl stuff#926
lucasmcdonald3 wants to merge 9 commits into
aws-crypto-rust/mainlinefrom
aws-crypto-rust/test-vectors-review

Conversation

@lucasmcdonald3

@lucasmcdonald3 lucasmcdonald3 commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

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/unreviewed branch.

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/unreviewed

This 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 compatibility

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@lucasmcdonald3 lucasmcdonald3 changed the title Native Rust: test vectors + legacy compatibility feat(native-rust): test vectors and legacy compatibility Jun 16, 2026
@lucasmcdonald3 lucasmcdonald3 requested a review from Copilot June 30, 2026 19:11

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_vectors module with manifest parsing, vector execution, and result reporting for encrypt/decrypt workflows.
  • Adds a test_vector CLI 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 thread esdk/src/test_vectors/do_encrypt.rs Outdated
Comment thread esdk/src/test_vectors/do_encrypt.rs
Comment thread esdk/src/test_vectors/do_decrypt.rs Outdated
Comment thread esdk/src/test_vectors/do_decrypt.rs Outdated
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 thread esdk/src/test_vectors/do_decrypt.rs Outdated
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 thread esdk/src/test_vectors/do_decrypt.rs Outdated
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!()}
@lucasmcdonald3 lucasmcdonald3 changed the title feat(native-rust): test vectors and legacy compatibility feat(native-rust): test vectors, misc legacy mpl stuff Jul 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants