Codota Logo
BlockCipher.init
Code IndexAdd Codota to your IDE (free)

How to use
init
method
in
org.spongycastle.crypto.BlockCipher

Best Java code snippets using org.spongycastle.crypto.BlockCipher.init (Showing top 20 results out of 315)

  • Common ways to obtain BlockCipher
private void myMethod () {
BlockCipher b =
  • Codota Iconnew AESEngine()
  • Codota Iconnew CBCBlockCipher(new DESedeEngine())
  • Smart code suggestions by Codota
}
origin: com.madgag/sc-light-jdk15on

/**
 * initialise the underlying cipher.
 *
 * @param forEncryption true if we are setting up for encryption, false otherwise.
 * @param params the necessary parameters for the underlying cipher to be initialised.
 */
public void init(
  boolean forEncryption,
  CipherParameters params)
{
  cipher.init(forEncryption, params);
}
origin: com.madgag.spongycastle/core

public void init(
  CipherParameters    params)
{
  reset();
  cipher.init(true, params);
}
origin: com.madgag/sc-light-jdk15on

public void init(
  CipherParameters    params)
{
  reset();
  cipher.init(true, params);
}
origin: com.madgag.spongycastle/core

public void init(
  CipherParameters    params)
{
  reset();
  cipher.init(true, params);
}
origin: com.madgag.spongycastle/bctls-jdk15on

public void init(byte[] iv, int ivOff, int ivLen)
{
  cipher.init(isEncrypting, new ParametersWithIV(null, iv, ivOff, ivLen));
}
origin: com.madgag/sc-light-jdk15on

public void init(
  CipherParameters    params)
{
  reset();
  cipher.init(true, params);
}
origin: com.madgag/sc-light-jdk15on

private void E(byte[] key, byte[] s, int sOff, byte[] in, int inOff)
{
  cipher.init(true, new KeyParameter(key));
  
  cipher.processBlock(in, inOff, s, sOff);
}
origin: com.madgag.spongycastle/core

private void E(byte[] key, byte[] s, int sOff, byte[] in, int inOff)
{
  cipher.init(true, new KeyParameter(key));
  
  cipher.processBlock(in, inOff, s, sOff);
}
origin: com.madgag/sc-light-jdk15on

public void init(CipherParameters params)
{
  reset();
  cipher.init(true, params);
  //initializes the L, Lu, Lu2 numbers
  L = new byte[ZEROES.length];
  cipher.processBlock(ZEROES, 0, L, 0);
  Lu = doubleLu(L);
  Lu2 = doubleLu(Lu);
  cipher.init(true, params);
}
origin: UniversaBlockchain/universa

@Override
public void initialize(Direction direction, SymmetricKey key) {
  this.key = key.getKey();
  if (initialized()) {
    CipherParameters params = new KeyParameter(this.key);
    aesEngine.init(direction == Direction.ENCRYPT, params);
  }
}
origin: com.madgag.spongycastle/core

/**
 * Constructor to allow use of a particular sbox with GOST28147
 * @see GOST28147Engine#getSBox(String)
 */
public GOST3411Digest(byte[] sBoxParam)
{
  sBox = Arrays.clone(sBoxParam);
  cipher.init(true, new ParametersWithSBox(null, sBox));
  reset();
}
origin: com.madgag/sc-light-jdk15on

/**
 * Constructor to allow use of a particular sbox with GOST28147
 * @see GOST28147Engine#getSBox(String)
 */
public GOST3411Digest(byte[] sBoxParam)
{
  sBox = Arrays.clone(sBoxParam);
  cipher.init(true, new ParametersWithSBox(null, sBox));
  reset();
}
origin: com.madgag.spongycastle/bctls-jdk15on

public void setKey(byte[] key, int keyOff, int keyLen)
{
  this.key = new KeyParameter(key, keyOff, keyLen);
  cipher.init(isEncrypting, new ParametersWithIV(this.key, new byte[cipher.getBlockSize()]));
}
origin: es.gob.afirma.jmulticard/jmulticard

