Class BCMcEliecePrivateKey
java.lang.Object
org.bouncycastle.pqc.jcajce.provider.mceliece.BCMcEliecePrivateKey
- All Implemented Interfaces:
Serializable
,Key
,PrivateKey
,Destroyable
,CipherParameters
This class implements a McEliece private key and is usually instantiated by
the
McElieceKeyPairGenerator
or McElieceKeyFactorySpi
.- See Also:
-
Constructor Details
-
BCMcEliecePrivateKey
-
-
Method Details
-
getAlgorithm
Return the name of the algorithm.- Specified by:
getAlgorithm
in interfaceKey
- Returns:
- "McEliece"
-
getN
public int getN()- Returns:
- the length of the code
-
getK
public int getK()- Returns:
- the dimension of the code
-
getField
- Returns:
- the finite field
-
getGoppaPoly
- Returns:
- the irreducible Goppa polynomial
-
getSInv
- Returns:
- the k x k random binary non-singular matrix S
-
getP1
- Returns:
- the permutation used to generate the systematic check matrix
-
getP2
- Returns:
- the permutation used to compute the public generator matrix
-
getH
- Returns:
- the canonical check matrix
-
getQInv
- Returns:
- the matrix for computing square roots in (GF(2^m))^t
-
equals
Compare this key with another object. -
hashCode
public int hashCode() -
getEncoded
public byte[] getEncoded()Return the key data to encode in the SubjectPublicKeyInfo structure.The ASN.1 definition of the key structure is
McEliecePrivateKey ::= SEQUENCE { n INTEGER -- length of the code k INTEGER -- dimension of the code fieldPoly OCTET STRING -- field polynomial defining GF(2ˆm) getGoppaPoly() OCTET STRING -- irreducible Goppa polynomial sInv OCTET STRING -- matrix Sˆ-1 p1 OCTET STRING -- permutation P1 p2 OCTET STRING -- permutation P2 h OCTET STRING -- canonical check matrix qInv SEQUENCE OF OCTET STRING -- matrix used to compute square roots }
- Specified by:
getEncoded
in interfaceKey
- Returns:
- the key data to encode in the SubjectPublicKeyInfo structure
-
getFormat
-