Top Description Fields Constructors Methods
org.bouncycastle.pqc.crypto.newhope

pack-priv Class NewHope

extends Object
Class Inheritance
Imports
java.security.SecureRandom, org.bouncycastle.crypto.digests.SHA3Digest

This implementation is based heavily on the C reference implementation from https://cryptojedi.org/crypto/index.shtml.

Field Summary

Modifier and TypeField and Description
public static final int
public static final int
public static final int
public static final int
private static final boolean

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv static void
decodeA(short[] pk, byte[] seed, byte[] r)

pack-priv static void
decodeB(short[] b, short[] c, byte[] r)

pack-priv static void
encodeA(byte[] r, short[] pk, byte[] seed)

pack-priv static void
encodeB(byte[] r, short[] b, short[] c)

pack-priv static void
generateA(short[] a, byte[] seed)

public static void
keygen(SecureRandom rand, byte[] send, short[] sk)

pack-priv static void
sha3(byte[] sharedKey)

public static void
sharedA(byte[] sharedKey, short[] sk, byte[] received)

public static void
sharedB(SecureRandom rand, byte[] sharedKey, byte[] send, byte[] received)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

AGREEMENT_SIZEback to summary
public static final int AGREEMENT_SIZE
POLY_SIZEback to summary
public static final int POLY_SIZE
SENDA_BYTESback to summary
public static final int SENDA_BYTES
SENDB_BYTESback to summary
public static final int SENDB_BYTES
STATISTICAL_TESTback to summary
private static final boolean STATISTICAL_TEST

Constructor Detail

NewHopeback to summary
pack-priv NewHope()

Method Detail

decodeAback to summary
pack-priv static void decodeA(short[] pk, byte[] seed, byte[] r)
decodeBback to summary
pack-priv static void decodeB(short[] b, short[] c, byte[] r)
encodeAback to summary
pack-priv static void encodeA(byte[] r, short[] pk, byte[] seed)
encodeBback to summary
pack-priv static void encodeB(byte[] r, short[] b, short[] c)
generateAback to summary
pack-priv static void generateA(short[] a, byte[] seed)
keygenback to summary
public static void keygen(SecureRandom rand, byte[] send, short[] sk)
sha3back to summary
pack-priv static void sha3(byte[] sharedKey)
sharedAback to summary
public static void sharedA(byte[] sharedKey, short[] sk, byte[] received)
sharedBback to summary
public static void sharedB(SecureRandom rand, byte[] sharedKey, byte[] send, byte[] received)