1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
#[derive(Clone, Copy)]
/// Exposes the Sha2 options made available.
pub enum ShaVariantOption {
    SHA256,
    SHA384,
    SHA512
}

impl ShaVariantOption {

    /// Return the output size in bits.
    pub fn return_value(&self) -> usize {
        match *self {
            ShaVariantOption::SHA256 => 256,
            ShaVariantOption::SHA384 => 384,
            ShaVariantOption::SHA512 => 512,
        }
    }
}