p3_symmetric/
permutation.rs

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