orion Build Status

Warning: You should not use this for anything that requires confidence in security.

Currently contains: * HMAC with SHA2(256, 384, 512). * HKDF with the above HMAC options.

Usage

Include it in your Cargo.toml file: [dependencies] orion = ">=0.1.45" Use it like this: ``` extern crate orion use orion::{default, util};

// HMAC let key = util::genrandkey(64); let msg = "Some message.".asbytes().tovec();

let expectedhmac = default::hmac(key, msg); asserteq!(default::hmacvalidate(&expectedhmac, &key, &msg), true);

// HKDF let salt = util::genrandkey(64); let data = "Some data.".asbytes().tovec(); let info = "Some info.".asbytes().tovec();

let hkdf = default::hmac(salt, data, info, 64); ```

Documentation

Find it here.

Tests

All unit-tests are located in the same file as the functions they are testing. To run tests: cargo test.

Acknowledgments

Thanks to @defuse for a quick audit of the code.

License

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