Operators#
cuPQC and cuHash operators are used to describe the operation to be performed, and configure the execution.
They are combined via addition (+) to form a cuPQC descriptor.
cuPQC Operators#
Description Operators#
Algorithm#
Sets the algorithm Alg to use. Valid values are:
-
enum algorithm#
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:
Name |
Alias |
||
|---|---|---|---|
ML-KEM-512 |
|
|
|
ML-KEM-768 |
|
|
|
ML-KEM-1024 |
|
|
|
ML-DSA-44 |
|
|
|
ML-DSA-65 |
|
|
|
ML-DSA-87 |
|
|
Function#
Sets the function Fn to use. Valid values are:
-
enum function#
-
enumerator Keygen#
Generate public and secret keys. Valid for both
algorithm::ML_KEMandalgorithm::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.
-
enumerator Keygen#
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.
cuHash Operators#
Description Operators#
Algorithm#
-
template<algorithm Alg>
Algorithm()
Sets the algorithm Alg to use. Valid values are:
-
enum algorithm
-
-
enumerator SHA2_32#
SHA-2 32-bit word size hash functions (FIPS-180-4)
-
enumerator SHA2_64#
SHA-2 64-bit word size hash functions (FIPS-180-4)
-
enumerator SHA2_32#
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.
Name |
Alias |
||
|---|---|---|---|
SHA2-224 |
|
|
|
SHA2-256 |
|
|
|
SHA2-384 |
|
|
|
SHA2-512 |
|
|
|
SHA2-512/224 |
|
|
|
SHA2-512/256 |
|
|
|
SHA3-224 |
|
|
|
SHA3-256 |
|
|
|
SHA3-384 |
|
|
|
SHA3-512 |
|
|
|
SHAKE-128 |
|
|
|
SHAKE-256 |
|
|
Execution Operators#
Thread execution#
-
Thread()#
Specifies that the operator will execute independently for each thread.
Warp execution#
-
Warp()#
Specifies that the operator will execute on each CUDA warp (group of 32 threads). The device methods should be called with the same arguments for all threads in the warp.
Only the algorithm::SHA3 and algorithm::SHAKE algorithms are supported for this execution mode.