Top Description Fields Constructors Methods
org.bouncycastle.pqc.jcajce.provider.mceliece

public Class BCMcElieceCCA2PrivateKey

extends Object
implements PrivateKey
Class Inheritance
All Implemented Interfaces
java.security.PrivateKey, javax.security.auth.Destroyable, java.security.AsymmetricKey, java.security.Key, java.io.Serializable
Imports
java.io.IOException, .ObjectInputStream, .ObjectOutputStream, java.security.PrivateKey, org.bouncycastle.asn1.pkcs.PrivateKeyInfo, org.bouncycastle.asn1.x509.AlgorithmIdentifier, org.bouncycastle.crypto.params.AsymmetricKeyParameter, org.bouncycastle.jcajce.util.MessageDigestUtils, org.bouncycastle.pqc.asn1.McElieceCCA2PrivateKey, .PQCObjectIdentifiers, org.bouncycastle.pqc.crypto.util.PrivateKeyFactory, org.bouncycastle.pqc.legacy.crypto.mceliece.McElieceCCA2KeyPairGenerator, .McElieceCCA2PrivateKeyParameters, org.bouncycastle.pqc.legacy.math.linearalgebra.GF2Matrix, .GF2mField, .Permutation, .PolynomialGF2mSmallM

This class implements a McEliece CCA2 private key and is usually instantiated by the McElieceCCA2KeyPairGenerator or McElieceCCA2KeyFactorySpi.
See Also
McElieceCCA2KeyPairGenerator

Field Summary

Modifier and TypeField and Description
private transient McElieceCCA2PrivateKeyParameters
private static final long

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

the result of the comparison
equals
(Object
the other object
other
)

Overrides java.lang.Object.equals.

Compare this key with another object.

public String

Returns:

"McEliece-CCA2"
getAlgorithm
()

Implements java.security.Key.getAlgorithm.

Return the name of the algorithm.

public byte[]

Returns:

the keyData to encode in the SubjectPublicKeyInfo structure
getEncoded
()

Implements java.security.Key.getEncoded.

Return the keyData to encode in the SubjectPublicKeyInfo structure.

public GF2mField

Returns:

the finite field
getField
()

public String
getFormat()

Implements java.security.Key.getFormat.

Returns the name of the primary encoding format of this key, or null if this key does not support encoding.

public PolynomialGF2mSmallM

Returns:

the irreducible Goppa polynomial
getGoppaPoly
()

public GF2Matrix

Returns:

the canonical check matrix
getH
()

public int

Returns:

the dimension of the code
getK
()

pack-priv AsymmetricKeyParameter
public int

Returns:

the length of the code
getN
()

public Permutation

Returns:

the permutation vector
getP
()

public PolynomialGF2mSmallM[]

Returns:

the matrix used to compute square roots in (GF(2^m))^t
getQInv
()

public int

Returns:

the degree of the Goppa polynomial (error correcting capability)
getT
()

public int

Returns:

the hash code of this key
hashCode
()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.

private void
init(PrivateKeyInfo privateKeyInfo)

private void
private void
Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAlltoStringwaitwaitwait

Field Detail

paramsback to summary
private transient McElieceCCA2PrivateKeyParameters params
serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.security.PrivateKey.serialVersionUID.

Constructor Detail

BCMcElieceCCA2PrivateKeyback to summary
public BCMcElieceCCA2PrivateKey(McElieceCCA2PrivateKeyParameters params)

Method Detail

equalsback to summary
public boolean equals(Object other)

Overrides java.lang.Object.equals.

Compare this key with another object.

Parameters
other:Object

the other object

Returns:boolean

the result of the comparison

getAlgorithmback to summary
public String getAlgorithm()

Implements java.security.Key.getAlgorithm.

Return the name of the algorithm.

Returns:String

"McEliece-CCA2"

getEncodedback to summary
public byte[] getEncoded()

Implements java.security.Key.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
  }
Returns:byte[]

the keyData to encode in the SubjectPublicKeyInfo structure

getFieldback to summary
public GF2mField getField()
Returns:GF2mField

the finite field

getFormatback to summary
public String getFormat()

Implements java.security.Key.getFormat.

Doc from java.security.Key.getFormat.

Returns the name of the primary encoding format of this key, or null if this key does not support encoding. The primary encoding format is named in terms of the appropriate ASN.1 data format, if an ASN.1 specification for this key exists. For example, the name of the ASN.1 data format for public keys is SubjectPublicKeyInfo, as defined by the X.509 standard; in this case, the returned format is "X.509". Similarly, the name of the ASN.1 data format for private keys is PrivateKeyInfo, as defined by the PKCS #8 standard; in this case, the returned format is "PKCS#8".

Returns:String

the primary encoding format of the key.

getGoppaPolyback to summary
public PolynomialGF2mSmallM getGoppaPoly()
Returns:PolynomialGF2mSmallM

the irreducible Goppa polynomial

getHback to summary
public GF2Matrix getH()
Returns:GF2Matrix

the canonical check matrix

getKback to summary
public int getK()
Returns:int

the dimension of the code

getKeyParamsback to summary
pack-priv AsymmetricKeyParameter getKeyParams()
getNback to summary
public int getN()
Returns:int

the length of the code

getPback to summary
public Permutation getP()
Returns:Permutation

the permutation vector

getQInvback to summary
public PolynomialGF2mSmallM[] getQInv()
Returns:PolynomialGF2mSmallM[]

the matrix used to compute square roots in (GF(2^m))^t

getTback to summary
public int getT()
Returns:int

the degree of the Goppa polynomial (error correcting capability)

hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

the hash code of this key

initback to summary
private void init(PrivateKeyInfo privateKeyInfo) throws IOException
readObjectback to summary
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException
writeObjectback to summary
private void writeObject(ObjectOutputStream out) throws IOException