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

public Class BCMcEliecePrivateKey

extends Object
implements CipherParameters, PrivateKey
Class Inheritance
All Implemented Interfaces
java.security.PrivateKey, javax.security.auth.Destroyable, java.security.AsymmetricKey, java.security.Key, java.io.Serializable, org.bouncycastle.crypto.CipherParameters
Imports
java.io.IOException, java.security.PrivateKey, org.bouncycastle.asn1.pkcs.PrivateKeyInfo, org.bouncycastle.asn1.x509.AlgorithmIdentifier, org.bouncycastle.crypto.CipherParameters, org.bouncycastle.crypto.params.AsymmetricKeyParameter, org.bouncycastle.pqc.asn1.McEliecePrivateKey, .PQCObjectIdentifiers, org.bouncycastle.pqc.legacy.crypto.mceliece.McElieceKeyPairGenerator, .McEliecePrivateKeyParameters, org.bouncycastle.pqc.legacy.math.linearalgebra.GF2Matrix, .GF2mField, .Permutation, .PolynomialGF2mSmallM

This class implements a McEliece private key and is usually instantiated by the McElieceKeyPairGenerator or McElieceKeyFactorySpi.

Field Summary

Modifier and TypeField and Description
private McEliecePrivateKeyParameters
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"
getAlgorithm
()

Implements java.security.Key.getAlgorithm.

Return the name of the algorithm.

public byte[]

Returns:

the key data to encode in the SubjectPublicKeyInfo structure
getEncoded
()

Implements java.security.Key.getEncoded.

Return the key data 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 used to generate the systematic check matrix
getP1
()

public Permutation

Returns:

the permutation used to compute the public generator matrix
getP2
()

public PolynomialGF2mSmallM[]

Returns:

the matrix for computing square roots in (GF(2^m))^t
getQInv
()

public GF2Matrix

Returns:

the k x k random binary non-singular matrix S
getSInv
()

public int

Returns:

the hash code of this key
hashCode
()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAlltoStringwaitwaitwait

Field Detail

paramsback to summary
private McEliecePrivateKeyParameters params
serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.security.PrivateKey.serialVersionUID.

Constructor Detail

BCMcEliecePrivateKeyback to summary
public BCMcEliecePrivateKey(McEliecePrivateKeyParameters 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"

getEncodedback to summary
public byte[] getEncoded()

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

the key data 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

getP1back to summary
public Permutation getP1()
Returns:Permutation

the permutation used to generate the systematic check matrix

getP2back to summary
public Permutation getP2()
Returns:Permutation

the permutation used to compute the public generator matrix

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

the matrix for computing square roots in (GF(2^m))^t

getSInvback to summary
public GF2Matrix getSInv()
Returns:GF2Matrix

the k x k random binary non-singular matrix S

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