Top Fields Constructors Methods
org.bouncycastle.pqc.addon

pack-priv Class CMCEEngine

extends Object
Class Inheritance
Imports
java.io.IOException, java.security.SecureRandom, org.bouncycastle.crypto.OutputXOFCalculator, .UpdateOutputStream, org.bouncycastle.crypto.fips.FipsSHS, org.bouncycastle.util.Arrays

Field Summary

Modifier and TypeField and Description
private BENES
private int
private boolean
private final int
private GF
private int
private int
private int
private int
private int
private int
private int[]
private int
private int
private int
private boolean
private boolean

Constructor Summary

AccessConstructor and Description
public
CMCEEngine(int m, int n, int t, int[] p, boolean usePivots, int defaultKeySize)

Method Summary

Modifier and TypeMethod and Description
private void
bm(short[] out, short[] s)

pack-priv static void
cbrecursion(byte[] out, long pos, long step, short[] pi, int qIndex, long w, long n, int[] temp)

pack-priv int
check_c_padding(byte[] c)

pack-priv int
check_pk_padding(byte[] pk)

private static void
controlbitsfrompermutation(byte[] out, short[] pi, long w, long n)

private static int
ctz(long in)

public byte[]
private int
decrypt(byte[] error_vector, byte[] sk, byte[] cipher_text)

private void
encrypt(byte[] cipher_text, byte[] pk, byte[] error_vector, SecureRandom random)

private short
eval(short[] f, short a)

private void
generate_error_vector(byte[] error_vector, SecureRandom random)

private int
generate_irr_poly(short[] field)

public byte[]
pack-priv static short
get_q_short(int[] temp, int q_index)

public int
public int
public int
public int
public int
public int
private void
GF_mul(short[] out, short[] left, short[] right)

public int
kem_dec(byte[] key, byte[] cipher_text, byte[] sk)

public int
kem_enc(byte[] cipher_text, byte[] key, byte[] pk, SecureRandom random)

public void
kem_keypair(byte[] pk, byte[] sk, SecureRandom random)

private static void
layer(short[] p, byte[] out, int ptrIndex, int s, int n)

private static int
min(short a, int b)

private int
mov_columns(byte[][] mat, short[] pi, long[] pivots)

private int
pk_gen(byte[] pk, byte[] sk, int[] perm, short[] pi, long[] pivots)

private void
root(short[] out, short[] f, short[] L)

private static byte
same_mask32(short x, short y)

private static long
same_mask64(short x, short y)

private static void
sort32(int[] temp, int from, int to)

private static void
sort64(long[] temp, int from, int to)

private void
synd(short[] out, short[] f, short[] L, byte[] r)

private void
syndrome(byte[] cipher_text, byte[] pk, byte[] error_vector)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

benesback to summary
private BENES benes
COND_BYTESback to summary
private int COND_BYTES
countErrorIndicesback to summary
private boolean countErrorIndices
defaultKeySizeback to summary
private final int defaultKeySize
gfback to summary
private GF gf
GFBITSback to summary
private int GFBITS
GFMASKback to summary
private int GFMASK
IRR_BYTESback to summary
private int IRR_BYTES
PK_NCOLSback to summary
private int PK_NCOLS
PK_NROWSback to summary
private int PK_NROWS
PK_ROW_BYTESback to summary
private int PK_ROW_BYTES
polyback to summary
private int[] poly
SYND_BYTESback to summary
private int SYND_BYTES
SYS_Nback to summary
private int SYS_N
SYS_Tback to summary
private int SYS_T
usePaddingback to summary
private boolean usePadding
usePivotsback to summary
private boolean usePivots

Constructor Detail

CMCEEngineback to summary
public CMCEEngine(int m, int n, int t, int[] p, boolean usePivots, int defaultKeySize)

Method Detail

bmback to summary
private void bm(short[] out, short[] s)
cbrecursionback to summary
pack-priv static void cbrecursion(byte[] out, long pos, long step, short[] pi, int qIndex, long w, long n, int[] temp)
check_c_paddingback to summary
pack-priv int check_c_padding(byte[] c)
check_pk_paddingback to summary
pack-priv int check_pk_padding(byte[] pk)
controlbitsfrompermutationback to summary
private static void controlbitsfrompermutation(byte[] out, short[] pi, long w, long n)
ctzback to summary
private static int ctz(long in)
decompress_private_keyback to summary
public byte[] decompress_private_key(byte[] sk) throws IOException
decryptback to summary
private int decrypt(byte[] error_vector, byte[] sk, byte[] cipher_text)
encryptback to summary
private void encrypt(byte[] cipher_text, byte[] pk, byte[] error_vector, SecureRandom random)
evalback to summary
private short eval(short[] f, short a)
generate_error_vectorback to summary
private void generate_error_vector(byte[] error_vector, SecureRandom random)
generate_irr_polyback to summary
private int generate_irr_poly(short[] field)
generate_public_key_from_private_keyback to summary
public byte[] generate_public_key_from_private_key(byte[] sk) throws IOException
get_q_shortback to summary
pack-priv static short get_q_short(int[] temp, int q_index)
getCipherTextSizeback to summary
public int getCipherTextSize()
getCondBytesback to summary
public int getCondBytes()
getDefaultSessionKeySizeback to summary
public int getDefaultSessionKeySize()
getIrrBytesback to summary
public int getIrrBytes()
getPrivateKeySizeback to summary
public int getPrivateKeySize()
getPublicKeySizeback to summary
public int getPublicKeySize()
GF_mulback to summary
private void GF_mul(short[] out, short[] left, short[] right)
kem_decback to summary
public int kem_dec(byte[] key, byte[] cipher_text, byte[] sk) throws IOException
kem_encback to summary
public int kem_enc(byte[] cipher_text, byte[] key, byte[] pk, SecureRandom random) throws IOException
kem_keypairback to summary
public void kem_keypair(byte[] pk, byte[] sk, SecureRandom random) throws IOException
layerback to summary
private static void layer(short[] p, byte[] out, int ptrIndex, int s, int n)
minback to summary
private static int min(short a, int b)
mov_columnsback to summary
private int mov_columns(byte[][] mat, short[] pi, long[] pivots)
pk_genback to summary
private int pk_gen(byte[] pk, byte[] sk, int[] perm, short[] pi, long[] pivots)
rootback to summary
private void root(short[] out, short[] f, short[] L)
same_mask32back to summary
private static byte same_mask32(short x, short y)
same_mask64back to summary
private static long same_mask64(short x, short y)
sort32back to summary
private static void sort32(int[] temp, int from, int to)
sort64back to summary
private static void sort64(long[] temp, int from, int to)
syndback to summary
private void synd(short[] out, short[] f, short[] L, byte[] r)
syndromeback to summary
private void syndrome(byte[] cipher_text, byte[] pk, byte[] error_vector)