本文整理汇总了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);
}
开发者ID:Appdome,项目名称:ipack,代码行数:25,代码来源:RC6Engine.java
示例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);
}
开发者ID:Appdome,项目名称:ipack,代码行数:25,代码来源:XTEAEngine.java
示例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());
}
}
开发者ID:Appdome,项目名称:ipack,代码行数:26,代码来源:Grain128Engine.java
示例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;
}
开发者ID:Appdome,项目名称:ipack,代码行数:25,代码来源:NullEngine.java
示例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;
}
开发者ID:Appdome,项目名称:ipack,代码行数:26,代码来源:DESEngine.java
示例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;
}
开发者ID:Appdome,项目名称:ipack,代码行数:26,代码来源:IDEAEngine.java
示例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());
}
}
开发者ID:Appdome,项目名称:ipack,代码行数:25,代码来源:HC128Engine.java
示例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);
}
开发者ID:Appdome,项目名称:ipack,代码行数:25,代码来源:NoekeonEngine.java
示例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;
}
开发者ID:Appdome,项目名称:ipack,代码行数:26,代码来源:GOST28147Engine.java
示例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);
}
开发者ID:Appdome,项目名称:ipack,代码行数:25,代码来源:TEAEngine.java
示例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;
}
开发者ID:ttt43ttt,项目名称:gwt-crypto,代码行数:25,代码来源:NullEngine.java
示例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;
}
开发者ID:ttt43ttt,项目名称:gwt-crypto,代码行数:27,代码来源:HC128Engine.java
示例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;
}
}
开发者ID:ttt43ttt,项目名称:gwt-crypto,代码行数:22,代码来源:GCMBlockCipher.java
注:本文中的org.bouncycastle.crypto.OutputLengthException类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论