de.flexiprovider.pqc.ecc.niederreiter
Class NiederreiterKeyPairGenerator

java.lang.Object
  |
  +--java.security.KeyPairGeneratorSpi
        |
        +--de.flexiprovider.api.keys.KeyPairGenerator
              |
              +--de.flexiprovider.pqc.ecc.niederreiter.NiederreiterKeyPairGenerator

public class NiederreiterKeyPairGenerator
extends KeyPairGenerator

This class implements key pair generation of the Niederreiter public-key cryptosystem (Niederreiter PKCS). It class extends the KeyPairGenerator class.

Given the parameters m and t or the key size n, the algorithm generates the following matrices:

Then, compute the k x n matrix H = SH'P.

The public key is (t, n, H), the private key is (m,k,field polynomial,Goppa polynomial,S,P).

A key pair consists of a NiederreiterPublicKey and a NiederreiterPrivateKey.

The default parameters are (m, t) = (11, 50).

The Niederreiter key pair generator can be used as follows:

1. get instance of NiederreiterPKC key pair generator:
KeyPairGenerator kpg = KeyPairGenerator.getInstance("Niederreiter","FlexiPQC");
2. initialize the KPG with the key size n:
kpg.initialize(n);
or with the parameters m and t:
kpg.initialize(m,t);
3. create McElicePKC 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
NiederreiterKeyPairGenerator()
           
 
Method Summary
 KeyPair genKeyPair()
          Generate a 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.
 
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

NiederreiterKeyPairGenerator

public NiederreiterKeyPairGenerator()
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.
Overrides:
initialize in class KeyPairGenerator
Parameters:
keySize - the length of the code
random - the source of randomness

genKeyPair

public KeyPair genKeyPair()
Generate a key pair.
Overrides:
genKeyPair in class KeyPairGenerator
Returns:
the key pair, consisting of a NiederreiterPrivateKey and a NiederreiterPublicKey.
See Also:
NiederreiterPrivateKey, NiederreiterPublicKey