Top Fields Constructors Methods
org.bouncycastle.pqc.crypto.crystals.kyber

pack-priv Class KyberIndCpa

extends Object
Class Inheritance
Imports
org.bouncycastle.crypto.digests.SHAKEDigest, org.bouncycastle.util.Arrays

Field Summary

Modifier and TypeField and Description
private KyberEngine
private int
private int
private int
public final int
private int
private int
private int
private int
private Symmetric

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public byte[]
decrypt(byte[] cipherText, byte[] secretKey)

public byte[]
encrypt(byte[] msg, byte[] publicKeyInput, byte[] coins)

pack-priv byte[][]

Returns:

KeyPair where each key is represented as bytes
generateKeyPair
()

Generates IndCpa Key Pair

public void
generateMatrix(PolyVec[] aMatrix, byte[] seed, boolean transposed)

private byte[]
public byte[]
packPublicKey(PolyVec publicKeyPolyVec, byte[] seed)

public byte[]
packSecretKey(PolyVec secretKeyPolyVec)

private static int
rejectionSampling(Poly outputBuffer, int coeffOff, int len, byte[] inpBuf, int inpBufLen)

private void
unpackCipherText(PolyVec b, Poly v, byte[] cipherText)

public byte[]
unpackPublicKey(PolyVec publicKeyPolyVec, byte[] publicKey)

public void
unpackSecretKey(PolyVec secretKeyPolyVec, byte[] secretKey)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

engineback to summary
private KyberEngine engine
eta1back to summary
private int eta1
indCpaBytesback to summary
private int indCpaBytes
indCpaPublicKeyBytesback to summary
private int indCpaPublicKeyBytes
KyberGenerateMatrixNBlocksback to summary
public final int KyberGenerateMatrixNBlocks
kyberKback to summary
private int kyberK
polyCompressedBytesback to summary
private int polyCompressedBytes
polyVecBytesback to summary
private int polyVecBytes
polyVecCompressedBytesback to summary
private int polyVecCompressedBytes
symmetricback to summary
private Symmetric symmetric

Constructor Detail

KyberIndCpaback to summary
public KyberIndCpa(KyberEngine engine)

Method Detail

decryptback to summary
public byte[] decrypt(byte[] cipherText, byte[] secretKey)
encryptback to summary
public byte[] encrypt(byte[] msg, byte[] publicKeyInput, byte[] coins)
generateKeyPairback to summary
pack-priv byte[][] generateKeyPair()

Generates IndCpa Key Pair

Returns:byte[][]

KeyPair where each key is represented as bytes

generateMatrixback to summary
public void generateMatrix(PolyVec[] aMatrix, byte[] seed, boolean transposed)
packCipherTextback to summary
private byte[] packCipherText(PolyVec b, Poly v)
packPublicKeyback to summary
public byte[] packPublicKey(PolyVec publicKeyPolyVec, byte[] seed)
packSecretKeyback to summary
public byte[] packSecretKey(PolyVec secretKeyPolyVec)
rejectionSamplingback to summary
private static int rejectionSampling(Poly outputBuffer, int coeffOff, int len, byte[] inpBuf, int inpBufLen)
unpackCipherTextback to summary
private void unpackCipherText(PolyVec b, Poly v, byte[] cipherText)
unpackPublicKeyback to summary
public byte[] unpackPublicKey(PolyVec publicKeyPolyVec, byte[] publicKey)
unpackSecretKeyback to summary
public void unpackSecretKey(PolyVec secretKeyPolyVec, byte[] secretKey)