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

chore(Test Vector): Add interop test for Go #706

Closed
wants to merge 22 commits into from

Conversation

rishav-karanjit
Copy link
Member

@rishav-karanjit rishav-karanjit commented Dec 5, 2024

Issue #, if available:

Description of changes:

  • Adds/Updates makefile, externs and go.mod file to run test vectors.

How to test this?

  • There are two ways to test it. Use either (i) or (ii).

    1. Run make test_go
    2. Run following commands:
      • make test_generate_vectors_go
      • make test_encrypt_vectors_go
      • make test_decrypt_encrypt_vectors_go

Squash/merge commit message, if applicable:

chore(Test Vector): Add interop test for Go

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

@rishav-karanjit rishav-karanjit changed the title Go test vectors chore(Test Vector): Add interop test for Go Dec 9, 2024
Comment on lines +171 to +173
find .. -name "shim.go" | xargs sed -i "" 's/(_static \*CompanionStruct_Default___)//g'
find .. -name "api_client.go" -exec sed -i '' 's|"github.com/aws/aws-encryption-sdk/ESDK"|ESDK "github.com/aws/aws-encryption-sdk/EncryptionSdk"|g' {} \;
find .. -name "api_client.go" -exec sed -i '' 's|"github.com/aws/aws-encryption-sdk/testvectors/ESDK"|ESDK "github.com/aws/aws-encryption-sdk/testvectors"|g' {} \;
Copy link
Contributor

Choose a reason for hiding this comment

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

Make sure these work on all the platforms.

@@ -37,7 +37,7 @@ module {:options "-functionSyntax:4"} WriteEsdkJsonManifests {
function EncryptionContextToJson(key: string, m: mplTypes.EncryptionContext)
: Result<seq<(string, JSON)>, string>
{
var keys := SortedSets.ComputeSetToSequence(m.Keys);
var keys := SortedSets.ComputeSetToOrderedSequence2(m.Keys, (a, b) => a < b);
Copy link
Contributor

Choose a reason for hiding this comment

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

Why this change?

Copy link
Member Author

Choose a reason for hiding this comment

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

Recently ComputeSetToSequence is made method in MPL because the results are not deterministic and in Dafny we cannot call a method from a function. Our MPL submodule contains this change.

Copy link
Member Author

Choose a reason for hiding this comment

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

Also, on recent commit to merge Rust work to main, this function was updated in mainline: https://github.com/aws/aws-encryption-sdk-dafny/blob/mainline/TestVectors/dafny/TestVectors/src/WriteEsdkJsonManifests.dfy#L40

@rishav-karanjit
Copy link
Member Author

Closing this as I merged this to main.

@rishav-karanjit rishav-karanjit deleted the Go-testVectors branch January 3, 2025 20:48
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