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

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

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

origin: yggdrash/yggdrash

@Test
public void testKDF() {
  ConcatKDFBytesGenerator kdf = new ConcatKDFBytesGenerator(new SHA256Digest());
  kdf.init(new KDFParameters("Hello".getBytes(), new byte[0]));
  byte[] bytes = new byte[2];
  kdf.generateBytes(bytes, 0, bytes.length);
  assertArrayEquals(new byte[] {-66, -89}, bytes);
}
origin: yggdrash/yggdrash

  private static EthereumIESEngine makeIESEngine(boolean isEncrypt, ECPoint pub, BigInteger prv, byte[] IV) {
    AESEngine aesFastEngine = new AESEngine();

    EthereumIESEngine iesEngine = new EthereumIESEngine(
        new ECDHBasicAgreement(),
        new ConcatKDFBytesGenerator(new SHA256Digest()),
        new HMac(new SHA256Digest()),
        new SHA256Digest(),
        new BufferedBlockCipher(new SICBlockCipher(aesFastEngine)));

    byte[] d = new byte[] {};
    byte[] e = new byte[] {};

    IESParameters p = new IESWithCipherParameters(d, e, KEY_SIZE, KEY_SIZE);
    ParametersWithIV parametersWithIV = new ParametersWithIV(p, IV);

    iesEngine.init(isEncrypt, new ECPrivateKeyParameters(prv, CURVE), new ECPublicKeyParameters(pub, CURVE), parametersWithIV);
    return iesEngine;
  }
}
origin: yggdrash/yggdrash

public static byte[] decrypt(ECPoint ephem, BigInteger prv, byte[] IV, byte[] cipher, byte[] macData) throws InvalidCipherTextException {
  AESEngine aesFastEngine = new AESEngine();
  EthereumIESEngine iesEngine = new EthereumIESEngine(
      new ECDHBasicAgreement(),
      new ConcatKDFBytesGenerator(new SHA256Digest()),
      new HMac(new SHA256Digest()),
      new SHA256Digest(),
      new BufferedBlockCipher(new SICBlockCipher(aesFastEngine)));
  byte[] d = new byte[] {};
  byte[] e = new byte[] {};
  IESParameters p = new IESWithCipherParameters(d, e, KEY_SIZE, KEY_SIZE);
  ParametersWithIV parametersWithIV =
      new ParametersWithIV(p, IV);
  iesEngine.init(false, new ECPrivateKeyParameters(prv, CURVE), new ECPublicKeyParameters(ephem, CURVE), parametersWithIV);
  return iesEngine.processBlock(cipher, 0, cipher.length, macData);
}
origin: yggdrash/yggdrash

private static EthereumIESEngine makeIESEngine(boolean isEncrypt, ECPoint pub, BigInteger prv, byte[] IV) {
  AESEngine aesFastEngine = new AESEngine();
  EthereumIESEngine iesEngine = new EthereumIESEngine(
      new ECDHBasicAgreement(),
      new ConcatKDFBytesGenerator(new SHA256Digest()),
      new HMac(new SHA256Digest()),
      new SHA256Digest(),
      new BufferedBlockCipher(new SICBlockCipher(aesFastEngine)));
  byte[] d = new byte[] {};
  byte[] e = new byte[] {};
  IESParameters p = new IESWithCipherParameters(d, e, KEY_SIZE, KEY_SIZE);
  ParametersWithIV parametersWithIV = new ParametersWithIV(p, IV);
  iesEngine.init(isEncrypt, new ECPrivateKeyParameters(prv, curve), new ECPublicKeyParameters(pub, curve), parametersWithIV);
  return iesEngine;
}
io.yggdrash.common.cryptoConcatKDFBytesGenerator

Javadoc

Basic KDF generator for derived keys and ivs as defined by NIST SP 800-56A.

Most used methods

  • <init>
  • generateBytes
    fill len bytes of the output buffer with bytes generated from the derivation function.
  • init

Popular in Java

  • Updating database using SQL prepared statement
  • addToBackStack (FragmentTransaction)
  • findViewById (Activity)
  • setContentView (Activity)
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • BufferedInputStream (java.io)
    A BufferedInputStream adds functionality to another input stream-namely, the ability to buffer the i
  • FileInputStream (java.io)
    An input stream that reads bytes from a file. File file = ...finally if (in != null) in.clos
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • URLConnection (java.net)
    A connection to a URL for reading or writing. For HTTP connections, see HttpURLConnection for docume
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • Top plugins for Android Studio
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