Crypto drivers accelerate the crypto subsystem with a hardware hash or cipher engine. They are optional: without one, the subsystem computes everything in software.
A driver sits under CONFIG_CRYPTO_HW, which the application enables, and
implements the functions in include/pbl/drivers/crypto.h for what its
hardware covers, selecting the matching hidden symbol:
Symbol |
Functions |
|---|---|
|
|
|
|
The SHA-256 function compresses whole 64-byte blocks into a running chaining value; the AES functions take the raw key and a run of 16-byte blocks. Each returns how many blocks it processed.
Returning fewer blocks than given is always allowed: the subsystem finishes
in software. A driver returns 0 whenever the hardware cannot be used, such as
before its device is ready, so callers never see a failure. Drivers do not
check their own results: the subsystem’s
self-test does. The subsystem only calls a driver for runs of at least
CONFIG_CRYPTO_SHA256_HW_MIN_LEN or CONFIG_CRYPTO_AES_HW_MIN_LEN bytes.
The API reference documents the interface.
Generated from PebbleOS f4926c952. This page is maintained in the pebbleos repository: docs/drivers/crypto/index.md.