From 6118d8a554a677ae533ee586362bcfed80607512 Mon Sep 17 00:00:00 2001 From: Andy Jewell Date: Thu, 13 Feb 2025 10:39:00 -0500 Subject: [PATCH 1/2] chore(dafny): add timing support --- .../dafny/DDBEncryption/src/DecryptManifest.dfy | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/TestVectors/dafny/DDBEncryption/src/DecryptManifest.dfy b/TestVectors/dafny/DDBEncryption/src/DecryptManifest.dfy index 5ee680b4e..61a325668 100644 --- a/TestVectors/dafny/DDBEncryption/src/DecryptManifest.dfy +++ b/TestVectors/dafny/DDBEncryption/src/DecryptManifest.dfy @@ -21,6 +21,7 @@ module {:options "-functionSyntax:4"} DecryptManifest { import JsonConfig import ENC = AwsCryptographyDbEncryptionSdkDynamoDbItemEncryptorTypes import KeyVectors + import OsLang method OnePositiveTest(name : string, config : JSON, encrypted : JSON, plaintext : JSON, keys : KeyVectors.KeyVectorsClient) returns (output : Result) @@ -110,6 +111,14 @@ module {:options "-functionSyntax:4"} DecryptManifest { } } + function LogFileName() : string + { + if OsLang.GetOsShort() == "Windows" && OsLang.GetLanguageShort() == "Dotnet" then + "..\\..\\PerfLog.txt" + else + "../../PerfLog.txt" + } + method Decrypt(inFile : string, keyVectors: KeyVectors.KeyVectorsClient) returns (output : Result) requires keyVectors.ValidState() @@ -168,11 +177,13 @@ module {:options "-functionSyntax:4"} DecryptManifest { } } + var time := Time.GetAbsoluteTime(); for i := 0 to |tests.value| { var obj := tests.value[i]; :- Need(obj.1.Object?, "Value of test '" + obj.0 + "' must be an Object."); var _ :- OneTest(obj.0, obj.1, keyVectors); } + Time.PrintTimeSinceLong(time, "DB-ESDK-TV-Decrypt-" + inFile, Some(LogFileName())); timeStamp :- expect Time.GetCurrentTimeStamp(); print timeStamp + " Tests Complete.\n"; From 13bb0c8081b749a788d8d60468e9d50204c66688 Mon Sep 17 00:00:00 2001 From: Andy Jewell Date: Thu, 13 Feb 2025 10:39:31 -0500 Subject: [PATCH 2/2] chore(dafny): add timing support --- submodules/MaterialProviders | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submodules/MaterialProviders b/submodules/MaterialProviders index 70e580991..c503da828 160000 --- a/submodules/MaterialProviders +++ b/submodules/MaterialProviders @@ -1 +1 @@ -Subproject commit 70e580991678387ce897a286c4f7f449aa616785 +Subproject commit c503da8285a510b25ace619b2cc27ffa247840ee