PebbleOS v4.47.0
Loading...
Searching...
No Matches
aes.h File Reference
#include <stddef.h>
#include <stdint.h>

Data Structures

struct  pbl_aes_ctx
 Expanded key. More...
 

Macros

#define PBL_AES_BLOCK_SIZE   16U
 Size of a block, in bytes.
 
#define PBL_AES_KEYSIZE_128   16U
 Size of an AES-128 key, in bytes.
 
#define PBL_AES_KEYSIZE_192   24U
 Size of an AES-192 key, in bytes.
 
#define PBL_AES_KEYSIZE_256   32U
 Size of an AES-256 key, in bytes.
 
#define PBL_AES_MAX_KEYLENGTH_U32   60U
 Most 32-bit words in a key schedule, for AES-256.
 

Functions

int pbl_aes_expandkey (struct pbl_aes_ctx *ctx, const uint8_t *key, size_t key_len)
 Expand a key.
 
void pbl_aes_encrypt (const struct pbl_aes_ctx *ctx, uint8_t out[PBL_AES_BLOCK_SIZE], const uint8_t in[PBL_AES_BLOCK_SIZE])
 Encrypt a block.
 
void pbl_aes_decrypt (const struct pbl_aes_ctx *ctx, uint8_t out[PBL_AES_BLOCK_SIZE], const uint8_t in[PBL_AES_BLOCK_SIZE])
 Decrypt a block.
 
int pbl_aes_ecb_encrypt (const struct pbl_aes_ctx *ctx, uint8_t *out, const uint8_t *in, size_t len)
 Encrypt blocks in ECB mode.
 
int pbl_aes_ecb_decrypt (const struct pbl_aes_ctx *ctx, uint8_t *out, const uint8_t *in, size_t len)
 Decrypt blocks in ECB mode.