rigel Build Status codecov

About

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.

Security

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

Example

With the 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()));

```

With streaming messages: ```rust extern crate rigel; extern crate sha2;

let mut mac = rigel::HmacSha512{buffer: [0u8; 192], hasher: sha2::Sha512::default()}; mac.init("Secret key".asbytes()); mac.update("Message".asbytes()); let res = mac.finalize(); assert!(mac.verify(&res, "Secret key".asbytes(), "Message".asbytes()));

```

Performance

rust test RustCrypto ... bench: 2,723 ns/iter (+/- 47) test orion ... bench: 2,521 ns/iter (+/- 553) test rigel_one_shot ... bench: 2,094 ns/iter (+/- 182) test rigel_stream ... bench: 2,174 ns/iter (+/- 121) test ring ... bench: 3,378 ns/iter (+/- 79) This was benchmarked on a MacBook Air 1,6 GHz Intel Core i5, 4GB.

License

rigel is licensed under the MIT license. See the LICENSE file for more information.