Expand description
RustCrypto digest and Mac trait implementations backed by embassy-crypto-driver unitraits.
This crate wraps the hardware-agnostic hash and HMAC unitraits from
embassy-crypto-driver with the standard RustCrypto digest traits,
so existing RustCrypto code can use embassy-registered crypto drivers
without modification.
§Digest Usage
ⓘ
use embassy_crypto::Sha256;
use digest::Digest;
let mut hasher = Sha256::new();
hasher.update(b"hello world");
let result = hasher.finalize();§HMAC Usage
ⓘ
use embassy_crypto::HmacSha256;
use digest::Mac;
let mut mac = HmacSha256::new_from_slice(b"my key").unwrap();
mac.update(b"hello world");
let result = mac.finalize();§Linkage
At link time exactly one crate in the dependency tree must register a driver
using the embassy_crypto_*_impl! and embassy_crypto_hmac_*_impl! macros
from embassy-crypto-driver. If zero or multiple drivers are registered,
linking will fail.
Re-exports§
pub use digest;
Structs§
- Hmac
Sha1 - RustCrypto
Macimplementation backed by the embassy-crypto-driver HMAC unitrait. - Hmac
Sha224 - RustCrypto
Macimplementation backed by the embassy-crypto-driver HMAC unitrait. - Hmac
Sha256 - RustCrypto
Macimplementation backed by the embassy-crypto-driver HMAC unitrait. - Hmac
Sha384 - RustCrypto
Macimplementation backed by the embassy-crypto-driver HMAC unitrait. - Hmac
Sha512 - RustCrypto
Macimplementation backed by the embassy-crypto-driver HMAC unitrait. - Hmac
Sha512_ 224 - RustCrypto
Macimplementation backed by the embassy-crypto-driver HMAC unitrait. - Hmac
Sha512_ 256 - RustCrypto
Macimplementation backed by the embassy-crypto-driver HMAC unitrait. - Md5
- RustCrypto
Digestimplementation backed by the embassy-crypto-driver unitrait. - Sha1
- RustCrypto
Digestimplementation backed by the embassy-crypto-driver unitrait. - Sha224
- RustCrypto
Digestimplementation backed by the embassy-crypto-driver unitrait. - Sha256
- RustCrypto
Digestimplementation backed by the embassy-crypto-driver unitrait. - Sha384
- RustCrypto
Digestimplementation backed by the embassy-crypto-driver unitrait. - Sha512
- RustCrypto
Digestimplementation backed by the embassy-crypto-driver unitrait. - Sha512_
224 - RustCrypto
Digestimplementation backed by the embassy-crypto-driver unitrait. - Sha512_
256 - RustCrypto
Digestimplementation backed by the embassy-crypto-driver unitrait.