p3_symmetric/
permutation.rs

1/// A permutation in the mathematical sense.
2pub trait Permutation<T: Clone>: Clone + Sync {
3    #[inline(always)]
4    fn permute(&self, mut input: T) -> T {
5        self.permute_mut(&mut input);
6        input
7    }
8
9    fn permute_mut(&self, input: &mut T);
10}
11
12/// A permutation thought to be cryptographically secure, in the sense that it is thought to be
13/// difficult to distinguish (in a nontrivial way) from a random permutation.
14pub trait CryptographicPermutation<T: Clone>: Permutation<T> {}