Operators#

cuPQC-PK operators are used to describe the operation to be performed, and configure the execution. They are combined via addition (+) to form a cuPQC-PK descriptor.

Description Operators#

Algorithm#

template<algorithm Alg>
Algorithm()#

Sets the algorithm Alg to use. Valid values are:

enum algorithm#
enumerator ML_KEM#

Module-Lattice-Based Key-Encapsulation Mechanism (FIPS-203).

enumerator ML_DSA#

Module-Lattice-Based Digital Signature (FIPS-204).

There is no default value.

SecurityCategory#

template<unsigned int Category>
SecurityCategory()#

Sets the NIST security category, which determines the parameter set of the algorithm to be used. The valid values of Category depend on the value of the Algorithm operator. There is no default value.

Convenience aliases are provided for the valid combinations: for example ML_KEM_512() is equivalent to Algorithm<algorithm::ML_KEM>() + SecurityCategory<1>().

Valid combinations and alias constructor functions are:

Family

Name

Algorithm

SecurityCategory

Alias

ML-KEM-512

algorithm::ML_KEM

1

ML_KEM_512()

ML-KEM

ML-KEM-768

algorithm::ML_KEM

3

ML_KEM_768()

ML-KEM-1024

algorithm::ML_KEM

5

ML_KEM_1024()

ML-DSA-44

algorithm::ML_DSA

2

ML_DSA_44()

ML-DSA

ML-DSA-65

algorithm::ML_DSA

3

ML_DSA_65()

ML-DSA-87

algorithm::ML_DSA

5

ML_DSA_87()

Function#

template<function Fn>
Function()#

Sets the function Fn to use. Valid values are:

enum function#
enumerator Keygen#

Generate public and secret keys. Valid for both algorithm::ML_KEM and algorithm::ML_DSA

enumerator Encaps#

Encapsulation: generate shared secret and ciphertext from public key. Valid only for algorithm::ML_KEM.

enumerator Decaps#

Decapsulation: derive shared secret from ciphertext and secret key. Valid only for algorithm::ML_KEM.

enumerator Sign#

Generate a signature from a message using the secret key. Valid only for algorithm::ML_DSA.

enumerator Verify#

Verify the signature of message using the public key. Valid only for algorithm::ML_DSA.

There is no default value.

Execution Operators#

Block#

Block()#

Specifies that the operator will execute in a single CUDA block: all threads in the block must call execute(...) with the same arguments.

Requires the BlockDim operator.

This is currently the only mode of execution supported.

BlockDim#

template<unsigned int X, unsigned int Y = 1, unsigned int Z = 1>
BlockDim(
)#

Specifies that the block dimensions of the kernel when using Block() operator. Currently supported values of X are 32, 64, 128, and 256. Currently Y and Z must be 1.

The default value is BlockDim<128, 1, 1>; this is an implementation dependent value.

The values of X, Y and Z can be accessed from the descriptor from via the BlockDim() accessor.