Expand description
XOF factory for creating instances of algorithms that implement the XOF trait.
As with all Factory objects, this implements constructions from strings and defaults, and
returns a XOFFactory object which itself implements the XOF trait as a pass-through to the underlying algorithm.
Example usage:
use bouncycastle_core::traits::XOF;
use bouncycastle_factory::AlgorithmFactory;
use bouncycastle_factory::xof_factory::XOFFactory;
use bouncycastle_sha3 as sha3;
let data: &[u8] = b"Hello, world!";
let mut h = XOFFactory::new(sha3::SHAKE128_NAME).unwrap();
h.absorb(data);
let output: Vec<u8> = h.squeeze(16);Equivalently, it may be invoked by passing a string instead of using the constant:
use bouncycastle_factory::AlgorithmFactory;
use bouncycastle_factory::xof_factory::XOFFactory;
let mut h = XOFFactory::new("SHAKE128");If the algorithm used is not particularly important, the configured default may be used:
use bouncycastle_factory::AlgorithmFactory;
use bouncycastle_factory::xof_factory::XOFFactory;
let mut h = XOFFactory::default();Enums§
- XOFFactory
- Wrapper object for all algorithms that impl
XOF.