ProtoCore v0.0.1
Deterministic, zero-heap network stack for embedded targets
Loading...
Searching...
No Matches
PC_CRYPTO_HOT Namespace Reference

Classes

struct  AesBlk
 
struct  Chacha20Work
 
struct  ChachapolyWork
 
struct  Group14Ctx
 
struct  HmacWork
 
struct  Poly1305Work
 

Functions

void seq_nonce (uint32_t seqnr, uint8_t iv[8])
 
int ecdsa_rng (void *ctx, unsigned char *buf, size_t len)
 
uint32_t rd_le32 (const uint8_t *p)
 
uint32_t rotl32 (uint32_t v, int c)
 
void chacha_core (Chacha20Work *w, uint8_t out[64])
 
void blk_init (AesBlk *b, const uint8_t key[16])
 
void blk_enc (AesBlk *b, const uint8_t in[16], uint8_t out[16])
 
void blk_free (AesBlk *b)
 
void build_key_block (const uint8_t *key, size_t key_len, uint8_t block[64], uint8_t pad_byte, uint8_t scratch[64])
 
void build_key_block (const uint8_t *key, size_t key_len, uint8_t block[PC_SHA512_BLOCK_LEN], uint8_t pad_byte)
 
void wr_le32 (uint8_t *p, uint32_t v)
 
void poly_block (uint32_t h[5], const uint32_t r[5], const uint32_t sr[5], const uint8_t blk[16], uint32_t hibit)
 

Variables

const uint32_t SIGMA0 = 0x61707865
 
const uint32_t SIGMA1 = 0x3320646e
 
const uint32_t SIGMA2 = 0x79622d32
 
const uint32_t SIGMA3 = 0x6b206574
 

Function Documentation

◆ seq_nonce()

void PC_CRYPTO_HOT::seq_nonce ( uint32_t  seqnr,
uint8_t  iv[8] 
)

Definition at line 22 of file chachapoly.cpp.

References seq_nonce().

Referenced by seq_nonce().

◆ ecdsa_rng()

int PC_CRYPTO_HOT::ecdsa_rng ( void *  ctx,
unsigned char *  buf,
size_t  len 
)

Definition at line 90 of file ecdsa.cpp.

References ecdsa_rng().

Referenced by ecdsa_rng().

◆ rd_le32()

uint32_t PC_CRYPTO_HOT::rd_le32 ( const uint8_t *  p)

Definition at line 31 of file chacha20.cpp.

References rd_le32().

Referenced by poly_block(), and rd_le32().

◆ rotl32()

uint32_t PC_CRYPTO_HOT::rotl32 ( uint32_t  v,
int  c 
)

Definition at line 35 of file chacha20.cpp.

References rotl32().

Referenced by rotl32().

◆ chacha_core()

void PC_CRYPTO_HOT::chacha_core ( Chacha20Work w,
uint8_t  out[64] 
)

Definition at line 68 of file chacha20.cpp.

References chacha_core(), QR, PC_CRYPTO_HOT::Chacha20Work::st, and PC_CRYPTO_HOT::Chacha20Work::x.

Referenced by chacha_core().

◆ blk_init()

void PC_CRYPTO_HOT::blk_init ( AesBlk b,
const uint8_t  key[16] 
)
inline

Definition at line 35 of file aes_cmac.cpp.

References blk_init(), and PC_CRYPTO_HOT::AesBlk::c.

Referenced by blk_init().

◆ blk_enc()

void PC_CRYPTO_HOT::blk_enc ( AesBlk b,
const uint8_t  in[16],
uint8_t  out[16] 
)
inline

Definition at line 40 of file aes_cmac.cpp.

References blk_enc(), and PC_CRYPTO_HOT::AesBlk::c.

Referenced by blk_enc().

◆ blk_free()

void PC_CRYPTO_HOT::blk_free ( AesBlk b)
inline

Definition at line 44 of file aes_cmac.cpp.

References blk_free(), and PC_CRYPTO_HOT::AesBlk::c.

Referenced by blk_free().

◆ build_key_block() [1/2]

void PC_CRYPTO_HOT::build_key_block ( const uint8_t *  key,
size_t  key_len,
uint8_t  block[64],
uint8_t  pad_byte,
uint8_t  scratch[64] 
)

Definition at line 53 of file hmac_sha256.cpp.

References build_key_block(), and pc_sha256().

Referenced by build_key_block(), and build_key_block().

◆ build_key_block() [2/2]

void PC_CRYPTO_HOT::build_key_block ( const uint8_t *  key,
size_t  key_len,
uint8_t  block[PC_SHA512_BLOCK_LEN],
uint8_t  pad_byte 
)

Definition at line 19 of file hmac_sha512.cpp.

References build_key_block(), pc_sha512(), and PC_SHA512_BLOCK_LEN.

◆ wr_le32()

void PC_CRYPTO_HOT::wr_le32 ( uint8_t *  p,
uint32_t  v 
)

Definition at line 31 of file poly1305.cpp.

References wr_le32().

Referenced by wr_le32().

◆ poly_block()

void PC_CRYPTO_HOT::poly_block ( uint32_t  h[5],
const uint32_t  r[5],
const uint32_t  sr[5],
const uint8_t  blk[16],
uint32_t  hibit 
)

Definition at line 41 of file poly1305.cpp.

References poly_block(), and rd_le32().

Referenced by poly_block().

Variable Documentation

◆ SIGMA0

const uint32_t PC_CRYPTO_HOT::SIGMA0 = 0x61707865

Definition at line 96 of file chacha20.cpp.

◆ SIGMA1

const uint32_t PC_CRYPTO_HOT::SIGMA1 = 0x3320646e

Definition at line 97 of file chacha20.cpp.

◆ SIGMA2

const uint32_t PC_CRYPTO_HOT::SIGMA2 = 0x79622d32

Definition at line 98 of file chacha20.cpp.

◆ SIGMA3

const uint32_t PC_CRYPTO_HOT::SIGMA3 = 0x6b206574

Definition at line 99 of file chacha20.cpp.