de.flexiprovider.pqc.ecc.mceliece
Class McElieceCCA2KeyPairGenerator
java.lang.Object
|
+--java.security.KeyPairGeneratorSpi
|
+--de.flexiprovider.api.keys.KeyPairGenerator
|
+--de.flexiprovider.pqc.ecc.mceliece.McElieceCCA2KeyPairGenerator
- public class McElieceCCA2KeyPairGenerator
- extends KeyPairGenerator
This class implements key pair generation of the McEliece Public Key
Cryptosystem (McEliecePKC). The class extends the KeyPairGeneratorSpi class.
The algorithm is given the parameters m and t or the key size n as input.
Then, the following matrices are generated:
- G' is a k x n generator matrix of a binary irreducible (n,k) Goppa code
GC which can correct up to t errors where n = 2^m and k is chosen maximal,
i.e. k <= n - mt
- H is an mt x n check matrix of the Goppa code GC
- S is a k x k random binary non-singular matrix
- P is an n x n random permutation matrix.
Then, the algorithm computes the k x n matrix G = SG'P.
The public key
is (n, t, G). The private key is (m, k, field polynomial, Goppa polynomial,
H, S, P, setJ);
A key pair consists of a McEliecePublicKey and a
McEliecePrivatKey.
The default parameters are m = 10 and t = 50.
The McElieceKeyPairGenerator can be used as follows:
- get instance of McEliecePKC key pair generator:
KeyPairGenerator kpg =
KeyPairGenerator.getInstance("McEliece","FlexiPQC");
- initialize the KPG with key size n:
kpg.initialize(n);
or with parameters m and t via a McElieceParameterSpec:
McElieceParameterSpec paramSpec = new McElieceParameterSpec(m, t);
kpg.initialize(paramSpec, Registry.getSecureRandom());
- create McEliecePKC key pair:
KeyPair keyPair = kpg.generateKeyPair();
- get the encoded private and public keys from the key pair:
encodedPublicKey = keyPair.getPublic().getEncoded();
encodedPrivateKey = keyPair.getPrivate().getEncoded();
- Author:
- Elena Klintsevich, Martin Döring
- See Also:
ECCKeyGenParameterSpec
| Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
McElieceCCA2KeyPairGenerator
public McElieceCCA2KeyPairGenerator()
initialize
public void initialize(AlgorithmParameterSpec params,
SecureRandom random)
throws InvalidAlgorithmParameterException
- Initialize the key pair generator with the given parameters and source of
randomness. The parameters have to be an instance of
ECCKeyGenParameterSpec. If the parameters are null, the
default parameters are used (see ECCKeyGenParameterSpec).
- Overrides:
initialize in class KeyPairGenerator
- Parameters:
params - the parametersrandom - the source of randomness- Throws:
InvalidAlgorithmParameterException - if the parameters are not an instance of
ECCKeyGenParameterSpec.
initialize
public void initialize(int keySize,
SecureRandom random)
- Initialize the key pair generator with the given key size and source of
randomness.
- Overrides:
initialize in class KeyPairGenerator
- Parameters:
keySize - the length of the coderandom - the source of randomness
genKeyPair
public KeyPair genKeyPair()
- Generate a McEliece key pair. The public key is an instance of
McEliecePublicKey, the private key is an instance of
McEliecePrivateKey.
- Overrides:
genKeyPair in class KeyPairGenerator
- Returns:
- the McEliece key pair
- See Also:
McEliecePublicKey,
McEliecePrivateKey