public class McElieceCipher extends java.lang.Object implements MessageEncryptor
Modifier and Type | Field and Description |
---|---|
int |
cipherTextSize |
int |
maxPlainTextSize |
static java.lang.String |
OID
The OID of the algorithm.
|
Constructor and Description |
---|
McElieceCipher() |
Modifier and Type | Method and Description |
---|---|
int |
getKeySize(McElieceKeyParameters key)
Return the key size of the given key object.
|
void |
init(boolean forEncryption,
CipherParameters param) |
void |
initCipherDecrypt(McEliecePrivateKeyParameters privKey) |
void |
initCipherEncrypt(McEliecePublicKeyParameters pubKey) |
byte[] |
messageDecrypt(byte[] input)
Decrypt a cipher text.
|
byte[] |
messageEncrypt(byte[] input)
Encrypt a plain text.
|
public static final java.lang.String OID
public int maxPlainTextSize
public int cipherTextSize
public void init(boolean forEncryption, CipherParameters param)
init
in interface MessageEncryptor
forEncryption
- true if we are encrypting a signature, false
otherwise.param
- key parameters for encryption or decryption.public int getKeySize(McElieceKeyParameters key)
key
- the McElieceKeyParameters objectpublic void initCipherEncrypt(McEliecePublicKeyParameters pubKey)
public void initCipherDecrypt(McEliecePrivateKeyParameters privKey)
public byte[] messageEncrypt(byte[] input)
messageEncrypt
in interface MessageEncryptor
input
- the plain textpublic byte[] messageDecrypt(byte[] input) throws InvalidCipherTextException
messageDecrypt
in interface MessageEncryptor
input
- the cipher textjava.lang.Exception
- if the cipher text is invalid.InvalidCipherTextException