本文整理汇总了Java中org.bouncycastle.crypto.OutputLengthException类的典型用法代码示例。如果您正苦于以下问题:Java OutputLengthException类的具体用法?Java OutputLengthException怎么用?Java OutputLengthException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
OutputLengthException类属于org.bouncycastle.crypto包,在下文中一共展示了OutputLengthException类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: processBlock
import org.bouncycastle.crypto.OutputLengthException; //导入依赖的package包/类
public int processBlock(
byte[] in,
int inOff,
byte[] out,
int outOff)
{
int blockSize = getBlockSize();
if (_S == null)
{
throw new IllegalStateException("RC6 engine not initialised");
}
if ((inOff + blockSize) > in.length)
{
throw new DataLengthException("input buffer too short");
}
if ((outOff + blockSize) > out.length)
{
throw new OutputLengthException("output buffer too short");
}
return (forEncryption)
? encryptBlock(in, inOff, out, outOff)
: decryptBlock(in, inOff, out, outOff);
}
示例2: processBlock
import org.bouncycastle.crypto.OutputLengthException; //导入依赖的package包/类
public int processBlock(
byte[] in,
int inOff,
byte[] out,
int outOff)
{
if (!_initialised)
{
throw new IllegalStateException(getAlgorithmName()+" not initialised");
}
if ((inOff + block_size) > in.length)
{
throw new DataLengthException("input buffer too short");
}
if ((outOff + block_size) > out.length)
{
throw new OutputLengthException("output buffer too short");
}
return (_forEncryption) ? encryptBlock(in, inOff, out, outOff)
: decryptBlock(in, inOff, out, outOff);
}
示例3: processBytes
import org.bouncycastle.crypto.OutputLengthException; //导入依赖的package包/类
public void processBytes(byte[] in, int inOff, int len, byte[] out,
int outOff)
throws DataLengthException
{
if (!initialised)
{
throw new IllegalStateException(getAlgorithmName()
+ " not initialised");
}
if ((inOff + len) > in.length)
{
throw new DataLengthException("input buffer too short");
}
if ((outOff + len) > out.length)
{
throw new OutputLengthException("output buffer too short");
}
for (int i = 0; i < len; i++)
{
out[outOff + i] = (byte)(in[inOff + i] ^ getKeyStream());
}
}
示例4: processBlock
import org.bouncycastle.crypto.OutputLengthException; //导入依赖的package包/类
public int processBlock(byte[] in, int inOff, byte[] out, int outOff)
throws DataLengthException, IllegalStateException
{
if (!initialised)
{
throw new IllegalStateException("Null engine not initialised");
}
if ((inOff + BLOCK_SIZE) > in.length)
{
throw new DataLengthException("input buffer too short");
}
if ((outOff + BLOCK_SIZE) > out.length)
{
throw new OutputLengthException("output buffer too short");
}
for (int i = 0; i < BLOCK_SIZE; ++i)
{
out[outOff + i] = in[inOff + i];
}
return BLOCK_SIZE;
}
示例5: processBlock
import org.bouncycastle.crypto.OutputLengthException; //导入依赖的package包/类
public int processBlock(
byte[] in,
int inOff,
byte[] out,
int outOff)
{
if (workingKey == null)
{
throw new IllegalStateException("DES engine not initialised");
}
if ((inOff + BLOCK_SIZE) > in.length)
{
throw new DataLengthException("input buffer too short");
}
if ((outOff + BLOCK_SIZE) > out.length)
{
throw new OutputLengthException("output buffer too short");
}
desFunc(workingKey, in, inOff, out, outOff);
return BLOCK_SIZE;
}
示例6: processBlock
import org.bouncycastle.crypto.OutputLengthException; //导入依赖的package包/类
public int processBlock(
byte[] in,
int inOff,
byte[] out,
int outOff)
{
if (workingKey == null)
{
throw new IllegalStateException("IDEA engine not initialised");
}
if ((inOff + BLOCK_SIZE) > in.length)
{
throw new DataLengthException("input buffer too short");
}
if ((outOff + BLOCK_SIZE) > out.length)
{
throw new OutputLengthException("output buffer too short");
}
ideaFunc(workingKey, in, inOff, out, outOff);
return BLOCK_SIZE;
}
示例7: processBytes
import org.bouncycastle.crypto.OutputLengthException; //导入依赖的package包/类
public void processBytes(byte[] in, int inOff, int len, byte[] out,
int outOff) throws DataLengthException
{
if (!initialised)
{
throw new IllegalStateException(getAlgorithmName()
+ " not initialised");
}
if ((inOff + len) > in.length)
{
throw new DataLengthException("input buffer too short");
}
if ((outOff + len) > out.length)
{
throw new OutputLengthException("output buffer too short");
}
for (int i = 0; i < len; i++)
{
out[outOff + i] = (byte)(in[inOff + i] ^ getByte());
}
}
示例8: processBlock
import org.bouncycastle.crypto.OutputLengthException; //导入依赖的package包/类
public int processBlock(
byte[] in,
int inOff,
byte[] out,
int outOff)
{
if (!_initialised)
{
throw new IllegalStateException(getAlgorithmName()+" not initialised");
}
if ((inOff + genericSize) > in.length)
{
throw new DataLengthException("input buffer too short");
}
if ((outOff + genericSize) > out.length)
{
throw new OutputLengthException("output buffer too short");
}
return (_forEncryption) ? encryptBlock(in, inOff, out, outOff)
: decryptBlock(in, inOff, out, outOff);
}
示例9: processBlock
import org.bouncycastle.crypto.OutputLengthException; //导入依赖的package包/类
public int processBlock(
byte[] in,
int inOff,
byte[] out,
int outOff)
{
if (workingKey == null)
{
throw new IllegalStateException("GOST28147 engine not initialised");
}
if ((inOff + BLOCK_SIZE) > in.length)
{
throw new DataLengthException("input buffer too short");
}
if ((outOff + BLOCK_SIZE) > out.length)
{
throw new OutputLengthException("output buffer too short");
}
GOST28147Func(workingKey, in, inOff, out, outOff);
return BLOCK_SIZE;
}
示例10: processBlock
import org.bouncycastle.crypto.OutputLengthException; //导入依赖的package包/类
public int processBlock(
byte[] in,
int inOff,
byte[] out,
int outOff)
{
if (!_initialised)
{
throw new IllegalStateException(getAlgorithmName()+" not initialised");
}
if ((inOff + block_size) > in.length)
{
throw new DataLengthException("input buffer too short");
}
if ((outOff + block_size) > out.length)
{
throw new OutputLengthException("output buffer too short");
}
return (_forEncryption) ? encryptBlock(in, inOff, out, outOff)
: decryptBlock(in, inOff, out, outOff);
}
示例11: processBlock
import org.bouncycastle.crypto.OutputLengthException; //导入依赖的package包/类
public int processBlock(byte[] in, int inOff, byte[] out, int outOff)
throws DataLengthException, IllegalStateException
{
if (!initialised)
{
throw new IllegalStateException("Null engine not initialised");
}
if ((inOff + blockSize) > in.length)
{
throw new DataLengthException("input buffer too short");
}
if ((outOff + blockSize) > out.length)
{
throw new OutputLengthException("output buffer too short");
}
for (int i = 0; i < blockSize; ++i)
{
out[outOff + i] = in[inOff + i];
}
return blockSize;
}
示例12: processBytes
import org.bouncycastle.crypto.OutputLengthException; //导入依赖的package包/类
public int processBytes(byte[] in, int inOff, int len, byte[] out,
int outOff) throws DataLengthException
{
if (!initialised)
{
throw new IllegalStateException(getAlgorithmName()
+ " not initialised");
}
if ((inOff + len) > in.length)
{
throw new DataLengthException("input buffer too short");
}
if ((outOff + len) > out.length)
{
throw new OutputLengthException("output buffer too short");
}
for (int i = 0; i < len; i++)
{
out[outOff + i] = (byte)(in[inOff + i] ^ getByte());
}
return len;
}
示例13: outputBlock
import org.bouncycastle.crypto.OutputLengthException; //导入依赖的package包/类
private void outputBlock(byte[] output, int offset)
{
if (output.length < (offset + BLOCK_SIZE))
{
throw new OutputLengthException("Output buffer too short");
}
if (totalLength == 0)
{
initCipher();
}
gCTRBlock(bufBlock, output, offset);
if (forEncryption)
{
bufOff = 0;
}
else
{
System.arraycopy(bufBlock, BLOCK_SIZE, bufBlock, 0, macSize);
bufOff = macSize;
}
}