Top Fields Constructors Methods
org.bouncycastle.pqc.crypto.hqc

pack-priv Class HQCEngine

extends Object
Class Inheritance
Imports
org.bouncycastle.util.Arrays, .Pack

Field Summary

Modifier and TypeField and Description
private int
private int
private int
g

private byte
private int[]
private int
private int
private GF2PolynomialCalculator
private byte
private int
k

private int
private int
private byte
private int
private int
n

private int
private int
private int
private int
private int
private int
private int
private int
private int
private long
private int
private int
private int
private int
private int
private int
w

private int
private int

Constructor Summary

AccessConstructor and Description
public
HQCEngine(int n, int n1, int n2, int k, int g, int delta, int w, int wr, int we, int rejectionThreshold, int fft, int[] generatorPoly)

Method Summary

Modifier and TypeMethod and Description
public void
decaps(byte[]
session key
ss
,
byte[]
ciphertext
ct
,
byte[]
secret key
sk
)

HQC Decapsulation - Input: ct, sk - Output: ss

private void
decrypt(byte[] output, byte[] m, byte[] u, byte[] v, long[] y)

public void
encaps(byte[]
u
u
,
byte[]
v
v
,
byte[]
session key
K
,
byte[]
d
d
,
byte[]
public key
pk
,
byte[]
seed
seed
,
byte[] salt)

HQC Encapsulation - Input: pk, seed - Output: c = (u,v,d), K

private void
encrypt(byte[]
ciphertext
u
,
long[]
ciphertext
v
,
long[]
public key
h
,
byte[]
public key
s
,
byte[]
message
m
,
byte[] theta)

HQC Encryption - Input: (h,s, m) - Output: (u,v) = c

private void
extractCiphertexts(byte[] u, byte[] v, byte[] d, byte[] salt, byte[] ct)

private void
extractKeysFromSecretKeys(long[] x, long[] y, byte[] pk, byte[] sk)

private void
extractPublicKeys(long[] h, byte[] s, byte[] pk)

pack-priv void
private void
generateRandomFixedWeight(long[] output, KeccakRandomGenerator random, int weight)

public void
genKeyPair(byte[]
output pk = (publicSeed||s)
pk
,
byte[] sk, byte[] seed)

Generate key pairs - Secret key : (x,y) - Public key: (h,s)

pack-priv int
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

deltaback to summary
private int delta
fftback to summary
private int fft
gback to summary
private int g
G_FCT_DOMAINback to summary
private byte G_FCT_DOMAIN
generatorPolyback to summary
private int[] generatorPoly
GF_POLY_M2back to summary
private int GF_POLY_M2
GF_POLY_WTback to summary
private int GF_POLY_WT
gfCalculatorback to summary
private GF2PolynomialCalculator gfCalculator
H_FCT_DOMAINback to summary
private byte H_FCT_DOMAIN
kback to summary
private int k
K_BYTEback to summary
private int K_BYTE
K_BYTE_64back to summary
private int K_BYTE_64
K_FCT_DOMAINback to summary
private byte K_FCT_DOMAIN
mulParamback to summary
private int mulParam
nback to summary
private int n
n1back to summary
private int n1
N1_BYTEback to summary
private int N1_BYTE
N1_BYTE_64back to summary
private int N1_BYTE_64
n1n2back to summary
private int n1n2
N1N2_BYTEback to summary
private int N1N2_BYTE
N1N2_BYTE_64back to summary
private int N1N2_BYTE_64
n2back to summary
private int n2
N_BYTEback to summary
private int N_BYTE
N_BYTE_64back to summary
private int N_BYTE_64
RED_MASKback to summary
private long RED_MASK
rejectionThresholdback to summary
private int rejectionThreshold
SALT_SIZE_64back to summary
private int SALT_SIZE_64
SALT_SIZE_BYTESback to summary
private int SALT_SIZE_BYTES
SEED_SIZEback to summary
private int SEED_SIZE
SHA512_BYTESback to summary
private int SHA512_BYTES
wback to summary
private int w
weback to summary
private int we
wrback to summary
private int wr

Constructor Detail

HQCEngineback to summary
public HQCEngine(int n, int n1, int n2, int k, int g, int delta, int w, int wr, int we, int rejectionThreshold, int fft, int[] generatorPoly)

Method Detail

decapsback to summary
public void decaps(byte[] ss, byte[] ct, byte[] sk)

HQC Decapsulation - Input: ct, sk - Output: ss

Parameters
ss:byte[]

session key

ct:byte[]

ciphertext

sk:byte[]

secret key

decryptback to summary
private void decrypt(byte[] output, byte[] m, byte[] u, byte[] v, long[] y)
encapsback to summary
public void encaps(byte[] u, byte[] v, byte[] K, byte[] d, byte[] pk, byte[] seed, byte[] salt)

HQC Encapsulation - Input: pk, seed - Output: c = (u,v,d), K

Parameters
u:byte[]

u

v:byte[]

v

K:byte[]

session key

d:byte[]

d

pk:byte[]

public key

seed:byte[]

seed

encryptback to summary
private void encrypt(byte[] u, long[] v, long[] h, byte[] s, byte[] m, byte[] theta)

HQC Encryption - Input: (h,s, m) - Output: (u,v) = c

Parameters
u:byte[]

ciphertext

v:long[]

ciphertext

h:long[]

public key

s:byte[]

public key

m:byte[]

message

extractCiphertextsback to summary
private void extractCiphertexts(byte[] u, byte[] v, byte[] d, byte[] salt, byte[] ct)
extractKeysFromSecretKeysback to summary
private void extractKeysFromSecretKeys(long[] x, long[] y, byte[] pk, byte[] sk)
extractPublicKeysback to summary
private void extractPublicKeys(long[] h, byte[] s, byte[] pk)
generatePublicKeyHback to summary
pack-priv void generatePublicKeyH(long[] out, KeccakRandomGenerator random)
generateRandomFixedWeightback to summary
private void generateRandomFixedWeight(long[] output, KeccakRandomGenerator random, int weight)
genKeyPairback to summary
public void genKeyPair(byte[] pk, byte[] sk, byte[] seed)

Generate key pairs - Secret key : (x,y) - Public key: (h,s)

Parameters
pk:byte[]

output pk = (publicSeed||s)

getSessionKeySizeback to summary
pack-priv int getSessionKeySize()