Top Constructors Methods
org.bouncycastle.pqc.crypto.ntruprime

pack-priv Class Utils

extends Object
Class Inheritance
Imports
java.security.SecureRandom, org.bouncycastle.crypto.StreamCipher, org.bouncycastle.crypto.digests.SHA512Digest, org.bouncycastle.crypto.engines.AESEngine, org.bouncycastle.crypto.modes.SICBlockCipher, org.bouncycastle.crypto.params.KeyParameter, .ParametersWithIV

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv static int
protected static void
checkForSmallPolynomial(byte[] r, byte[] ev, int p, int w)

private static int
private static int
protected static void
cryptoSort(int[] L, int p)

private static void
decode(short[] out, byte[] S, short[] M, int len, int start, int sIndex)

private static void
encode(byte[] out, short[] R, short[] M, int len, int start)

protected static void
expand(int[] L, byte[] k)

private static void
generateAES256CTRStream(byte[] in, byte[] out, byte[] nonce, byte[] key)

protected static void
generatePolynomialInRQFromSeed(short[] G, byte[] seed, int p, int q)

protected static void
getDecodedPolynomial(short[] h, byte[] enc, int p, int q)

protected static void
getDecodedSmallPolynomial(byte[] sp, byte[] encSP, int p)

protected static void
getEncodedInputs(byte[] out, byte[] in)

protected static void
getEncodedPolynomial(byte[] enc, short[] h, int p, int q)

protected static void
getEncodedSmallPolynomial(byte[] encSP, byte[] sp, int p)

protected static byte[]
getHashWithPrefix(byte[] prefix, byte[] hashInput)

protected static int
getInverseInRQ(int x, int q)

protected static int
getModFreeze(int x, int n)

protected static void
getOneThirdInverseInRQ(short[] finv3, byte[] f, int p, int q)

protected static void
getRandomInputs(SecureRandom random, byte[] r)

protected static void
getRandomShortPolynomial(SecureRandom random, byte[] f, int p, int w)

protected static void
protected static int
protected static void
getRoundedDecodedPolynomial(short[] h, byte[] enc, int p, int q)

protected static void
getRoundedEncodedPolynomial(byte[] out, short[] in, int p, int q)

private static int[]
getSignedDivMod(int x, int n)

protected static void
getTopDecodedPolynomial(byte[] out, byte[] in)

protected static void
getTopEncodedPolynomial(byte[] out, byte[] in)

private static int[]
getUnsignedDivMod(int dividend, int n)

private static int
getUnsignedMod(int x, int n)

protected static boolean
isInvertiblePolynomialInR3(byte[] g, byte[] ginv, int p)

pack-priv static long
protected static void
minmax(int[] L, int x, int y)

protected static void
multiplicationInR3(byte[] h, byte[] finv3, byte[] g, int p)

protected static void
multiplicationInRQ(short[] h, short[] finv3, byte[] g, int p, int q)

protected static void
right(byte[] out, short[] aB, byte[] T, int q, int w, int tau2, int tau3)

protected static void
roundPolynomial(short[] out, short[] in)

protected static void
scalarMultiplicationInRQ(short[] out, short[] in, int scalar, int q)

protected static void
sortGenerateShortPolynomial(byte[] f, int[] L, int p, int w)

pack-priv static int
sToUnsignedInt(short s)

pack-priv static int
toIntExact(long l)

protected static void
top(byte[] out, short[] bA, byte[] r, int q, int tau0, int tau1)

protected static void
transformRQToR3(byte[] out, short[] in)

protected static void
updateDiffMask(byte[] encR, byte[] rho, int mask)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

Utilsback to summary
pack-priv Utils()

Method Detail

