1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
//! Numbers of rounds allowed to be used with the ChaCha stream cipher pub trait Rounds: Copy { const COUNT: usize; } /// 8-rounds #[derive(Copy, Clone)] pub struct R8; impl Rounds for R8 { const COUNT: usize = 8; } /// 12-rounds #[derive(Copy, Clone)] pub struct R12; impl Rounds for R12 { const COUNT: usize = 12; } /// 20-rounds #[derive(Copy, Clone)] pub struct R20; impl Rounds for R20 { const COUNT: usize = 20; }