Class HawkKeyPairGenerator
java.lang.Object
org.bouncycastle.pqc.crypto.hawk.HawkKeyPairGenerator
- All Implemented Interfaces:
AsymmetricCipherKeyPairGenerator
Lightweight Hawk key pair generator. Initialised with a
HawkKeyGenerationParameters containing the parameter set and a
SecureRandom; produces a HawkPublicKeyParameters /
HawkPrivateKeyParameters pair.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intencodePrivate(int logn, byte[] dst, int dstOffset, byte[] seed, int seedOffset, byte[] F, int fOffset, byte[] G, int gOffset, byte[] pub, int pubOffset, int pubLen) static booleanencodePublic(int logn, byte[] dst, int dstOffset, int dstLen, short[] q00, int q00Offset, short[] q01, int q01Offset) static voidextractLowBit(int logn, byte[] dst, int dstOffset, byte[] f) return an AsymmetricCipherKeyPair containing the generated keys.intHawk_keygen(int logn, byte[] f, int fOffset, byte[] g, int gOffset, byte[] F, int FOffset, byte[] G, int GOffset, short[] q00, int q00Offset, short[] q01, int q01Offset, int[] q11, int q11Offset, byte[] seed, int seedOffset, int[] tmp, int tmpOffset, int tmpLen) voidinit(KeyGenerationParameters param) intialise the key pair generator.
-
Constructor Details
-
HawkKeyPairGenerator
public HawkKeyPairGenerator()
-
-
Method Details
-
init
Description copied from interface:AsymmetricCipherKeyPairGeneratorintialise the key pair generator.- Specified by:
initin interfaceAsymmetricCipherKeyPairGenerator- Parameters:
param- the parameters the key pair is to be initialised with.
-
generateKeyPair
Description copied from interface:AsymmetricCipherKeyPairGeneratorreturn an AsymmetricCipherKeyPair containing the generated keys.- Specified by:
generateKeyPairin interfaceAsymmetricCipherKeyPairGenerator- Returns:
- an AsymmetricCipherKeyPair containing the generated keys.
-
encodePublic
public static boolean encodePublic(int logn, byte[] dst, int dstOffset, int dstLen, short[] q00, int q00Offset, short[] q01, int q01Offset) -
extractLowBit
public static void extractLowBit(int logn, byte[] dst, int dstOffset, byte[] f) -
Hawk_keygen
public int Hawk_keygen(int logn, byte[] f, int fOffset, byte[] g, int gOffset, byte[] F, int FOffset, byte[] G, int GOffset, short[] q00, int q00Offset, short[] q01, int q01Offset, int[] q11, int q11Offset, byte[] seed, int seedOffset, int[] tmp, int tmpOffset, int tmpLen) -
encodePrivate
public static int encodePrivate(int logn, byte[] dst, int dstOffset, byte[] seed, int seedOffset, byte[] F, int fOffset, byte[] G, int gOffset, byte[] pub, int pubOffset, int pubLen)
-