org.bouncycastle.util.Arrays.fill()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(4.2k)|赞(0)|评价(0)|浏览(173)

本文整理了Java中org.bouncycastle.util.Arrays.fill()方法的一些代码示例,展示了Arrays.fill()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Arrays.fill()方法的具体详情如下:
包路径:org.bouncycastle.util.Arrays
类名称:Arrays
方法名:fill

Arrays.fill介绍

暂无

代码示例

代码示例来源:origin: freenet/fred

protected void clear(byte[] bs)
{
  if (bs != null)
  {
    Arrays.fill(bs, (byte)0);
  }
}

代码示例来源:origin: org.bouncycastle/bcprov-debug-jdk15on

private static byte[] genPad(byte b, int count)
  {
    byte[] padding = new byte[count];
    Arrays.fill(padding, b);
    return padding;
  }
}

代码示例来源:origin: org.bouncycastle/bcprov-debug-jdk15on

/**
 * Overwrite the key if it is no longer used (zeroization).
 */
public void clearKey()
{
  if (key != null)
  {
    Arrays.fill(key, (byte)0);
    Arrays.fill(buffer, (byte)0);
  }
}

代码示例来源:origin: org.bouncycastle/bcprov-debug-jdk15on

public void reset()
{
  Arrays.fill(state, 0L);
  state[0] = blockSize;
  inputBlocks = 0;
  bufOff = 0;
}

代码示例来源:origin: org.bouncycastle/bcprov-debug-jdk15on

private static void Clear(byte[] array)
{
  if (array != null)
  {
    Arrays.fill(array, (byte)0);
  }
}

代码示例来源:origin: org.bouncycastle/bcprov-debug-jdk15on

private static void Clear(int[] array)
{
  if (array != null)
  {
    Arrays.fill(array, 0);
  }
}

代码示例来源:origin: redfish64/TinyTravelTracker

private static void Clear(int[] array)
{
  if (array != null)
  {
    Arrays.fill(array, 0);
  }
}

代码示例来源:origin: org.bouncycastle/bcprov-debug-jdk15on

private static byte[][] genSSL3Const()
{
  int n = 10;
  byte[][] arr = new byte[n][];
  for (int i = 0; i < n; i++)
  {
    byte[] b = new byte[i + 1];
    Arrays.fill(b, (byte)('A' + i));
    arr[i] = b;
  }
  return arr;
}

代码示例来源:origin: org.bouncycastle/bcprov-debug-jdk15on

/**
 * Clear the internals
 */
public void clear()
{
  Arrays.fill(transcript, (byte)0);
  tOut.clear();
}

代码示例来源:origin: org.bouncycastle/bcprov-debug-jdk15on

private void encodeValue(BigInteger n, BigInteger x, byte[] buf, int off, int len)
  {
    byte[] bs = checkValue(n, x).toByteArray();
    int bsOff = Math.max(0, bs.length - len);
    int bsLen = bs.length - bsOff;

    int pos = len - bsLen;
    Arrays.fill(buf, off, off + pos, (byte)0);
    System.arraycopy(bs, bsOff, buf, off + pos, bsLen);
  }
}

代码示例来源:origin: redfish64/TinyTravelTracker

/**
   * reset the chaining vector back to the IV and reset the underlying
   * cipher.
   */
  public void reset()
  {
    System.arraycopy(IV, 0, cfbV, 0, IV.length);
    Arrays.fill(inBuf, (byte)0);
    byteCount = 0;

    cipher.reset();
  }
}

代码示例来源:origin: org.bouncycastle/bcprov-debug-jdk15on

protected byte[] engineGenerateSecret()
  throws IllegalStateException
{
  byte[] rv = Arrays.clone(shared);
  Arrays.fill(shared, (byte)0);
  return rv;
}

代码示例来源:origin: org.bouncycastle/bcprov-debug-jdk15on

public void erase()
  {
    Arrays.fill(this.buf, (byte)0);
    reset();
  }
}

代码示例来源:origin: org.bouncycastle/bcprov-debug-jdk15on

private void reset()
{
  // Reset memory.
  for (int i = 0; i < memory.length; i++)
  {
    Block b = memory[i];
    b.clear();
  }
  memory = null;
  Arrays.fill(result, (byte)0);
  doInit(parameters);
}

代码示例来源:origin: org.bouncycastle/bcprov-debug-jdk15on

protected KeyParameter generateRecordMACKey(StreamCipher cipher)
{
  byte[] firstBlock = new byte[64];
  cipher.processBytes(firstBlock, 0, firstBlock.length, firstBlock, 0);
  KeyParameter macKey = new KeyParameter(firstBlock, 0, 32);
  Arrays.fill(firstBlock, (byte)0);
  return macKey;
}

代码示例来源:origin: redfish64/TinyTravelTracker

private static void updateMac(Mac mac, String string)
{
  byte[] byteArray = Strings.toUTF8ByteArray(string);
  mac.update(byteArray, 0, byteArray.length);
  Arrays.fill(byteArray, (byte)0);
}

代码示例来源:origin: org.bouncycastle/bcprov-debug-jdk15on

private void processFilledBuffer(byte[] in, int inOff)
{
  // copies into the block...
  for (int i = 0; i < _state.length; i++)
  {
    _block[i] = bytesToLongFromBuffer(_buffer, i * 8);
  }
  processBlock();
  _bufferPos = 0;
  Arrays.fill(_buffer, (byte)0);
}

代码示例来源:origin: org.bouncycastle/bcprov-debug-jdk15on

public void reset()
{
  Arrays.fill(b, 0L);
  engine.reset();
  data.reset();
  associatedText.reset();
  if (initialAssociatedText != null)
  {
    processAADBytes(initialAssociatedText, 0, initialAssociatedText.length);
  }
}

代码示例来源:origin: org.bouncycastle/bcprov-debug-jdk15on

private static void updateDigestIncludingSize(Digest digest, BigInteger bigInteger)
{
  byte[] byteArray = BigIntegers.asUnsignedByteArray(bigInteger);
  digest.update(intToByteArray(byteArray.length), 0, 4);
  digest.update(byteArray, 0, byteArray.length);
  Arrays.fill(byteArray, (byte)0);
}

代码示例来源:origin: redfish64/TinyTravelTracker

private static void updateDigestIncludingSize(Digest digest, BigInteger bigInteger)
{
  byte[] byteArray = BigIntegers.asUnsignedByteArray(bigInteger);
  digest.update(intToByteArray(byteArray.length), 0, 4);
  digest.update(byteArray, 0, byteArray.length);
  Arrays.fill(byteArray, (byte)0);
}

相关文章