ruuvi.drivers.c  ${PROJECT_VERSION}
Drivers for external sensors and peripherals on embedded systems.
Crypto functions

Functions for cryptography operations. More...

Files

file  ruuvi_interface_aes.h
 

Functions

rd_status_t ri_aes_ecb_128_encrypt (const uint8_t *const cleartext, uint8_t *const ciphertext, const uint8_t *const key, const size_t data_length)
 encrypt a block with AES ECB 128 encryption More...
 

Detailed Description

Functions for cryptography operations.

These functions are in drivers because they are supposed to utilize hardware implementation in underlying ICs. A software fallback might be implemented later.

Function Documentation

◆ ri_aes_ecb_128_encrypt()

rd_status_t ri_aes_ecb_128_encrypt ( const uint8_t *const  cleartext,
uint8_t *const  ciphertext,
const uint8_t *const  key,
const size_t  data_length 
)

encrypt a block with AES ECB 128 encryption

This call takes 16-byte divisible data as input and encrypts it with AES Electronic Codebook.

Parameters
[in]cleartextData to encrypt. Must have 16-byte divisible length.
[out]ciphertextEncryped data output
[in]keyKey to encrypt data with. Must be exactly 16 bytes.
[in]data_lengthLength of data. Input must equal output, must be 16 bytes divisible.
Return values
RD_SUCCESSdata was encrypted.
RD_ERROR_NULLif any pointer is NULL
RD_ERROR_INVALID_LENGTHif data length is not a multiple of 16