Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion TestVectors/dafny/DDBEncryption/src/DecryptManifest.dfy
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ module {:options "-functionSyntax:4"} DecryptManifest {
import opened StandardLibrary.UInt
import opened JSON.Values
import opened WriteManifest
import Time
import JSON.API
import JSON.Errors
import DdbItemJson
Expand Down Expand Up @@ -98,10 +99,15 @@ module {:options "-functionSyntax:4"} DecryptManifest {

method Decrypt(inFile : string) returns (output : Result<bool, string>)
{
print "Decrypt : ", inFile, "\n";
var timeStamp :- expect Time.GetCurrentTimeStamp();
print timeStamp + " Decrypt : ", inFile, "\n";
var configBv :- expect FileIO.ReadBytesFromFile(inFile);
var configBytes := BvToBytes(configBv);
timeStamp :- expect Time.GetCurrentTimeStamp();
print timeStamp + " File Read.\n";
var json :- expect API.Deserialize(configBytes);
timeStamp :- expect Time.GetCurrentTimeStamp();
print timeStamp + " JSON Parsed.\n";

:- Need(json.Object?, "Decrypt file must contain a JSON object.");
var keys : Option<string> := None;
Expand Down Expand Up @@ -151,6 +157,8 @@ module {:options "-functionSyntax:4"} DecryptManifest {
var _ :- OneTest(obj.0, obj.1);
}

timeStamp :- expect Time.GetCurrentTimeStamp();
print timeStamp + " Tests Complete.\n";
return Success(true);
}

Expand Down
11 changes: 10 additions & 1 deletion TestVectors/dafny/DDBEncryption/src/EncryptManifest.dfy
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ module {:options "-functionSyntax:4"} EncryptManifest {
import opened StandardLibrary.UInt
import opened JSON.Values
import opened WriteManifest
import Time
import JSON.API
import JSON.Errors
import opened DynamoDbEncryptionUtil
Expand Down Expand Up @@ -131,10 +132,15 @@ module {:options "-functionSyntax:4"} EncryptManifest {

method Encrypt(inFile : string, outFile : string, lang : string, version : string) returns (output : Result<bool, string>)
{
print "Encrypt : ", inFile, "\n";
var timeStamp :- expect Time.GetCurrentTimeStamp();
print timeStamp + " Encrypt : ", inFile, "\n";
var configBv :- expect FileIO.ReadBytesFromFile(inFile);
var configBytes := BvToBytes(configBv);
timeStamp :- expect Time.GetCurrentTimeStamp();
print timeStamp + " File Read.\n";
var json :- expect API.Deserialize(configBytes);
timeStamp :- expect Time.GetCurrentTimeStamp();
print timeStamp + " JSON Parsed.\n";

:- Need(json.Object?, "Encrypt file must contain a JSON object.");
var keys : Option<string> := None;
Expand Down Expand Up @@ -191,6 +197,9 @@ module {:options "-functionSyntax:4"} EncryptManifest {
var jsonBytes :- expect API.Serialize(final);
var jsonBv := BytesBv(jsonBytes);
var x :- expect FileIO.WriteBytesToFile(outFile, jsonBv);

timeStamp :- expect Time.GetCurrentTimeStamp();
print timeStamp + " Tests Complete.\n";
return Success(true);
}

Expand Down