Class desfire::esp32::crypto_3k3des
Defined in File crypto_impl.hpp
Inheritance Relationships
Base Type
public desfire::crypto_3k3des_base
(Class desfire::crypto_3k3des_base)
Class Documentation
-
class crypto_3k3des : public desfire::crypto_3k3des_base
ESP32-specific implementation of crypto_3k3des_base. Uses MbedTLS or WolfSSL depending on whether
LIBSPOOKY_USE_MBEDTLS
orLIBSPOOKY_USE_WOLFSSL
is set.Public Functions
-
virtual void do_crypto(range<std::uint8_t*> data, range<std::uint8_t*> iv, crypto_operation op) override
Performs a supported cryptographic operation on the given data and initialization vector.
- Parameters:
data – Input data (plaintext for crypto_operation::encrypt and crypto_operation::mac, and ciphertext for crypto_operation::decrypt). This data is modified and upon exit will contain the resulting ciphertext or plaintext, respectively, therefore this must be already padded and resized to the next multiple of the block size according to cipher_type.
iv – Initialization vector to use during the cryptographic operation. This must the the right size depending on the block size of this implementation’s cipher_type, and will be overwritten by the cryptographic algorithm (i.e. upon exit it is transformed).
op – Cryptographic operation to perform.
-
crypto_3k3des()
-
~crypto_3k3des() override
Protected Functions
-
virtual void setup_primitives_with_key(range<std::uint8_t const*> key) override
Subclasses should implement this instead of setup_with_key, to the same effect.
This method is called by the custom implementation of setup_with_key provided in this class, right before key derivation is performed, with the same parameters.
- Parameters:
key – Range of bytes containing the key to use for the following operations. This is specified as a range on raw bytes for convenience, as the underlying cryptographic functions are likely low level.
-
virtual void do_crypto(range<std::uint8_t*> data, range<std::uint8_t*> iv, crypto_operation op) override