org.bouncycastle.crypto.generators
Class GOST3410ParametersGenerator

java.lang.Object
  extended by org.bouncycastle.crypto.generators.GOST3410ParametersGenerator

public class GOST3410ParametersGenerator
extends java.lang.Object

generate suitable parameters for GOST3410.


Field Summary
private  java.security.SecureRandom init_random
           
private static java.math.BigInteger ONE
           
private  int size
           
private static java.math.BigInteger TWO
           
private  int typeproc
           
 
Constructor Summary
GOST3410ParametersGenerator()
           
 
Method Summary
 GOST3410Parameters generateParameters()
          which generates the p , q and a values from the given parameters, returning the GOST3410Parameters object.
 void init(int size, int typeproc, java.security.SecureRandom random)
          initialise the key generator.
private  int procedure_A(int x0, int c, java.math.BigInteger[] pq, int size)
           
private  long procedure_Aa(long x0, long c, java.math.BigInteger[] pq, int size)
           
private  void procedure_B(int x0, int c, java.math.BigInteger[] pq)
           
private  void procedure_Bb(long x0, long c, java.math.BigInteger[] pq)
           
private  java.math.BigInteger procedure_C(java.math.BigInteger p, java.math.BigInteger q)
          Procedure C procedure generates the a value from the given p,q, returning the a value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

size

private int size

typeproc

private int typeproc

init_random

private java.security.SecureRandom init_random

ONE

private static final java.math.BigInteger ONE

TWO

private static final java.math.BigInteger TWO
Constructor Detail

GOST3410ParametersGenerator

public GOST3410ParametersGenerator()
Method Detail

init

public void init(int size,
                 int typeproc,
                 java.security.SecureRandom random)
initialise the key generator.

Parameters:
size - size of the key
typeproc - type procedure A,B = 1; A',B' - else
random - random byte source.

procedure_A

private int procedure_A(int x0,
                        int c,
                        java.math.BigInteger[] pq,
                        int size)

procedure_Aa

private long procedure_Aa(long x0,
                          long c,
                          java.math.BigInteger[] pq,
                          int size)

procedure_B

private void procedure_B(int x0,
                         int c,
                         java.math.BigInteger[] pq)

procedure_Bb

private void procedure_Bb(long x0,
                          long c,
                          java.math.BigInteger[] pq)

procedure_C

private java.math.BigInteger procedure_C(java.math.BigInteger p,
                                         java.math.BigInteger q)
Procedure C procedure generates the a value from the given p,q, returning the a value.


generateParameters

public GOST3410Parameters generateParameters()
which generates the p , q and a values from the given parameters, returning the GOST3410Parameters object.