File tree 1 file changed +8
-5
lines changed
1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change 11
11
#include " meta/cfb.h"
12
12
#include " meta/ofb.h"
13
13
#include " meta/ctr.h"
14
+ #include " meta/gcm.h"
14
15
15
16
int main ()
16
17
{
@@ -20,15 +21,17 @@ int main()
20
21
std::string message = " 00112233445566778899aabbccddeeff" ;
21
22
std::string message_ll = " 00112233445566778899aabbccddeeff00112233445566778899aabbccddeeff" ;
22
23
24
+ std::string auth_data = " 00000000000000000000000000000000" ;
25
+ std::string auth_tag{};
26
+
23
27
AES aes (AES_key_length::AES_128);
24
28
aes.generate_keys (key_128);
25
- CBC<AES> aes_cbc (aes);
26
-
27
- std::cout << " META" << std::endl;
29
+ GCM<AES> aes_gcm (aes);
30
+
28
31
std::cout << message_ll << std::endl;
29
- aes_cbc .encrypt (message_ll);
32
+ aes_gcm .encrypt (message_ll, auth_data, auth_tag );
30
33
std::cout << message_ll << std::endl;
31
- aes_cbc .decrypt (message_ll);
34
+ aes_gcm .decrypt (message_ll, auth_data, auth_tag );
32
35
std::cout << message_ll << std::endl;
33
36
34
37
return 0 ;
You can’t perform that action at this time.
0 commit comments