10Duke Enterprise C++ SDK
Loading...
Searching...
No Matches
LibcryptoAESCipher Class Reference

#include <LibcryptoAESCipher.h>

Detailed Description

Libcrypto implementation of AES GCM cipher.

Inheritance diagram for LibcryptoAESCipher:
tenduke::crypto::aes::AESGCMCipher tenduke::crypto::aes::AESCipher tenduke::crypto::Cipher

Public Member Functions

 LibcryptoAESCipher (const ::tenduke::crypto::aes::libcrypto::LibcryptoAESKey &key)
 LibcryptoAESCipher (const LibcryptoAESCipher &)=delete
 LibcryptoAESCipher (LibcryptoAESCipher &&other) noexcept=default
LibcryptoAESCipheroperator= (const LibcryptoAESCipher &)=delete
LibcryptoAESCipheroperator= (LibcryptoAESCipher &&other) noexcept=default
void decryptData (const ::tenduke::utl::DataSpan &ciphertext, ::tenduke::utl::DataSink &plaintext) const override
 Utility method to decrypt data.
void encryptData (const ::tenduke::utl::DataSpan &plaintext, ::tenduke::utl::DataSink &ciphertext) const override
 Utility method to encrypt data.
void encryptData (const ::tenduke::utl::DataSpan &nonce, const ::tenduke::utl::DataSpan &plaintext, ::tenduke::utl::DataSink &ciphertext) const override
 Encrypts data using the provided nonce.
Public Member Functions inherited from tenduke::crypto::aes::AESCipher
 AESCipher (const AESCipher &)=delete
AESCipheroperator= (const AESCipher &)=delete
 AESCipher (AESCipher &&other) noexcept=default
AESCipheroperator= (AESCipher &&other) noexcept=default
Public Member Functions inherited from tenduke::crypto::Cipher
 Cipher (const Cipher &)=delete
Cipher & operator= (const Cipher &)=delete
 Cipher (Cipher &&other) noexcept=default
Cipher & operator= (Cipher &&other) noexcept=default

Member Function Documentation

◆ decryptData()

void tenduke::crypto::libcrypto::LibcryptoAESCipher::decryptData ( const ::tenduke::utl::DataSpan & ciphertext,
::tenduke::utl::DataSink & plaintext ) const
overridevirtual

Utility method to decrypt data.

This method decrypts the provided data, encrypted by ::encryptData() method.

Parameters
ciphertextthe encrypted data
plaintextthe decrypted data

Implements tenduke::crypto::Cipher.

◆ encryptData() [1/2]

Encrypts data using the provided nonce.

Writes [nonce][ciphertext][authentication tag] to ciphertext.

Parameters
noncethe nonce (IV) to use; must be GCM_NONCE_SIZE bytes
plaintextdata to encrypt
ciphertextsink that receives the output

Implements tenduke::crypto::aes::AESGCMCipher.

◆ encryptData() [2/2]

Utility method to encrypt data.

This method encrypts the provided data and outputs a binary data object which contains:

  • nonce / IV (if used by the cipher), automatically generated
  • the ciphertext
  • the authentication tag (if used by the cipher)
Parameters
plaintextthe data to encrypt
ciphertextthe encrypted data

Reimplemented from tenduke::crypto::aes::AESGCMCipher.


The documentation for this class was generated from the following files:
  • core/services/default/src/crypto/symmetric/aes/LibcryptoAESCipher.h
  • core/services/default/src/crypto/symmetric/aes/LibcryptoAESCipher.cpp