@@ -15,18 +15,18 @@ func TestAESEncryptCBC(t *testing.T) {
1515 key256 := "abcdefghijklmnopabcdefghijklmnop" // 32 bytes = 256 bits
1616 ivInfo := "abcdefghijklmnop"
1717
18- cipherText128 , _ := AESEncrypt (plain , ModeCBC , key128 , ivInfo )
18+ cipherText128 , _ := AESEncrypt (plain , AESModeCBC , key128 , ivInfo )
1919 fmt .Printf ("Cipher text for AES-128-CBC: %s\n " , cipherText128 )
20- cipherText192 , _ := AESEncrypt (plain , ModeCBC , key192 , ivInfo )
20+ cipherText192 , _ := AESEncrypt (plain , AESModeCBC , key192 , ivInfo )
2121 fmt .Printf ("Cipher text for AES-192-CBC: %s\n " , cipherText192 )
22- cipherText256 , _ := AESEncrypt (plain , ModeCBC , key256 , ivInfo )
22+ cipherText256 , _ := AESEncrypt (plain , AESModeCBC , key256 , ivInfo )
2323 fmt .Printf ("Cipher text for AES-256-CBC: %s\n " , cipherText256 )
2424
25- decryptedText128 , _ := AESDecrypt (cipherText128 , ModeCBC , key128 , ivInfo )
25+ decryptedText128 , _ := AESDecrypt (cipherText128 , AESModeCBC , key128 , ivInfo )
2626 fmt .Printf ("Decrypted text for AES-128-CBC: %s\n " , decryptedText128 )
27- decryptedText192 , _ := AESDecrypt (cipherText192 , ModeCBC , key192 , ivInfo )
27+ decryptedText192 , _ := AESDecrypt (cipherText192 , AESModeCBC , key192 , ivInfo )
2828 fmt .Printf ("Decrypted text for AES-192-CBC: %s\n " , decryptedText192 )
29- decryptedText256 , _ := AESDecrypt (cipherText256 , ModeCBC , key256 , ivInfo )
29+ decryptedText256 , _ := AESDecrypt (cipherText256 , AESModeCBC , key256 , ivInfo )
3030 fmt .Printf ("Decrypted text for AES-256-CBC: %s\n " , decryptedText256 )
3131
3232 a .Equal (plain , decryptedText128 )
@@ -43,18 +43,18 @@ func TestAESEncryptCFB(t *testing.T) {
4343 key256 := "abcdefghijklmnopabcdefghijklmnop" // 32 bytes = 256 bits
4444 ivInfo := "abcdefghijklmnop"
4545
46- cipherText128 , _ := AESEncrypt (plain , ModeCFB , key128 , ivInfo )
46+ cipherText128 , _ := AESEncrypt (plain , AESModeCFB , key128 , ivInfo )
4747 fmt .Printf ("Cipher text for AES-128-CBC: %s\n " , cipherText128 )
48- cipherText192 , _ := AESEncrypt (plain , ModeCFB , key192 , ivInfo )
48+ cipherText192 , _ := AESEncrypt (plain , AESModeCFB , key192 , ivInfo )
4949 fmt .Printf ("Cipher text for AES-192-CBC: %s\n " , cipherText192 )
50- cipherText256 , _ := AESEncrypt (plain , ModeCFB , key256 , ivInfo )
50+ cipherText256 , _ := AESEncrypt (plain , AESModeCFB , key256 , ivInfo )
5151 fmt .Printf ("Cipher text for AES-256-CBC: %s\n " , cipherText256 )
5252
53- decryptedText128 , _ := AESDecrypt (cipherText128 , ModeCFB , key128 , ivInfo )
53+ decryptedText128 , _ := AESDecrypt (cipherText128 , AESModeCFB , key128 , ivInfo )
5454 fmt .Printf ("Decrypted text for AES-128-CBC: %s\n " , decryptedText128 )
55- decryptedText192 , _ := AESDecrypt (cipherText192 , ModeCFB , key192 , ivInfo )
55+ decryptedText192 , _ := AESDecrypt (cipherText192 , AESModeCFB , key192 , ivInfo )
5656 fmt .Printf ("Decrypted text for AES-192-CBC: %s\n " , decryptedText192 )
57- decryptedText256 , _ := AESDecrypt (cipherText256 , ModeCFB , key256 , ivInfo )
57+ decryptedText256 , _ := AESDecrypt (cipherText256 , AESModeCFB , key256 , ivInfo )
5858 fmt .Printf ("Decrypted text for AES-256-CBC: %s\n " , decryptedText256 )
5959
6060 a .Equal (plain , decryptedText128 )
@@ -71,18 +71,18 @@ func TestAESEncryptOFB(t *testing.T) {
7171 key256 := "abcdefghijklmnopabcdefghijklmnop" // 32 bytes = 256 bits
7272 ivInfo := "abcdefghijklmnop"
7373
74- cipherText128 , _ := AESEncrypt (plain , ModeOFB , key128 , ivInfo )
74+ cipherText128 , _ := AESEncrypt (plain , AESModeOFB , key128 , ivInfo )
7575 fmt .Printf ("Cipher text for AES-128-CBC: %s\n " , cipherText128 )
76- cipherText192 , _ := AESEncrypt (plain , ModeOFB , key192 , ivInfo )
76+ cipherText192 , _ := AESEncrypt (plain , AESModeOFB , key192 , ivInfo )
7777 fmt .Printf ("Cipher text for AES-192-CBC: %s\n " , cipherText192 )
78- cipherText256 , _ := AESEncrypt (plain , ModeOFB , key256 , ivInfo )
78+ cipherText256 , _ := AESEncrypt (plain , AESModeOFB , key256 , ivInfo )
7979 fmt .Printf ("Cipher text for AES-256-CBC: %s\n " , cipherText256 )
8080
81- decryptedText128 , _ := AESDecrypt (cipherText128 , ModeOFB , key128 , ivInfo )
81+ decryptedText128 , _ := AESDecrypt (cipherText128 , AESModeOFB , key128 , ivInfo )
8282 fmt .Printf ("Decrypted text for AES-128-CBC: %s\n " , decryptedText128 )
83- decryptedText192 , _ := AESDecrypt (cipherText192 , ModeOFB , key192 , ivInfo )
83+ decryptedText192 , _ := AESDecrypt (cipherText192 , AESModeOFB , key192 , ivInfo )
8484 fmt .Printf ("Decrypted text for AES-192-CBC: %s\n " , decryptedText192 )
85- decryptedText256 , _ := AESDecrypt (cipherText256 , ModeOFB , key256 , ivInfo )
85+ decryptedText256 , _ := AESDecrypt (cipherText256 , AESModeOFB , key256 , ivInfo )
8686 fmt .Printf ("Decrypted text for AES-256-CBC: %s\n " , decryptedText256 )
8787
8888 a .Equal (plain , decryptedText128 )
0 commit comments