de.flexiprovider.pqc.ecc.niederreiter
Class NiederreiterPrivateKey
java.lang.Object
|
+--de.flexiprovider.api.keys.PrivateKey
|
+--de.flexiprovider.pqc.ecc.niederreiter.NiederreiterPrivateKey
- All Implemented Interfaces:
- java.security.Key, Key, java.security.PrivateKey, java.io.Serializable
- public class NiederreiterPrivateKey
- extends PrivateKey
This class implements a Niederreiter private key and is usually instantiated
from the NiederreiterKeyPairGenerator.
- Author:
- Elena Klintsevich
- See Also:
NiederreiterKeyPairGenerator,
NiederreiterPrivateKey, 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 |
NiederreiterPrivateKey
protected NiederreiterPrivateKey(int m,
int k,
GF2mField field,
PolynomialGF2mSmallM gp,
PolynomialGF2mSmallM[] qInv,
GF2Matrix sInv,
Permutation p)
- Constructor, used by
NiederreiterKeyPairGenerator.
- Parameters:
m - extension degree of the fieldk - dimension of the codefield - finite fieldgp - irreducible Goppa polynomialqInv - matrix used to compute square roots in
(GF(2m))tsInv - random non-singular matrix S-1p - permutation P
NiederreiterPrivateKey
protected NiederreiterPrivateKey(NiederreiterPrivateKeySpec keySpec)
- Constructor, used by
NiederreiterKeyFactory.
- Parameters:
keySpec - a NiederreiterPrivateKeySpec
getAlgorithm
public java.lang.String getAlgorithm()
- Return the name of the algorithm.
- Returns:
- "Niederreiter"
getM
public int getM()
- Returns:
- the extension degree of the field
getK
public int getK()
- Returns:
- the dimension of the code
getT
public int getT()
- Returns:
- the error correction capability of the code
getN
public int getN()
- Returns:
- the length of the code
getField
public GF2mField getField()
- Returns:
- the underlying field
getGoppaPoly
public PolynomialGF2mSmallM getGoppaPoly()
- Returns:
- the irreducible Goppa polynomial
getSInv
public GF2Matrix getSInv()
- Returns:
- the random non-singular matrix S-1
getP
public Permutation getP()
- Returns:
- the permutation P
getQInv
public PolynomialGF2mSmallM[] getQInv()
- Returns:
- the matrix used to compute square roots in
(GF(2m))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 key data to encode in the SubjectPublicKeyInfo structure.
The ASN.1 definition of the key structure is
NiederreiterPrivateKey ::= SEQUENCE {
m Integer -- extension degree of the field
k Integer -- dimension of the code
field OCTET STRING -- encoded field polynomial
irrGoppaPoly OCTET STRING -- encoded Goppa polynomial
sInv OCTET STRING -- encoded random non-singular matrix
p OCTET STRING -- encoded permutation
qInv OCTET STRING -- encoded matrix used to compute square roots
}
- Overrides:
getKeyData in class PrivateKey
- Returns:
- the keyData to encode in the SubjectPublicKeyInfo structure