SharkSSL C/C++ Reference
TLS, cryptography, certificates, and PSA integration
SharkSslCRACENFF.h
Go to the documentation of this file.
1
43#ifndef SHARKSSL_CRACEN_FF_H
44#define SHARKSSL_CRACEN_FF_H
45
46#include <stdint.h>
47
48#ifdef __cplusplus
49extern "C" {
50#endif
51
57#define SHARKSSL_CRACEN_FF_OK 0
58#define SHARKSSL_CRACEN_FF_BAD_ARGUMENT -1
59#define SHARKSSL_CRACEN_FF_UNAVAILABLE -2
60#define SHARKSSL_CRACEN_FF_HARDWARE_ERROR -3
68typedef struct SharkSslCRACENFF
69{
70 const uint8_t *prime;
71 uint16_t primeLen;
73
88int SharkSslCRACENFF_init(SharkSslCRACENFF *o, const uint8_t *prime, uint16_t primeLen);
89
107int SharkSslCRACENFF_modExp(const SharkSslCRACENFF *o, const uint8_t *base,
108 const uint8_t *exponent, uint8_t *result,
109 uint16_t baseLen, uint16_t exponentLen, uint16_t resultLen);
110
115#ifdef __cplusplus
116}
117#endif
118
119#endif
struct SharkSslCRACENFF SharkSslCRACENFF
Nordic CRACEN finite-field context.
int SharkSslCRACENFF_modExp(const SharkSslCRACENFF *o, const uint8_t *base, const uint8_t *exponent, uint8_t *result, uint16_t baseLen, uint16_t exponentLen, uint16_t resultLen)
Calculate base^exponent modulo the context's prime.
int SharkSslCRACENFF_init(SharkSslCRACENFF *o, const uint8_t *prime, uint16_t primeLen)
Initialize a caller-owned finite-field context after PSA Crypto initialization.
Nordic CRACEN finite-field context.
Definition: SharkSslCRACENFF.h:69
const uint8_t * prime
Borrowed big-endian prime; owned by the caller.
Definition: SharkSslCRACENFF.h:70
uint16_t primeLen
Prime length in bytes.
Definition: SharkSslCRACENFF.h:71