de.flexiprovider.pqc.ecc.mceliece
Class McElieceCCA2PrivateKey
java.lang.Object
|
+--de.flexiprovider.api.keys.PrivateKey
|
+--de.flexiprovider.pqc.ecc.mceliece.McElieceCCA2PrivateKey
- All Implemented Interfaces:
- java.security.Key, Key, java.security.PrivateKey, java.io.Serializable
- public class McElieceCCA2PrivateKey
- extends PrivateKey
This class implements a McEliece CCA2 private key and is usually instantiated
by the McElieceCCA2KeyPairGenerator or McElieceCCA2KeyFactory.
- Author:
- Elena Klintsevich, Martin Döring
- See Also:
McElieceCCA2KeyPairGenerator, Serialized Form
| Fields inherited from interface java.security.Key |
serialVersionUID |
| Fields inherited from interface java.security.PrivateKey |
serialVersionUID |
| Methods inherited from class java.lang.Object |
, clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
McElieceCCA2PrivateKey
protected McElieceCCA2PrivateKey(int n,
int k,
GF2mField field,
PolynomialGF2mSmallM gp,
Permutation p,
GF2Matrix h,
PolynomialGF2mSmallM[] qInv)
- Constructor (used by the
McElieceCCA2KeyPairGenerator).
- Parameters:
n - the length of the codek - the dimension of the codefield - the field polynomialgp - the irreducible Goppa polynomialp - the permutationh - the canonical check matrixqInv - the matrix used to compute square roots in
(GF(2^m))^t
McElieceCCA2PrivateKey
protected McElieceCCA2PrivateKey(McElieceCCA2PrivateKeySpec keySpec)
- Constructor (used by the
McElieceCCA2KeyFactory).
- Parameters:
keySpec - a McElieceCCA2PrivateKeySpec
getAlgorithm
public java.lang.String getAlgorithm()
- Return the name of the algorithm.
- Returns:
- "McEliece"
getN
protected int getN()
- Returns:
- the length of the code
getK
protected int getK()
- Returns:
- the dimension of the code
getT
protected int getT()
- Returns:
- the degree of the Goppa polynomial (error correcting capability)
getField
protected GF2mField getField()
- Returns:
- the finite field
getGoppaPoly
protected PolynomialGF2mSmallM getGoppaPoly()
- Returns:
- the irreducible Goppa polynomial
getP
protected Permutation getP()
- Returns:
- the permutation vector
getH
protected GF2Matrix getH()
- Returns:
- the canonical check matrix
getQInv
protected PolynomialGF2mSmallM[] getQInv()
- Returns:
- the matrix used to compute square roots in (GF(2^m))^t
toString
public java.lang.String toString()
- Overrides:
toString in class java.lang.Object
- Returns:
- a human readable form of the key
equals
public boolean equals(java.lang.Object other)
- Compare this key with another object.
- Overrides:
equals in class java.lang.Object
- Parameters:
other - the other object- Returns:
- the result of the comparison
hashCode
public int hashCode()
- Overrides:
hashCode in class java.lang.Object
- Returns:
- the hash code of this key
getOID
protected codec.asn1.ASN1ObjectIdentifier getOID()
- Overrides:
getOID in class PrivateKey
- Returns:
- the OID to encode in the SubjectPublicKeyInfo structure
getAlgParams
protected codec.asn1.ASN1Type getAlgParams()
- Overrides:
getAlgParams in class PrivateKey
- Returns:
- the algorithm parameters to encode in the SubjectPublicKeyInfo
structure
getKeyData
protected byte[] getKeyData()
- Return the keyData to encode in the SubjectPublicKeyInfo structure.
The ASN.1 definition of the key structure is
McEliecePrivateKey ::= SEQUENCE {
m INTEGER -- extension degree of the field
k INTEGER -- dimension of the code
field OCTET STRING -- field polynomial
goppaPoly OCTET STRING -- irreducible Goppa polynomial
p OCTET STRING -- permutation vector
matrixH OCTET STRING -- canonical check matrix
sqRootMatrix SEQUENCE OF OCTET STRING -- square root matrix
}
- Overrides:
getKeyData in class PrivateKey
- Returns:
- the keyData to encode in the SubjectPublicKeyInfo structure