SharkSSL C/C++ Reference
TLS, cryptography, certificates, and PSA integration
SharkSslCRACENSM4.h
Go to the documentation of this file.
1
43#ifndef SHARKSSL_CRACEN_SM4_H
44#define SHARKSSL_CRACEN_SM4_H
45
46#include <stddef.h>
47#include <stdint.h>
48
49#ifdef __cplusplus
50extern "C" {
51#endif
52
58#define SHARKSSL_CRACEN_SM4_BLOCK_LEN 16
59#define SHARKSSL_CRACEN_SM4_KEY_LEN 16
60#define SHARKSSL_CRACEN_SM4_MODE_ECB 0
61#define SHARKSSL_CRACEN_SM4_MODE_CBC 1
62#define SHARKSSL_CRACEN_SM4_MODE_CTR 2
63#define SHARKSSL_CRACEN_SM4_OK 0
64#define SHARKSSL_CRACEN_SM4_BAD_ARGUMENT -1
65#define SHARKSSL_CRACEN_SM4_UNAVAILABLE -2
66#define SHARKSSL_CRACEN_SM4_HARDWARE_ERROR -3
91int sharkssl_CRACENSM4_crypt(unsigned int mode, unsigned int decrypt,
92 const uint8_t *key, const uint8_t *iv,
93 const uint8_t *input, size_t inputLen,
94 uint8_t *output, size_t outputSize);
95
100#ifdef __cplusplus
101}
102#endif
103
104#endif
int sharkssl_CRACENSM4_crypt(unsigned int mode, unsigned int decrypt, const uint8_t *key, const uint8_t *iv, const uint8_t *input, size_t inputLen, uint8_t *output, size_t outputSize)
Encrypt or decrypt using SM4-128 on Nordic CRACEN.