Codota Logo
DHParameters.getQ
Code IndexAdd Codota 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 LinkedList()
  • Codota IconCollections.emptyList()
  • Codota Iconnew ArrayList()
  • Smart code suggestions by Codota
}
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

  • Finding current android device location
  • getExternalFilesDir (Context)
  • setRequestProperty (URLConnection)
    Sets the general request property. If a property with the key already exists, overwrite its value wi
  • startActivity (Activity)
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • Set (java.util)
    A collection that contains no duplicate elements. More formally, sets contain no pair of elements e1
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • Notification (javax.management)
  • Table (org.hibernate.mapping)
    A relational table
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now