rigel
is a minimal implementation of HMAC with SHA512, which is optimized for use
with embedded devices. rigel
minimizes the amount of allocations made, while
still upholding performance speed.
You can read more about these optimizations here.
rigel
requires Rust nightly.
This library has at no point received any formal cryptographic/security audit. It should be used at own risk.
One-shot API: ```rust extern crate rigel;
let mac = rigel::hmacsha512("Secret key".asbytes(), "Message".as_bytes());
assert!(rigel::verify(&mac, "Secret key".asbytes(), "Message".asbytes()));
```
Streaming API: ```rust extern crate rigel;
let mut mac = rigel::init("Secret key".asbytes()); mac.update("Message".asbytes()); let res = mac.finalize(); assert!(mac.verify(&res, "Secret key".asbytes(), "Message".asbytes()));
let mut macout = [0u8; 64]; mac.reset(); mac.update("Other message".asbytes()); mac.finalizewithdst(&mut mac_out); ```
rust
test RustCrypto ... bench: 2,185 ns/iter (+/- 241)
test orion ... bench: 2,350 ns/iter (+/- 60)
test rigel_one_shot ... bench: 2,070 ns/iter (+/- 43)
test rigel_stream ... bench: 2,122 ns/iter (+/- 35)
test ring ... bench: 3,357 ns/iter (+/- 91)
This was benchmarked on a MacBook Air 1,6 GHz Intel Core i5, 4GB.
rigel
is licensed under the MIT license. See the LICENSE
file for more information.