TrustCore SDK Crypto Interface API reference  version 2.0
crypto_interface_qs_kem.h
Go to the documentation of this file.
1 /*
2  * crypto_interface_qs_kem.h
3  *
4  * Cryptographic Interface header file for declaring Key Encapsulation Mechanism methods.
5  *
6  * Copyright 2019-2024 DigiCert, Inc. All Rights Reserved.
7  * Proprietary and Confidential Material.
8  *
9  */
10 
17 #ifndef __CRYPTO_INTERFACE_QS_KEM_HEADER__
18 #define __CRYPTO_INTERFACE_QS_KEM_HEADER__
19 
20 #include "../crypto_interface/crypto_interface_qs.h"
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 
37 MOC_EXTERN MSTATUS CRYPTO_INTERFACE_QS_KEM_getCipherTextLenFromAlgo(ubyte4 algo, ubyte4 *pCipherLen);
38 
50 MOC_EXTERN MSTATUS CRYPTO_INTERFACE_QS_KEM_getCipherTextLen(QS_CTX *pCtx, ubyte4 *pCipherLen);
51 
63 MOC_EXTERN MSTATUS CRYPTO_INTERFACE_QS_KEM_getSharedSecretLen(QS_CTX *pCtx, ubyte4 *pSharedSecretLen);
64 
82 MOC_EXTERN MSTATUS CRYPTO_INTERFACE_QS_KEM_encapsulate(QS_CTX *pCtx, RNGFun rngFun, void *pRngFunArg, ubyte *pCipherText, ubyte4 cipherTextLen,
83  ubyte *pSharedSecret, ubyte4 sharedSecretLen);
84 
106 MOC_EXTERN MSTATUS CRYPTO_INTERFACE_QS_KEM_encapsulateAlloc(QS_CTX *pCtx, RNGFun rngFun, void *pRngFunArg, ubyte **ppCipherText, ubyte4* pCipherTextLen,
107  ubyte **ppSharedSecret, ubyte4 *pSharedSecretLen);
108 
123 MOC_EXTERN MSTATUS CRYPTO_INTERFACE_QS_KEM_decapsulate(QS_CTX *pCtx, ubyte *pCipherText, ubyte4 cipherTextLen, ubyte *pSharedSecret, ubyte4 sharedSecretLen);
124 
141 MOC_EXTERN MSTATUS CRYPTO_INTERFACE_QS_KEM_decapsulateAlloc(QS_CTX *pCtx, ubyte *pCipherText, ubyte4 cipherTextLen, ubyte **ppSharedSecret, ubyte4 *pSharedSecretLen);
142 
143 #ifdef __cplusplus
144 }
145 #endif
146 
147 #endif /* __CRYPTO_INTERFACE_QS_KEM_HEADER__ */
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.
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_QS_KEM_decapsulate(QS_CTX *pCtx, ubyte *pCipherText, ubyte4 cipherTextLen, ubyte *pSharedSecret, ubyte4 sharedSecretLen)
Performs the key decapsulation algorithm.
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.
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.
Context structure to hold the appropriate quantum safe asymmetric keys.
Definition: crypto_interface_qs.h:49
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.
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.
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_QS_KEM_decapsulateAlloc(QS_CTX *pCtx, ubyte *pCipherText, ubyte4 cipherTextLen, ubyte **ppSharedSecret, ubyte4 *pSharedSecretLen)
Performs the key decapsulation algorithm.