Go to the documentation of this file.
32 #define TRACE_LEVEL CRYPTO_TRACE_LEVEL
39 #if (KEM_SUPPORT == ENABLED)
68 if(context->
sk != NULL)
79 if(context->
pk != NULL)
109 if(context->
sk == NULL)
115 if(context->
sk != NULL)
118 if(context->
pk == NULL)
124 if(context->
pk != NULL)
128 context->
pk, context->
sk);
171 if(context->
pk == NULL)
177 if(context->
pk != NULL)
210 void *prngContext, uint8_t *ct, uint8_t *ss)
215 if(context->
kemAlgo != NULL && context->
pk != NULL)
245 if(context->
kemAlgo != NULL && context->
sk != NULL)
void kemInit(KemContext *context, const KemAlgo *kemAlgo)
Initialize KEM context.
void kemFree(KemContext *context)
Release KEM context.
error_t kemEncapsulate(KemContext *context, const PrngAlgo *prngAlgo, void *prngContext, uint8_t *ct, uint8_t *ss)
Encapsulation algorithm.
@ ERROR_INVALID_PARAMETER
Invalid parameter.
#define osMemcpy(dest, src, length)
KemAlgoDecapsulate decapsulate
General definitions for cryptographic algorithms.
KemAlgoGenerateKeyPair generateKeyPair
KemAlgoEncapsulate encapsulate
error_t kemGenerateKeyPair(KemContext *context, const PrngAlgo *prngAlgo, void *prngContext)
Key pair generation.
Common interface for key encapsulation mechanisms (KEM)
error_t kemLoadPublicKey(KemContext *context, const uint8_t *pk)
Load public key.
Key encapsulation mechanism (KEM)
error_t kemDecapsulate(KemContext *context, const uint8_t *ct, uint8_t *ss)
Decapsulation algorithm.
const KemAlgo * kemAlgo
Key encapsulation mechanism.
#define cryptoAllocMem(size)
#define osMemset(p, value, length)