congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
MGF1BytesGeneratorExt
Code IndexAdd Tabnine to your IDE (free)

How to use
MGF1BytesGeneratorExt
in
io.yggdrash.common.crypto

Best Java code snippets using io.yggdrash.common.crypto.MGF1BytesGeneratorExt (Showing top 4 results out of 315)

origin: yggdrash/yggdrash

  @Test
  public void getDigest() {
    MGF1BytesGeneratorExt ext = new MGF1BytesGeneratorExt(new SHA1Digest(), 1);
    byte[] VZ = BigIntegers.asUnsignedByteArray(1, BigInteger.ONE);

    DerivationParameters kdfParam = new MGFParameters(VZ);

    ext.init(kdfParam);

    byte[] K1 = new byte[4];
    assert ext.generateBytes(K1, 0, K1.length) > 0;

    assert ext.getDigest() != null;
  }
}
origin: yggdrash/yggdrash

if (len > this.hLen) {
  do {
    this.ItoOSP(hashCounter++, C);
    this.digest.update(this.seed, 0, this.seed.length);
    this.digest.update(C, 0, C.length);
  this.ItoOSP(hashCounter, C);
  this.digest.update(this.seed, 0, this.seed.length);
  this.digest.update(C, 0, C.length);
origin: yggdrash/yggdrash

/**
 * Encryption equivalent to the Crypto++ default ECIES<ECP> settings:
 * <p>
 * DL_KeyAgreementAlgorithm:        DL_KeyAgreementAlgorithm_DH<struct ECPPoint,struct EnumToType<enum CofactorMultiplicationOption,0> >
 * DL_KeyDerivationAlgorithm:       DL_KeyDerivationAlgorithm_P1363<struct ECPPoint,0,class P1363_KDF2<class SHA1> >
 * DL_SymmetricEncryptionAlgorithm: DL_EncryptionAlgorithm_Xor<class HMAC<class SHA1>,0>
 * DL_PrivateKey:                   DL_Key<ECPPoint>
 * DL_PrivateKey_EC<class ECP>
 * <p>
 * Used for Whisper V3
 */
public static byte[] decryptSimple(BigInteger privKey, byte[] cipher) throws InvalidCipherTextException {
  EthereumIESEngine iesEngine = new EthereumIESEngine(
      new ECDHBasicAgreement(),
      new MGF1BytesGeneratorExt(new SHA1Digest(), 1),
      new HMac(new SHA1Digest()),
      new SHA1Digest(),
      null);
  IESParameters p = new IESParameters(null, null, KEY_SIZE);
  ParametersWithIV parametersWithIV = new ParametersWithIV(p, new byte[0]);
  iesEngine.setHashMacKey(false);
  iesEngine.init(new ECPrivateKeyParameters(privKey, CURVE), parametersWithIV,
      new ECIESPublicKeyParser(ECKey.CURVE));
  return iesEngine.processBlock(cipher, 0, cipher.length);
}
origin: yggdrash/yggdrash

EthereumIESEngine iesEngine = new EthereumIESEngine(
    new ECDHBasicAgreement(),
    new MGF1BytesGeneratorExt(new SHA1Digest(), 1),
    new HMac(new SHA1Digest()),
    new SHA1Digest(),
io.yggdrash.common.cryptoMGF1BytesGeneratorExt

Javadoc

This class is borrowed from spongycastle project The only change made is addition of 'counterStart' parameter to conform to Crypto++ capabilities

Most used methods

  • <init>
  • ItoOSP
  • generateBytes
  • getDigest
  • init

Popular in Java

  • Making http requests using okhttp
  • addToBackStack (FragmentTransaction)
  • startActivity (Activity)
  • getContentResolver (Context)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • Path (java.nio.file)
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • From CI to AI: The AI layer in your organization
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