@@ -15,7 +15,7 @@ var m_AESEncryption struct {
1515}
1616
1717func (CompanionStruct_Default___ ) AESDecryptExtern (algo AwsCryptographyPrimitivesTypes.AES__GCM , key dafny.Sequence ,
18- cipherText dafny.Sequence , authTag dafny.Sequence , iv dafny.Sequence , aad dafny.Sequence ) Wrappers.Result {
18+ cipherText dafny.Sequence , authTag dafny.Sequence , iv dafny.Sequence , aad dafny.Sequence ) Wrappers.Result {
1919
2020 keyBytes := dafny .ToByteArray (key )
2121 cipherTextBytes := dafny .ToByteArray (cipherText )
@@ -45,25 +45,22 @@ func (CompanionStruct_Default___) AESDecryptExtern(algo AwsCryptographyPrimitive
4545 dafny .SeqOfChars ([]dafny.Char (err .Error ())... )))
4646 }
4747
48- if algo .Is_AES__GCM () {
49- gcm , err := cipher .NewGCM (block )
50- if err != nil {
51- return Wrappers .Companion_Result_ .Create_Failure_ (AwsCryptographyPrimitivesTypes .Companion_Error_ .Create_AwsCryptographicPrimitivesError_ (
52- dafny .SeqOfChars ([]dafny.Char (err .Error ())... )))
53- }
48+ gcm , err := cipher .NewGCM (block )
49+ if err != nil {
50+ return Wrappers .Companion_Result_ .Create_Failure_ (AwsCryptographyPrimitivesTypes .Companion_Error_ .Create_AwsCryptographicPrimitivesError_ (
51+ dafny .SeqOfChars ([]dafny.Char (err .Error ())... )))
52+ }
5453
55- plaintext , err := gcm .Open (nil , ivBytes , append (cipherTextBytes , authTagBytes ... ), aadBytes )
56- if err != nil {
57- return Wrappers .Companion_Result_ .Create_Failure_ (AwsCryptographyPrimitivesTypes .Companion_Error_ .Create_AwsCryptographicPrimitivesError_ (
58- dafny .SeqOfChars ([]dafny.Char (err .Error ())... )))
59- }
60- return Wrappers .Companion_Result_ .Create_Success_ (dafny .SeqOfBytes (plaintext ))
54+ plaintext , err := gcm .Open (nil , ivBytes , append (cipherTextBytes , authTagBytes ... ), aadBytes )
55+ if err != nil {
56+ return Wrappers .Companion_Result_ .Create_Failure_ (AwsCryptographyPrimitivesTypes .Companion_Error_ .Create_AwsCryptographicPrimitivesError_ (
57+ dafny .SeqOfChars ([]dafny.Char (err .Error ())... )))
6158 }
62- return Wrappers .Companion_Result_ .Create_Failure_ ( false )
59+ return Wrappers .Companion_Result_ .Create_Success_ ( dafny . SeqOfBytes ( plaintext ) )
6360}
6461
6562func (CompanionStruct_Default___ ) AESEncryptExtern (algo AwsCryptographyPrimitivesTypes.AES__GCM , iv dafny.Sequence ,
66- key dafny.Sequence , msg dafny.Sequence , aad dafny.Sequence ) Wrappers.Result {
63+ key dafny.Sequence , msg dafny.Sequence , aad dafny.Sequence ) Wrappers.Result {
6764
6865 keyBytes := dafny .ToByteArray (key )
6966 ivBytes := dafny .ToByteArray (iv )
0 commit comments