bToUnsignedIntback to summary
pack-priv static int bToUnsignedInt(byte b)
checkForSmallPolynomialback to summary
protected static void checkForSmallPolynomial(byte[] r, byte[] ev, int p, int w)
checkLessThanZeroback to summary
private static int checkLessThanZero(int x)
checkNotEqualToZeroback to summary
private static int checkNotEqualToZero(int x)
cryptoSortback to summary
protected static void cryptoSort(int[] L, int p)
decodeback to summary
private static void decode(short[] out, byte[] S, short[] M, int len, int start, int sIndex)
encodeback to summary
private static void encode(byte[] out, short[] R, short[] M, int len, int start)
expandback to summary
protected static void expand(int[] L, byte[] k)
generateAES256CTRStreamback to summary
private static void generateAES256CTRStream(byte[] in, byte[] out, byte[] nonce, byte[] key)
generatePolynomialInRQFromSeedback to summary
protected static void generatePolynomialInRQFromSeed(short[] G, byte[] seed, int p, int q)
getDecodedPolynomialback to summary
protected static void getDecodedPolynomial(short[] h, byte[] enc, int p, int q)
getDecodedSmallPolynomialback to summary
protected static void getDecodedSmallPolynomial(byte[] sp, byte[] encSP, int p)
getEncodedInputsback to summary
protected static void getEncodedInputs(byte[] out, byte[] in)
getEncodedPolynomialback to summary
protected static void getEncodedPolynomial(byte[] enc, short[] h, int p, int q)
getEncodedSmallPolynomialback to summary
protected static void getEncodedSmallPolynomial(byte[] encSP, byte[] sp, int p)
getHashWithPrefixback to summary
protected static byte[] getHashWithPrefix(byte[] prefix, byte[] hashInput)
getInverseInRQback to summary
protected static int getInverseInRQ(int x, int q)
getModFreezeback to summary
protected static int getModFreeze(int x, int n)
getOneThirdInverseInRQback to summary
protected static void getOneThirdInverseInRQ(short[] finv3, byte[] f, int p, int q)
getRandomInputsback to summary
protected static void getRandomInputs(SecureRandom random, byte[] r)
getRandomShortPolynomialback to summary
protected static void getRandomShortPolynomial(SecureRandom random, byte[] f, int p, int w)
getRandomSmallPolynomialback to summary
protected static void getRandomSmallPolynomial(SecureRandom random, byte[] g)
getRandomUnsignedIntegerback to summary
protected static int getRandomUnsignedInteger(SecureRandom random)
getRoundedDecodedPolynomialback to summary
protected static void getRoundedDecodedPolynomial(short[] h, byte[] enc, int p, int q)
getRoundedEncodedPolynomialback to summary
protected static void getRoundedEncodedPolynomial(byte[] out, short[] in, int p, int q)
getSignedDivModback to summary
private static int[] getSignedDivMod(int x, int n)
getTopDecodedPolynomialback to summary
protected static void getTopDecodedPolynomial(byte[] out, byte[] in)
getTopEncodedPolynomialback to summary
protected static void getTopEncodedPolynomial(byte[] out, byte[] in)
getUnsignedDivModback to summary
private static int[] getUnsignedDivMod(int dividend, int n)
getUnsignedModback to summary
private static int getUnsignedMod(int x, int n)
isInvertiblePolynomialInR3back to summary
protected static boolean isInvertiblePolynomialInR3(byte[] g, byte[] ginv, int p)
iToUnsignedLongback to summary
pack-priv static long iToUnsignedLong(int i)
minmaxback to summary
protected static void minmax(int[] L, int x, int y)
multiplicationInR3back to summary
protected static void multiplicationInR3(byte[] h, byte[] finv3, byte[] g, int p)
multiplicationInRQback to summary
protected static void multiplicationInRQ(short[] h, short[] finv3, byte[] g, int p, int q)
rightback to summary
protected static void right(byte[] out, short[] aB, byte[] T, int q, int w, int tau2, int tau3)
roundPolynomialback to summary
protected static void roundPolynomial(short[] out, short[] in)
scalarMultiplicationInRQback to summary
protected static void scalarMultiplicationInRQ(short[] out, short[] in, int scalar, int q)
sortGenerateShortPolynomialback to summary
protected static void sortGenerateShortPolynomial(byte[] f, int[] L, int p, int w)
sToUnsignedIntback to summary
pack-priv static int sToUnsignedInt(short s)
toIntExactback to summary
pack-priv static int toIntExact(long l)
topback to summary
protected static void top(byte[] out, short[] bA, byte[] r, int q, int tau0, int tau1)
transformRQToR3back to summary
protected static void transformRQToR3(byte[] out, short[] in)
updateDiffMaskback to summary
protected static void updateDiffMask(byte[] encR, byte[] rho, int mask)