/** Encripta un bloque usando AES.
 * @param key Clave AES.
 * @param z Bloque a crifrar.
 * @return Bloque cifrado. */
public static byte[] encryptBlock(final byte[] key, final byte[] z) {
  final byte[] s = new byte[BLOCK_SIZE];
  final KeyParameter encKey = new KeyParameter(key);
  final BlockCipher cipher = new AESEngine();
  cipher.init(true, encKey);
  cipher.processBlock(z, 0, s, 0);
  return s;
}
origin: com.itextpdf/itextg

/** Creates a new instance of AESCipher */
public AESCipherCBCnoPad(boolean forEncryption, byte[] key) {
  BlockCipher aes = new AESFastEngine();
  cbc = new CBCBlockCipher(aes);
  KeyParameter kp = new KeyParameter(key);
  cbc.init(forEncryption, kp);
}

origin: com.madgag/sc-light-jdk15on

protected void initCipher(boolean forEncryption, BlockCipher cipher, byte[] key_block,
  int key_size, int key_offset, int iv_offset)
{
  KeyParameter key_parameter = new KeyParameter(key_block, key_offset, key_size);
  ParametersWithIV parameters_with_iv = new ParametersWithIV(key_parameter, key_block,
    iv_offset, cipher.getBlockSize());
  cipher.init(forEncryption, parameters_with_iv);
}
origin: com.madgag.spongycastle/core

/**
 * Standard constructor
 */
public GOST3411Digest()
{
  sBox = GOST28147Engine.getSBox("D-A");
  cipher.init(true, new ParametersWithSBox(null, sBox));
  reset();
}
origin: com.madgag/sc-light-jdk15on

/**
 * Standard constructor
 */
public GOST3411Digest()
{
  sBox = GOST28147Engine.getSBox("D-A");
  cipher.init(true, new ParametersWithSBox(null, sBox));
  reset();
}
origin: com.madgag.spongycastle/core

private void BCC(byte[] bccOut, byte[] k, byte[] iV, byte[] data)
{
  int outlen = _engine.getBlockSize();
  byte[] chainingValue = new byte[outlen]; // initial values = 0
  int n = data.length / outlen;
  byte[] inputBlock = new byte[outlen];
  _engine.init(true, new KeyParameter(expandKey(k)));
  _engine.processBlock(iV, 0, chainingValue, 0);
  for (int i = 0; i < n; i++)
  {
    XOR(inputBlock, chainingValue, data, i*outlen);
    _engine.processBlock(inputBlock, 0, chainingValue, 0);
  }
  System.arraycopy(chainingValue, 0, bccOut, 0, bccOut.length);
}
origin: com.madgag.spongycastle/core

public void init(CipherParameters params)
{
  validate(params);
  cipher.init(true, params);
  //initializes the L, Lu, Lu2 numbers
  byte[] L = new byte[ZEROES.length];
  cipher.processBlock(ZEROES, 0, L, 0);
  Lu = doubleLu(L);
  Lu2 = doubleLu(Lu);
  reset();
}
org.spongycastle.cryptoBlockCipherinit

Javadoc

Initialise the cipher.

Popular methods of BlockCipher

  • getBlockSize
    Return the block size for this cipher (in bytes).
  • processBlock
    Process one block of input from the array in and write it to the out array.
  • getAlgorithmName
    Return the name of the algorithm the cipher implements.
  • reset
    Reset the cipher. After resetting the cipher is in the same state as it was after the last init (if

Popular in Java

  • Finding current android device location
  • runOnUiThread (Activity)
  • getResourceAsStream (ClassLoader)
    Returns a stream for the resource with the specified name. See #getResource(String) for a descriptio
  • requestLocationUpdates (LocationManager)
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • IOException (java.io)
    Signals that an I/O exception of some sort has occurred. This class is the general class of exceptio
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
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