Cryptographic Interface header file for declaring Key Encapsulation Mechanism methods.
More...
Go to the source code of this file.
|
MOC_EXTERN MSTATUS | CRYPTO_INTERFACE_QS_KEM_decapsulate (QS_CTX *pCtx, ubyte *pCipherText, ubyte4 cipherTextLen, ubyte *pSharedSecret, ubyte4 sharedSecretLen) |
| Performs the key decapsulation algorithm. More...
|
|
MOC_EXTERN MSTATUS | CRYPTO_INTERFACE_QS_KEM_decapsulateAlloc (QS_CTX *pCtx, ubyte *pCipherText, ubyte4 cipherTextLen, ubyte **ppSharedSecret, ubyte4 *pSharedSecretLen) |
| Performs the key decapsulation algorithm. More...
|
|
MOC_EXTERN MSTATUS | CRYPTO_INTERFACE_QS_KEM_encapsulate (QS_CTX *pCtx, RNGFun rngFun, void *pRngFunArg, ubyte *pCipherText, ubyte4 cipherTextLen, ubyte *pSharedSecret, ubyte4 sharedSecretLen) |
| Performs the key encapsulation algorithm. More...
|
|
MOC_EXTERN MSTATUS | CRYPTO_INTERFACE_QS_KEM_encapsulateAlloc (QS_CTX *pCtx, RNGFun rngFun, void *pRngFunArg, ubyte **ppCipherText, ubyte4 *pCipherTextLen, ubyte **ppSharedSecret, ubyte4 *pSharedSecretLen) |
| Performs the key encapsulation algorithm. More...
|
|
MOC_EXTERN MSTATUS | CRYPTO_INTERFACE_QS_KEM_getCipherTextLen (QS_CTX *pCtx, ubyte4 *pCipherLen) |
| Gets the length of the ciphertext associated with a QS context in bytes. More...
|
|
MOC_EXTERN MSTATUS | CRYPTO_INTERFACE_QS_KEM_getCipherTextLenFromAlgo (ubyte4 algo, ubyte4 *pCipherLen) |
| Gets the length of the ciphertext associated with a QS algorithm in bytes. More...
|
|
MOC_EXTERN MSTATUS | CRYPTO_INTERFACE_QS_KEM_getSharedSecretLen (QS_CTX *pCtx, ubyte4 *pSharedSecretLen) |
| Gets the length of a shared secret associated with a QS context in bytes. More...
|
|
◆ CRYPTO_INTERFACE_QS_KEM_decapsulate()
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_QS_KEM_decapsulate |
( |
QS_CTX * |
pCtx, |
|
|
ubyte * |
pCipherText, |
|
|
ubyte4 |
cipherTextLen, |
|
|
ubyte * |
pSharedSecret, |
|
|
ubyte4 |
sharedSecretLen |
|
) |
| |
Performs the key decapsulation algorithm.
- Parameters
-
pCtx | Pointer to a previously allocated context. |
pCipherText | Buffer holding the input ciphertext. |
cipherTextLen | The length of the ciphertext in bytes. |
pSharedSecret | Buffer that will hold the resulting shared secret. |
sharedSecretLen | The length of the pSharedSecret buffer in bytes. |
- Returns
OK
(0) if successful, otherwise a negative number error code from merrors.h.
◆ CRYPTO_INTERFACE_QS_KEM_decapsulateAlloc()
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_QS_KEM_decapsulateAlloc |
( |
QS_CTX * |
pCtx, |
|
|
ubyte * |
pCipherText, |
|
|
ubyte4 |
cipherTextLen, |
|
|
ubyte ** |
ppSharedSecret, |
|
|
ubyte4 * |
pSharedSecretLen |
|
) |
| |
Performs the key decapsulation algorithm. This method allocates a buffer for the shared secret. Be sure to free this buffer whwn done with it.
- Parameters
-
pCtx | Pointer to a previously allocated context. |
pCipherText | Buffer holding the input ciphertext. |
cipherTextLen | The length of the ciphertext in bytes. |
ppSharedSecret | Pointer to the location of the newly allocated buffer that will contain the output shared secret. |
pSharedSecretLen | Contents will be set to the length of the shared secret in bytes. |
- Returns
OK
(0) if successful, otherwise a negative number error code from merrors.h.
◆ CRYPTO_INTERFACE_QS_KEM_encapsulate()
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_QS_KEM_encapsulate |
( |
QS_CTX * |
pCtx, |
|
|
RNGFun |
rngFun, |
|
|
void * |
pRngFunArg, |
|
|
ubyte * |
pCipherText, |
|
|
ubyte4 |
cipherTextLen, |
|
|
ubyte * |
pSharedSecret, |
|
|
ubyte4 |
sharedSecretLen |
|
) |
| |
Performs the key encapsulation algorithm.
- Parameters
-
pCtx | Pointer to a previously allocated context. |
rngFun | Function pointer to a random number generation function. |
pRngFunArg | Input data or context into the random number generation function pointer. |
pCipherText | Buffer that will hold the resulting ciphertext. |
cipherTextLen | The length of the pCipherText buffer in bytes. |
pSharedSecret | Buffer that will hold the resulting shared secret. |
sharedSecretLen | The length of the pSharedSecret buffer in bytes. |
- Returns
OK
(0) if successful, otherwise a negative number error code from merrors.h.
◆ CRYPTO_INTERFACE_QS_KEM_encapsulateAlloc()
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_QS_KEM_encapsulateAlloc |
( |
QS_CTX * |
pCtx, |
|
|
RNGFun |
rngFun, |
|
|
void * |
pRngFunArg, |
|
|
ubyte ** |
ppCipherText, |
|
|
ubyte4 * |
pCipherTextLen, |
|
|
ubyte ** |
ppSharedSecret, |
|
|
ubyte4 * |
pSharedSecretLen |
|
) |
| |
Performs the key encapsulation algorithm. This method allocates two buffers, one for the ciphertext and one for the shared secret. Be sure to free these buffers when done with them.
- Parameters
-
pCtx | Pointer to a previously allocated context. |
rngFun | Function pointer to a random number generation function. |
pRngFunArg | Input data or context into the random number generation function pointer. |
ppCipherText | Pointer to the location of the newly allocated buffer that will contain the output ciphertext. |
pCipherTextLen | Contents will be set to the length of the ciphertext in bytes. |
ppSharedSecret | Pointer to the location of the newly allocated buffer that will contain the output shared secret. |
pSharedSecretLen | Contents will be set to the length of the shared secret in bytes. |
- Returns
OK
(0) if successful, otherwise a negative number error code from merrors.h.
◆ CRYPTO_INTERFACE_QS_KEM_getCipherTextLen()
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_QS_KEM_getCipherTextLen |
( |
QS_CTX * |
pCtx, |
|
|
ubyte4 * |
pCipherLen |
|
) |
| |
Gets the length of the ciphertext associated with a QS context in bytes.
- Parameters
-
pCtx | Pointer to the QS context. |
pCipherLen | Contents will be set to the length of the ciphertext in bytes. |
- Returns
OK
(0) if successful, otherwise a negative number error code from merrors.h.
◆ CRYPTO_INTERFACE_QS_KEM_getCipherTextLenFromAlgo()
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_QS_KEM_getCipherTextLenFromAlgo |
( |
ubyte4 |
algo, |
|
|
ubyte4 * |
pCipherLen |
|
) |
| |
Gets the length of the ciphertext associated with a QS algorithm in bytes.
- Parameters
-
algo | The algorithm identifier. |
pCipherLen | Contents will be set to the length of the ciphertext in bytes. |
- Returns
OK
(0) if successful, otherwise a negative number error code from merrors.h.
◆ CRYPTO_INTERFACE_QS_KEM_getSharedSecretLen()
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_QS_KEM_getSharedSecretLen |
( |
QS_CTX * |
pCtx, |
|
|
ubyte4 * |
pSharedSecretLen |
|
) |
| |
Gets the length of a shared secret associated with a QS context in bytes.
- Parameters
-
pCtx | Pointer to the QS context. |
pSharedSecretLen | Contents will be set to the length of the shared secret in bytes. |
- Returns
OK
(0) if successful, otherwise a negative number error code from merrors.h.