public class CramerShoupCoreEngine
extends java.lang.Object
Modifier and Type | Class | Description |
---|---|---|
static class |
CramerShoupCoreEngine.CramerShoupCiphertextException |
CS exception for wrong cipher-texts
|
Constructor | Description |
---|---|
CramerShoupCoreEngine() |
Modifier and Type | Method | Description |
---|---|---|
java.math.BigInteger |
convertInput(byte[] in,
int inOff,
int inLen) |
|
byte[] |
convertOutput(java.math.BigInteger result) |
|
java.math.BigInteger |
decryptBlock(CramerShoupCiphertext input) |
|
CramerShoupCiphertext |
encryptBlock(java.math.BigInteger input) |
|
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 CramerShoup engine.
|
void |
init(boolean forEncryption,
CipherParameters param,
java.lang.String label) |
initialise the CramerShoup engine.
|
protected java.security.SecureRandom |
initSecureRandom(boolean needed,
java.security.SecureRandom provided) |
public void init(boolean forEncryption, CipherParameters param, java.lang.String label)
forEncryption
- whether this engine should encrypt or decryptparam
- the necessary CramerShoup key parameters.label
- the label for labelled CS as String
public void init(boolean forEncryption, CipherParameters param)
forEncryption
- whether this engine should encrypt or decryptparam
- the necessary CramerShoup key parameters.public int getInputBlockSize()
public int getOutputBlockSize()
public java.math.BigInteger convertInput(byte[] in, int inOff, int inLen)
public byte[] convertOutput(java.math.BigInteger result)
public CramerShoupCiphertext encryptBlock(java.math.BigInteger input)
public java.math.BigInteger decryptBlock(CramerShoupCiphertext input) throws CramerShoupCoreEngine.CramerShoupCiphertextException
protected java.security.SecureRandom initSecureRandom(boolean needed, java.security.SecureRandom provided)