Modules#
AES#
AES decryption functionality for bootloader.
Functions#
Initialize AES context.
Set AES key to use for encryption/decryption.
Process one block of data using AES-ECB.
Set up the AES-CTR context structure in CCM mode.
Process data using AES-CTR.
Function Documentation#
btl_initAesContext#
void btl_initAesContext (void * ctx)
Initialize AES context.
N/A | ctx | Context variable of type AesContext_t |
Wipes the AES context struct before use.
45
of file platform/bootloader/security/btl_security_aes.h
btl_setAesKey#
void btl_setAesKey (void * ctx, const uint8_t * key, unsigned int keySize, bool encryptNotDecrypt)
Set AES key to use for encryption/decryption.
N/A | ctx | Context variable of type AesContext_t |
N/A | key | Pointer to the AES key |
N/A | keySize | Size of the key in bits. Can be 128 or 256. |
N/A | encryptNotDecrypt | True if using this context for encryption, false if using for decryption. |
Initializes the AES context struct with the key to use.
58
of file platform/bootloader/security/btl_security_aes.h
btl_processAesBlock#
void btl_processAesBlock (void * ctx, uint8_t * inputBlock, uint8_t * outputBlock, bool encryptNotDecrypt)
Process one block of data using AES-ECB.
N/A | ctx | Context variable of type AesContext_t |
N/A | inputBlock | 128-bit (16 byte) buffer/block of data to be en/decrypted |
N/A | outputBlock | 128-bit (16 byte) buffer/block of data to put the result of the en/decryption in. |
N/A | encryptNotDecrypt | True for encryption, false for decryption |
Runs one block of data through the AES algorithm. In-place encryption/ decryption is supported.
76
of file platform/bootloader/security/btl_security_aes.h
btl_initAesCcm#
void btl_initAesCcm (void * ctx, uint8_t flags, uint8_t * nonce, uint32_t counter, const uint8_t * key, unsigned int keySize)
Set up the AES-CTR context structure in CCM mode.
N/A | ctx | Context variable of type AesCtrContext_t |
N/A | flags | CCM flags |
N/A | nonce | 12-byte nonce specific to this transmission |
N/A | counter | 3-byte running block counter |
N/A | key | Pointer to the AES key |
N/A | keySize | Size of the key in bits. Can be 128 or 256. |
Initializes an AES-CTR context struct with parameters used in AES-CCM mode. Data can then be en/decrypted using btl_processAesCtrData.
94
of file platform/bootloader/security/btl_security_aes.h
btl_processAesCtrData#
void btl_processAesCtrData (void * ctx, const uint8_t * input, uint8_t * output, size_t length)
Process data using AES-CTR.
N/A | ctx | Context variable of type AesCtrContext_t |
N/A | input | Raw data to en/decrypt |
N/A | output | Output buffer to put en/decrypted data |
N/A | length | Size (in bytes) of the input/output buffers |
Runs data for encryption or decryption (which uses the same function) through the AES-CTR algorithm. In-place encryption/decryption is supported.
112
of file platform/bootloader/security/btl_security_aes.h