org.bouncycastle.crypto.engines
Class ElGamalEngine
java.lang.Object
org.bouncycastle.crypto.engines.ElGamalEngine
- AsymmetricBlockCipher
public class ElGamalEngine
extends java.lang.Object
this does your basic ElGamal algorithm.
int | getInputBlockSize() - Return the maximum size for an input block to this engine.
|
int | getOutputBlockSize() - Return the maximum size for an output block to this engine.
|
void | init(boolean forEncryption, CipherParameters param) - initialise the ElGamal engine.
|
byte[] | processBlock(byte[] in, int inOff, int inLen) - Process a single block using the basic ElGamal algorithm.
|
getInputBlockSize
public int getInputBlockSize()
Return the maximum size for an input block to this engine.
For ElGamal this is always one byte less than the size of P on
encryption, and twice the length as the size of P on decryption.
- getInputBlockSize in interface AsymmetricBlockCipher
- maximum size for an input block.
getOutputBlockSize
public int getOutputBlockSize()
Return the maximum size for an output block to this engine.
For ElGamal this is always one byte less than the size of P on
decryption, and twice the length as the size of P on encryption.
- getOutputBlockSize in interface AsymmetricBlockCipher
- maximum size for an output block.
init
public void init(boolean forEncryption,
CipherParameters param)
initialise the ElGamal engine.
- init in interface AsymmetricBlockCipher
forEncryption
- true if we are encrypting, false otherwise.param
- the necessary ElGamal key parameters.
processBlock
public byte[] processBlock(byte[] in,
int inOff,
int inLen)
Process a single block using the basic ElGamal algorithm.
- processBlock in interface AsymmetricBlockCipher
in
- the input array.inOff
- the offset into the input buffer where the data starts.inLen
- the length of the data to be processed.
- the result of the ElGamal process.