congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
DHParameters.getQ
Code IndexAdd Tabnine to your IDE (free)

How to use
getQ
method
in
org.spongycastle.crypto.params.DHParameters

Best Java code snippets using org.spongycastle.crypto.params.DHParameters.getQ (Showing top 9 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
List l =
  • Codota Iconnew ArrayList()
  • Codota Iconnew LinkedList()
  • Smart code suggestions by Tabnine
}
origin: com.madgag.spongycastle/core

  public int hashCode()
  {
    return getP().hashCode() ^ getG().hashCode() ^ (getQ() != null ? getQ().hashCode() : 0);
  }
}
origin: com.madgag.spongycastle/core

public static boolean areCompatibleParameters(DHParameters a, DHParameters b)
{
  return a.getP().equals(b.getP()) && a.getG().equals(b.getG())
    && (a.getQ() == null || b.getQ() == null || a.getQ().equals(b.getQ()));
}
origin: com.madgag/sc-light-jdk15on

  public int hashCode()
  {
    return getP().hashCode() ^ getG().hashCode() ^ (getQ() != null ? getQ().hashCode() : 0);
  }
}
origin: com.madgag.spongycastle/core

public boolean equals(
  Object  obj)
{
  if (!(obj instanceof DHParameters))
  {
    return false;
  }
  DHParameters    pm = (DHParameters)obj;
  if (this.getQ() != null)
  {
    if (!this.getQ().equals(pm.getQ()))
    {
      return false;
    }
  }
  else
  {
    if (pm.getQ() != null)
    {
      return false;
    }
  }
  return pm.getP().equals(p) && pm.getG().equals(g);
}

origin: com.madgag/sc-light-jdk15on

public boolean equals(
  Object  obj)
{
  if (!(obj instanceof DHParameters))
  {
    return false;
  }
  DHParameters    pm = (DHParameters)obj;
  if (this.getQ() != null)
  {
    if (!this.getQ().equals(pm.getQ()))
    {
      return false;
    }
  }
  else
  {
    if (pm.getQ() != null)
    {
      return false;
    }
  }
  return pm.getP().equals(p) && pm.getG().equals(g);
}

origin: com.madgag.spongycastle/core

private BigInteger validate(BigInteger y, DHParameters dhParams)
{
  if (y == null)
  {
    throw new NullPointerException("y value cannot be null");
  }
  // TLS check
  if (y.compareTo(TWO) < 0 || y.compareTo(dhParams.getP().subtract(TWO)) > 0)
  {
    throw new IllegalArgumentException("invalid DH public key");
  }
  if (dhParams.getQ() != null)
  {
    if (ONE.equals(y.modPow(dhParams.getQ(), dhParams.getP())))
    {
      return y;
    }
    throw new IllegalArgumentException("Y value does not appear to be in correct group");
  }
  else
  {
    return y;         // we can't validate without Q.
  }
}
origin: casific/murmur

BigInteger xInverse = x.modInverse(DH_GROUP_PARAMETERS.getQ());
BigInteger i = iDoubleBlind.modPow(xInverse, DH_GROUP_PARAMETERS.getP());
origin: com.madgag/sc-light-jdk15on

BigInteger calculatePrivate(DHParameters dhParams, SecureRandom random)
{
  BigInteger p = dhParams.getP();
  int limit = dhParams.getL();
  if (limit != 0)
  {
    return new BigInteger(limit, random).setBit(limit - 1);
  }
  BigInteger min = TWO;
  int m = dhParams.getM();
  if (m != 0)
  {
    min = ONE.shiftLeft(m - 1);
  }
  BigInteger max = p.subtract(TWO);
  BigInteger q = dhParams.getQ();
  if (q != null)
  {
    max = q.subtract(TWO);
  }
  return BigIntegers.createRandomInRange(min, max, random);
}
origin: com.madgag.spongycastle/core

BigInteger q = dhParams.getQ();
if (q == null)
org.spongycastle.crypto.paramsDHParametersgetQ

Popular methods of DHParameters

  • getG
  • getP
  • <init>
  • getL
    Return the private value length in bits - if set, zero otherwise
  • equals
  • getDefaultMParam
  • getM
    Return the minimum length of the private value.
  • hashCode

Popular in Java

  • Reading from database using SQL prepared statement
  • getSupportFragmentManager (FragmentActivity)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • putExtra (Intent)
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • ResourceBundle (java.util)
    ResourceBundle is an abstract class which is the superclass of classes which provide Locale-specifi
  • 14 Best Plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now