Skip to content

Commit

Permalink
Add: aes128-gcm decryption
Browse files Browse the repository at this point in the history
  • Loading branch information
Kraemii committed May 3, 2022
1 parent a3dd09a commit b7fb98a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
7 changes: 7 additions & 0 deletions nasl/nasl_crypto2.c
Original file line number Diff line number Diff line change
Expand Up @@ -1910,6 +1910,13 @@ nasl_aes128_gcm_encrypt (lex_ctxt *lexic)
NASL_ENCRYPT);
}

tree_cell *
nasl_aes128_gcm_decrypt (lex_ctxt *lexic)
{
return crypt_data (lexic, GCRY_CIPHER_AES128, GCRY_CIPHER_MODE_GCM,
NASL_DECRYPT);
}

tree_cell *
nasl_aes256_gcm_encrypt (lex_ctxt *lexic)
{
Expand Down
3 changes: 3 additions & 0 deletions nasl/nasl_crypto2.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ nasl_des_ede_cbc_encrypt (lex_ctxt *lexic);
tree_cell *
nasl_aes128_gcm_encrypt (lex_ctxt *lexic);

tree_cell *
nasl_aes128_gcm_decrypt (lex_ctxt *lexic);

tree_cell *
nasl_aes256_gcm_encrypt (lex_ctxt *lexic);

Expand Down
1 change: 1 addition & 0 deletions nasl/nasl_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@ static init_func libfuncs[] = {
{"aes128_ctr_encrypt", nasl_aes128_ctr_encrypt},
{"aes256_ctr_encrypt", nasl_aes256_ctr_encrypt},
{"aes128_gcm_encrypt", nasl_aes128_gcm_encrypt},
{"aes128_gcm_decrypt", nasl_aes128_gcm_decrypt},
{"aes256_gcm_encrypt", nasl_aes256_gcm_encrypt},
{"aes128_ccm_encrypt", nasl_aes128_ccm_encrypt},
{"aes128_ccm_decrypt", nasl_aes128_ccm_decrypt},
Expand Down

0 comments on commit b7fb98a

Please sign in to comment.