📄 streamblockcipher.java
字号:
// Decompiled by Jad v1.5.8e2. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://kpdus.tripod.com/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi space
// Source File Name: StreamBlockCipher.java
package org.bouncycastle.crypto;
// Referenced classes of package org.bouncycastle.crypto:
// BlockCipher, DataLengthException, StreamCipher, CipherParameters
public class StreamBlockCipher
implements StreamCipher
{
private BlockCipher cipher;
private byte oneByte[];
public StreamBlockCipher(BlockCipher cipher)
{
oneByte = new byte[1];
if (cipher.getBlockSize() != 1)
{
throw new IllegalArgumentException("block cipher block size != 1.");
} else
{
this.cipher = cipher;
return;
}
}
public void init(boolean forEncryption, CipherParameters params)
{
cipher.init(forEncryption, params);
}
public String getAlgorithmName()
{
return cipher.getAlgorithmName();
}
public byte returnByte(byte in)
{
oneByte[0] = in;
cipher.processBlock(oneByte, 0, oneByte, 0);
return oneByte[0];
}
public void processBytes(byte in[], int inOff, int len, byte out[], int outOff)
throws DataLengthException
{
if (outOff + len > out.length)
throw new DataLengthException("output buffer too small in processBytes()");
for (int i = 0; i != len; i++)
cipher.processBlock(in, inOff + i, out, outOff + i);
}
public void reset()
{
cipher.reset();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -