Class BCMcElieceCCA2PrivateKey
- java.lang.Object
-
- org.bouncycastle.pqc.jcajce.provider.mceliece.BCMcElieceCCA2PrivateKey
-
- All Implemented Interfaces:
java.io.Serializable,java.security.Key,java.security.PrivateKey,javax.security.auth.Destroyable
public class BCMcElieceCCA2PrivateKey extends java.lang.Object implements java.security.PrivateKeyThis class implements a McEliece CCA2 private key and is usually instantiated by theMcElieceCCA2KeyPairGeneratororMcElieceCCA2KeyFactorySpi.- See Also:
McElieceCCA2KeyPairGenerator, Serialized Form
-
-
Constructor Summary
Constructors Constructor Description BCMcElieceCCA2PrivateKey(McElieceCCA2PrivateKeyParameters params)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object other)Compare this key with another object.java.lang.StringgetAlgorithm()Return the name of the algorithm.byte[]getEncoded()Return the keyData to encode in the SubjectPublicKeyInfo structure.GF2mFieldgetField()java.lang.StringgetFormat()PolynomialGF2mSmallMgetGoppaPoly()GF2MatrixgetH()intgetK()intgetN()PermutationgetP()PolynomialGF2mSmallM[]getQInv()intgetT()inthashCode()
-
-
-
Constructor Detail
-
BCMcElieceCCA2PrivateKey
public BCMcElieceCCA2PrivateKey(McElieceCCA2PrivateKeyParameters params)
-
-
Method Detail
-
getAlgorithm
public java.lang.String getAlgorithm()
Return the name of the algorithm.- Specified by:
getAlgorithmin interfacejava.security.Key- Returns:
- "McEliece-CCA2"
-
getN
public int getN()
- Returns:
- the length of the code
-
getK
public int getK()
- Returns:
- the dimension of the code
-
getT
public int getT()
- Returns:
- the degree of the Goppa polynomial (error correcting capability)
-
getField
public GF2mField getField()
- Returns:
- the finite field
-
getGoppaPoly
public PolynomialGF2mSmallM getGoppaPoly()
- Returns:
- the irreducible Goppa polynomial
-
getP
public Permutation getP()
- Returns:
- the permutation vector
-
getH
public GF2Matrix getH()
- Returns:
- the canonical check matrix
-
getQInv
public PolynomialGF2mSmallM[] getQInv()
- Returns:
- the matrix used to compute square roots in (GF(2^m))^t
-
equals
public boolean equals(java.lang.Object other)
Compare this key with another object.- Overrides:
equalsin classjava.lang.Object- Parameters:
other- the other object- Returns:
- the result of the comparison
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object- Returns:
- the hash code of this key
-
getEncoded
public byte[] getEncoded()
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 }- Specified by:
getEncodedin interfacejava.security.Key- Returns:
- the keyData to encode in the SubjectPublicKeyInfo structure
-
getFormat
public java.lang.String getFormat()
- Specified by:
getFormatin interfacejava.security.Key
-
-