Tabnine Logo
DHParameters.equals
Code IndexAdd Tabnine to your IDE (free)

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

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

origin: com.madgag.spongycastle/core

public boolean equals(
  Object  obj)
{
  if (!(obj instanceof DHKeyParameters))
  {
    return false;
  }
  DHKeyParameters    dhKey = (DHKeyParameters)obj;
  if (params == null)
  {
    return dhKey.getParameters() == null;
  }
  else
  { 
    return params.equals(dhKey.getParameters());
  }
}

origin: com.madgag/sc-light-jdk15on

public boolean equals(
  Object  obj)
{
  if (!(obj instanceof DHKeyParameters))
  {
    return false;
  }
  DHKeyParameters    dhKey = (DHKeyParameters)obj;
  if (params == null)
  {
    return dhKey.getParameters() == null;
  }
  else
  { 
    return params.equals(dhKey.getParameters());
  }
}

origin: com.madgag.spongycastle/core

BigInteger              message)
if (!pub.getParameters().equals(dhParams))
origin: com.madgag.spongycastle/core

if (!pub.getParameters().equals(dhParams))
origin: com.madgag/sc-light-jdk15on

  /**
   * given a message from a given party and the corresponding public key,
   * calculate the next message in the agreement sequence. In this case
   * this will represent the shared secret.
   */
  public BigInteger calculateAgreement(
    DHPublicKeyParameters   pub,
    BigInteger              message)
  {
    if (!pub.getParameters().equals(dhParams))
    {
      throw new IllegalArgumentException("Diffie-Hellman public key has wrong parameters.");
    }

    BigInteger p = dhParams.getP();

    return message.modPow(key.getX(), p).multiply(pub.getY().modPow(privateValue, p)).mod(p);
  }
}
origin: com.madgag/sc-light-jdk15on

  /**
   * given a short term public key from a given party calculate the next
   * message in the agreement sequence. 
   */
  public BigInteger calculateAgreement(
    CipherParameters   pubKey)
  {
    DHPublicKeyParameters   pub = (DHPublicKeyParameters)pubKey;

    if (!pub.getParameters().equals(dhParams))
    {
      throw new IllegalArgumentException("Diffie-Hellman public key has wrong parameters.");
    }

    return pub.getY().modPow(key.getX(), dhParams.getP());
  }
}
org.spongycastle.crypto.paramsDHParametersequals

Popular methods of DHParameters

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

Popular in Java

  • Making http requests using okhttp
  • getSystemService (Context)
  • getExternalFilesDir (Context)
  • getSharedPreferences (Context)
  • BufferedInputStream (java.io)
    A BufferedInputStream adds functionality to another input stream-namely, the ability to buffer the i
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • JList (javax.swing)
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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