|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--java.security.SignatureSpi
|
+--de.flexiprovider.api.Signature
|
+--de.flexiprovider.pqc.pflash.PFlashSignature
This class implements the pFLASH signature scheme.
It only works when the parameters are set to
q = 16, n = 96, α = r = 32, s = 1.
With these values the length of the hash of the message, that should be signed, must be 256 bits. For that reason we chose SHA-256 as the message digest.
The PFlashSignature can be used as follow:
Signature generation
Signature verification
PFlashKeyPairGenerator| Field Summary | |
static java.lang.String |
OID
OID of the algorithm |
| Fields inherited from class java.security.SignatureSpi |
appRandom |
| Constructor Summary | |
PFlashSignature()
pFLASH Signature with SHA256 |
|
| Method Summary | |
void |
initSign(PrivateKey key,
SecureRandom srandom)
Initialize the signature algorithm for signing a message. |
void |
initVerify(PublicKey key)
Initialize the signature algorithm for verifying a signature. |
void |
setParameters(AlgorithmParameterSpec params)
Initialize this signature engine with specified parameter set (Not used) |
byte[] |
sign()
Sign a message. |
void |
update(byte input)
Feed a message byte to the message digest. |
void |
update(byte[] input,
int inOff,
int inLen)
Feed an array of message bytes to the message digest. |
boolean |
verify(byte[] sigBytes)
Verfify a signature. |
| Methods inherited from class de.flexiprovider.api.Signature |
engineGetParameter, engineInitSign, engineInitSign, engineInitVerify, engineSetParameter, engineSetParameter, engineSign, engineUpdate, engineUpdate, engineVerify, engineVerify, initSign, sign, update, verify, verify, verify |
| Methods inherited from class java.security.SignatureSpi |
clone, engineSign |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
public static final java.lang.String OID
| Constructor Detail |
public PFlashSignature()
The default values for the parameters are :
| degree of extension m | = | 4 |
| field polynomial of GF(2m) | = | X4 + X + 1 |
| extension degree of E/K | = | 96 |
| α | = | 32 |
| r | = | 32 |
| s | = | 1 |
| Method Detail |
public void initSign(PrivateKey key,
SecureRandom srandom)
throws InvalidKeyException
initSign in class Signaturekey - the private key of the signersrandom - a source of randomnessInvalidKeyException - if the key is not an instance of PFlashPrivateKey
public void initVerify(PublicKey key)
throws InvalidKeyException
initVerify in class Signaturekey - the public key of the signerInvalidKeyException - if the public key is not an instance of PFlashPublicKeypublic void setParameters(AlgorithmParameterSpec params)
setParameters in class Signatureparams - the parameters (not used)public void update(byte input)
update in class Signatureinput - the message byte
public void update(byte[] input,
int inOff,
int inLen)
update in class Signatureinput - array of message bytesinOff - index of message startinLen - number of message bytespublic byte[] sign()
sign in class Signaturepublic boolean verify(byte[] sigBytes)
verify in class Signaturesignature - the signature to be verified
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||