public class Permutation extends Object
Constructor and Description |
---|
Permutation(byte[] enc)
Create a permutation from an encoded permutation.
|
Permutation(int n)
Create the identity permutation of the given size.
|
Permutation(int[] perm)
Create a permutation using the given permutation vector.
|
Permutation(int n,
SecureRandom sr)
Create a random permutation of the given size.
|
Modifier and Type | Method and Description |
---|---|
Permutation |
computeInverse()
Compute the inverse permutation P-1.
|
boolean |
equals(Object other)
checks if given object is equal to this permutation.
|
byte[] |
getEncoded()
Encode this permutation as byte array.
|
int[] |
getVector() |
int |
hashCode() |
Permutation |
rightMultiply(Permutation p)
Compute the product of this permutation and another permutation.
|
String |
toString() |
public Permutation(int n)
n
- the size of the permutationpublic Permutation(int[] perm)
perm
- the permutation vectorpublic Permutation(byte[] enc)
enc
- the encoded permutationpublic Permutation(int n, SecureRandom sr)
n
- the size of the permutationsr
- the source of randomnesspublic byte[] getEncoded()
public int[] getVector()
public Permutation computeInverse()
public Permutation rightMultiply(Permutation p)
p
- the other permutationpublic boolean equals(Object other)
The method returns false whenever the given object is not permutation.
public String toString()
Copyright © 2021 BouncyCastle.org. All rights reserved.