|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.bouncycastle.crypto.engines.ElGamalEngine
public class ElGamalEngine
this does your basic ElGamal algorithm.
| Field Summary | |
|---|---|
private int |
bitSize
|
private boolean |
forEncryption
|
private ElGamalKeyParameters |
key
|
private static java.math.BigInteger |
ONE
|
private java.security.SecureRandom |
random
|
private static java.math.BigInteger |
TWO
|
private static java.math.BigInteger |
ZERO
|
| Constructor Summary | |
|---|---|
ElGamalEngine()
|
|
| Method Summary | |
|---|---|
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private ElGamalKeyParameters key
private java.security.SecureRandom random
private boolean forEncryption
private int bitSize
private static final java.math.BigInteger ZERO
private static final java.math.BigInteger ONE
private static final java.math.BigInteger TWO
| Constructor Detail |
|---|
public ElGamalEngine()
| Method Detail |
|---|
public void init(boolean forEncryption,
CipherParameters param)
init in interface AsymmetricBlockCipherforEncryption - true if we are encrypting, false otherwise.param - the necessary ElGamal key parameters.public int getInputBlockSize()
getInputBlockSize in interface AsymmetricBlockCipherpublic int getOutputBlockSize()
getOutputBlockSize in interface AsymmetricBlockCipherpublic byte[] processBlock(byte[] in,
int inOff,
int inLen)
processBlock in interface AsymmetricBlockCipherin - the input array.inOff - the offset into the input buffer where the data starts.inLen - the length of the data to be processed.
DataLengthException - the input block is too large.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||