Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit d565f66

Browse files
committedFeb 10, 2025··
chore: add Rust generated test vectors
1 parent 2eb36b3 commit d565f66

File tree

3 files changed

+143257
-0
lines changed

3 files changed

+143257
-0
lines changed
 

‎TestVectors/dafny/DDBEncryption/src/DecryptManifest.dfy

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ module {:options "-functionSyntax:4"} DecryptManifest {
2121
import JsonConfig
2222
import ENC = AwsCryptographyDbEncryptionSdkDynamoDbItemEncryptorTypes
2323
import KeyVectors
24+
import OsLang
2425

2526
method OnePositiveTest(name : string, config : JSON, encrypted : JSON, plaintext : JSON, keys : KeyVectors.KeyVectorsClient)
2627
returns (output : Result<bool, string>)
@@ -110,6 +111,14 @@ module {:options "-functionSyntax:4"} DecryptManifest {
110111
}
111112
}
112113

114+
function LogFileName() : string
115+
{
116+
if OsLang.GetOsShort() == "Windows" && OsLang.GetLanguageShort() == "Dotnet" then
117+
"..\\..\\PerfLog.txt"
118+
else
119+
"../../PerfLog.txt"
120+
}
121+
113122
method Decrypt(inFile : string, keyVectors: KeyVectors.KeyVectorsClient)
114123
returns (output : Result<bool, string>)
115124
requires keyVectors.ValidState()
@@ -168,11 +177,13 @@ module {:options "-functionSyntax:4"} DecryptManifest {
168177
}
169178
}
170179

180+
var time := Time.GetAbsoluteTime();
171181
for i := 0 to |tests.value| {
172182
var obj := tests.value[i];
173183
:- Need(obj.1.Object?, "Value of test '" + obj.0 + "' must be an Object.");
174184
var _ :- OneTest(obj.0, obj.1, keyVectors);
175185
}
186+
Time.PrintTimeSinceLong(time, "DB-ESDK-TV-Decrypt " + inFile, Some(LogFileName()));
176187

177188
timeStamp :- expect Time.GetCurrentTimeStamp();
178189
print timeStamp + " Tests Complete.\n";

‎TestVectors/dafny/DDBEncryption/src/TestVectors.dfy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ module {:options "-functionSyntax:4"} DdbEncryptionTestVectors {
9191
var _ :- expect DecryptManifest.Decrypt("decrypt_java_33.json", keyVectors);
9292
var _ :- expect DecryptManifest.Decrypt("decrypt_dotnet_33a.json", keyVectors);
9393
var _ :- expect DecryptManifest.Decrypt("decrypt_java_33a.json", keyVectors);
94+
var _ :- expect DecryptManifest.Decrypt("decrypt_rust_38.json", keyVectors);
9495
var _ :- expect WriteManifest.Write("encrypt.json");
9596
var _ :- expect EncryptManifest.Encrypt("encrypt.json", "decrypt.json", "java", "3.3", keyVectors);
9697
var _ :- expect DecryptManifest.Decrypt("decrypt.json", keyVectors);

‎TestVectors/runtimes/java/decrypt_rust_38.json

Lines changed: 143245 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)
Please sign in to comment.