PebbleOS v4.47.0
Loading...
Searching...
No Matches
Crypto

Hardware hash and cipher acceleration used by Cryptography. More...

Modules

 SiFli SF32LB AES and hash accelerator
 AES and hash units of the SF32LB52 crypto engine, behind the pbl_crypto_hw_*() functions.
 

Functions

size_t pbl_crypto_hw_sha256_blocks (uint32_t state[8], const void *data, size_t nblocks)
 Accelerated SHA-256 compression.
 
size_t pbl_crypto_hw_aes_ecb_encrypt (const uint8_t *key, size_t key_len, uint8_t *out, const uint8_t *in, size_t nblocks)
 Accelerated AES encryption in ECB mode.
 
size_t pbl_crypto_hw_aes_ecb_decrypt (const uint8_t *key, size_t key_len, uint8_t *out, const uint8_t *in, size_t nblocks)
 Accelerated AES decryption in ECB mode.
 

Detailed Description

Hardware hash and cipher acceleration used by Cryptography.

SHA-256 is provided by drivers that select CRYPTO_SHA256_HW_ACCEL, AES by drivers that select CRYPTO_AES_HW_ACCEL.

Each function processes a prefix of the blocks and returns how many. A driver processes none when the hardware cannot take the request, before it is ready or for any other reason; the crypto subsystem processes whatever is left in software.

Function Documentation

◆ pbl_crypto_hw_aes_ecb_decrypt()

size_t pbl_crypto_hw_aes_ecb_decrypt ( const uint8_t *  key,
size_t  key_len,
uint8_t *  out,
const uint8_t *  in,
size_t  nblocks 
)

Accelerated AES decryption in ECB mode.

Parameters
keyKey.
key_lenLength of key in bytes: 16, 24 or 32.
[out]outPlaintext, which may be in.
inCiphertext.
nblocksNumber of 16-byte blocks in in.
Returns
Number of blocks processed.

◆ pbl_crypto_hw_aes_ecb_encrypt()

size_t pbl_crypto_hw_aes_ecb_encrypt ( const uint8_t *  key,
size_t  key_len,
uint8_t *  out,
const uint8_t *  in,
size_t  nblocks 
)

Accelerated AES encryption in ECB mode.

Parameters
keyKey.
key_lenLength of key in bytes: 16, 24 or 32.
[out]outCiphertext, which may be in.
inPlaintext.
nblocksNumber of 16-byte blocks in in.
Returns
Number of blocks processed.

◆ pbl_crypto_hw_sha256_blocks()

size_t pbl_crypto_hw_sha256_blocks ( uint32_t  state[8],
const void *  data,
size_t  nblocks 
)

Accelerated SHA-256 compression.

Compresses blocks into a running chaining value, without padding.

Parameters
[in,out]stateChaining value, H0 to H7.
dataBlocks to hash.
nblocksNumber of 64-byte blocks in data.
Returns
Number of blocks processed; state reflects exactly those.