Tabnine Logo
BlockCipher.init
Code IndexAdd Tabnine 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)

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

  • Parsing JSON documents to java classes using gson
  • requestLocationUpdates (LocationManager)
  • compareTo (BigDecimal)
  • addToBackStack (FragmentTransaction)
  • BufferedInputStream (java.io)
    A BufferedInputStream adds functionality to another input stream-namely, the ability to buffer the i
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • CodeWhisperer alternatives
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