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:

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:

  1. get instance of McEliecePKC key pair generator:
    KeyPairGenerator kpg = KeyPairGenerator.getInstance("McEliece","FlexiPQC");
  2. 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());
  3. create McEliecePKC key pair:
    KeyPair keyPair = kpg.generateKeyPair();
  4. 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

Constructor Summary
McElieceCCA2KeyPairGenerator()
           
 
Method Summary
 KeyPair genKeyPair()
          Generate a McEliece key pair.
 void initialize(AlgorithmParameterSpec params, SecureRandom random)
          Initialize the key pair generator with the given parameters and source of randomness.
 void initialize(int keySize, SecureRandom random)
          Initialize the key pair generator with the given key size and source of randomness.
 
Methods inherited from class de.flexiprovider.api.keys.KeyPairGenerator
generateKeyPair, initialize, initialize
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

McElieceCCA2KeyPairGenerator

public McElieceCCA2KeyPairGenerator()
Method Detail

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 parameters
random - 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 code
random - 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