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

Known-answer tests of the hardware accelerators. More...

Enumerations

enum  pbl_crypto_alg { PBL_CRYPTO_ALG_SHA256 , PBL_CRYPTO_ALG_AES }
 Algorithm. More...
 

Functions

int pbl_crypto_selftest (enum pbl_crypto_alg alg)
 Check the accelerator of an algorithm.
 

Detailed Description

Known-answer tests of the hardware accelerators.

Feeds the FIPS 180-4 and FIPS 197 examples through the hardware hooks (see Crypto). An algorithm that fails stays in software from then on. Built with CONFIG_CRYPTO_SELFTEST, which also checks each algorithm before its first hardware use.

Enumeration Type Documentation

◆ pbl_crypto_alg

Algorithm.

Enumerator
PBL_CRYPTO_ALG_SHA256 

SHA-256.

PBL_CRYPTO_ALG_AES 

AES, every key size, both ways.

Function Documentation

◆ pbl_crypto_selftest()

int pbl_crypto_selftest ( enum pbl_crypto_alg  alg)

Check the accelerator of an algorithm.

Parameters
algAlgorithm.
Return values
0if the accelerator returned the expected results.
-ENODEVif there is no accelerator for alg, or it is not ready.
-EIOif it returned a wrong result; the algorithm stays in software from then on.