de.flexiprovider.pqc.rainbow
Class RainbowPublicKey
java.lang.Object
|
+--de.flexiprovider.api.keys.PublicKey
|
+--de.flexiprovider.pqc.rainbow.RainbowPublicKey
- All Implemented Interfaces:
- java.security.Key, Key, java.security.PublicKey, java.io.Serializable
- public class RainbowPublicKey
- extends PublicKey
This class extends PublicKey of the FlexiProvider_API and implements,
respectively overrides its methods for the Rainbow Signature Scheme.
The public key in Rainbow consists of n - v1 polynomial components of the
private key's F and the field structure of the finite field k.
The quadratic (or mixed) coefficients of the polynomials from the public key
are stored in the 2-dimensional array in lexicographical order, requiring n *
(n + 1) / 2 entries for each polynomial. The singular terms are stored in a
2-dimensional array requiring n entries per polynomial, the scalar term of
each polynomial is stored in a 1-dimensional array.
More detailed information on the public key is to be found in the paper of
Jintai Ding, Dieter Schmidt: Rainbow, a New Multivariable Polynomial
Signature Scheme. ACNS 2005: 164-175 (http://dx.doi.org/10.1007/11496137_12)
- Author:
- Patrick Neugebauer, Marius Senftleben, Tsvetoslava Vateva
- See Also:
RainbowKeyPairGenerator, Serialized Form
| Fields inherited from interface java.security.Key |
serialVersionUID |
| Fields inherited from interface java.security.PublicKey |
serialVersionUID |
| Methods inherited from class java.lang.Object |
, clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RainbowPublicKey
public RainbowPublicKey(java.lang.String oid,
int docLength,
short[][] coeffQuadratic,
short[][] coeffSingular,
short[] coeffScalar)
- Constructor used by
RainbowKeyPairGenerator.
- Parameters:
oid - docLength - coeffQuadratic - coeffSingular - coeffScalar -
RainbowPublicKey
protected RainbowPublicKey(RainbowPublicKeySpec keySpec)
- Constructor (used by the
RainbowKeyFactory).
- Parameters:
keySpec - a rainbowPublicKeySpec
getDocLength
public int getDocLength()
- Returns:
- the docLength
getCoeffquadratic
protected short[][] getCoeffquadratic()
- Returns:
- the coeffquadratic
setCoeffquadratic
protected void setCoeffquadratic(short[][] coeffquadratic)
- Parameters:
coeffquadratic - the coeffquadratic to set
getCoeffsingular
protected short[][] getCoeffsingular()
- Returns:
- the coeffsingular
setCoeffsingular
protected void setCoeffsingular(short[][] coeffsingular)
- Parameters:
coeffsingular - the coeffsingular to set
getCoeffscalar
protected short[] getCoeffscalar()
- Returns:
- the coeffscalar
setCoeffscalar
protected void setCoeffscalar(short[] coeffscalar)
- Parameters:
coeffscalar - the coeffscalar to set
equals
public boolean equals(java.lang.Object other)
- Compare this Rainbow public key with another object.
- Overrides:
equals in class java.lang.Object
- Parameters:
other - the other object- Returns:
- the result of the comparison
getAlgorithm
public final java.lang.String getAlgorithm()
- Returns:
- name of the algorithm - "Rainbow"
getOIDString
protected java.lang.String getOIDString()
- Returns:
- the OID of the algorithm
getOID
protected codec.asn1.ASN1ObjectIdentifier getOID()
- Overrides:
getOID in class PublicKey
- Returns:
- the OID to encode in the SubjectPublicKeyInfo structure
getAlgParams
protected codec.asn1.ASN1Type getAlgParams()
- Overrides:
getAlgParams in class PublicKey
- Returns:
- the algorithm parameters to encode in the SubjectPublicKeyInfo
structure
getKeyData
protected byte[] getKeyData()
- Return the keyData to encode in the SubjectPublicKeyInfo structure.
The ASN.1 definition of the key structure is
RainbowPublicKey ::= SEQUENCE {
oid OBJECT IDENTIFIER -- OID identifying the algorithm
docLength Integer -- length of the code
coeffquadratic SEQUENCE OF OCTET STRING -- quadratic (mixed) coefficients
coeffsingular SEQUENCE OF OCTET STRING -- singular coefficients
coeffscalar SEQUENCE OF OCTET STRING -- scalar coefficients
}
- Overrides:
getKeyData in class PublicKey
- Returns:
- the keyData to encode in the SubjectPublicKeyInfo structure