#cryptography #crypto #hmac #optimization #sha512


HMAC-SHA512 implementation optimized for embedded devices

4 releases

0.0.4 Aug 10, 2018
0.0.3 Aug 9, 2018
0.0.2 Aug 8, 2018
0.0.1 Aug 3, 2018

#4 in #hmac

Download history 9/week @ 2018-08-03 47/week @ 2018-08-10

18 downloads per month

rigel Build Status codecov


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.


This library has at no point received any formal cryptographic/security audit. It should be used at own risk.


With the one-shot API:

extern crate rigel;

let mac = rigel::hmac_sha512("Secret key".as_bytes(), "Message".as_bytes());

assert!(rigel::verify(&mac, "Secret key".as_bytes(), "Message".as_bytes()));

With streaming messages:

extern crate rigel;

let mut mac = rigel::init("Secret key".as_bytes());
let res = mac.finalize();
assert!(mac.verify(&res, "Secret key".as_bytes(), "Message".as_bytes()));


test RustCrypto     ... bench:       2,727 ns/iter (+/- 91)
test orion          ... bench:       2,461 ns/iter (+/- 158)
test rigel_one_shot ... bench:       2,093 ns/iter (+/- 42)
test rigel_stream   ... bench:       2,161 ns/iter (+/- 58)
test ring           ... bench:       3,357 ns/iter (+/- 96)

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.

MIT license


Reverse deps