Crate vitaminc_traits

Source
Expand description

§Vitamin C Traits

Crates.io Workflow Status

This crate is part of the Vitamin C framework to make cryptography code healthy.

This crate provides traits for hashing and encryption algorithms. These are very similar to the traits provided by the digest and other crates in the RustCrypto project with some key differences:

  • The Update trait takes a specific input type. This allows us to reason about the input type and its sensitivity.
  • The Output traits are generic over the output type. This allows us to reason about the output type and its sensitivity.
  • All types have a trait bound of Controlled
  • const generics are used to specify the output size of the hash instead of GenericArray.

Async versions of some of these traits are provided in the async-traits crate.

§Acknowledgements

Shoutout to Tony Arcieri, Artyom Pavlov and all the contributors to the Rust Crypto project which was the inspiration for this crate.

§CipherStash

Vitamin C is brought to you by the team at CipherStash.

License: MIT

Traits§

FixedOutput
Trait for hash functions with fixed-size output.
FixedOutputReset
Trait for hash functions with fixed-size output able to reset themselves.
KeyInit
KeySize
OutputSize
Defines the size of the output of a hash function.
Update
Trait for updating a hash with input data with a specific input type. This differs from the Update trait in digest in that it takes a specific input type. This allows us to reason about the input type and its sensitivity.