Class FipsDSA.DomainParametersValidator

java.lang.Object
org.bouncycastle.crypto.fips.FipsDSA.DomainParametersValidator
Enclosing class:
FipsDSA

public static final class FipsDSA.DomainParametersValidator extends Object
Domain parameter validator for DSA.
  • Constructor Details

    • DomainParametersValidator

      public DomainParametersValidator(FipsDigestAlgorithm digestAlgorithm, SecureRandom random)
      Base constructor - for 186-4
      Parameters:
      digestAlgorithm - digest to use in prime calculations.
      random - source of randomness for prime number testing.
    • DomainParametersValidator

      public DomainParametersValidator(FipsDSA.DomainParametersValidator.Version version, FipsDigestAlgorithm digestAlgorithm, SecureRandom random)
      Base constructor.
      Parameters:
      version - the version of DSS the validator is for.
      digestAlgorithm - digest to use in prime calculations.
      random - source of randomness for prime number testing.
  • Method Details

    • isValidPAndQ

      public boolean isValidPAndQ(BigInteger p, BigInteger q, byte[] seed, int counter)
      Validate P and Q against the passed in seed and counter.
      Parameters:
      p - the prime P.
      q - the prime Q.
      seed - the seed P and Q were derived from.
      counter - the number of iterations required to derive P.
      Returns:
      true if the P and Q values are the expected ones, false otherwise.
    • isPartiallyValidG

      public boolean isPartiallyValidG(BigInteger p, BigInteger q, BigInteger g)
      Do a partial validation of g against p and q.
      Parameters:
      p - the prime P.
      q - the prime Q.
      g - the generator G associated with P and Q.
      Returns:
      true if the generator is partially valid, false otherwise.
    • isValidG

      public boolean isValidG(BigInteger p, BigInteger q, byte[] seed, int index, BigInteger g)
      Do a full validation of g against p and q by including the seed and index associated with g's related parameters.
      Parameters:
      p - the prime P.
      q - the prime Q.
      seed - the domain parameter seed used to generate p and q.
      index - the 8 bit usage index for G.
      g - the generator G associated with P and Q.
      Returns:
      true if the generator is partially valid, false otherwise.