nrfxlib API 3.3.99
Loading...
Searching...
No Matches
ocrypto_rsa.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2016 - 2025 Nordic Semiconductor ASA
3 * Copyright (c) since 2013 Oberon microsystems AG
4 *
5 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
6 */
7
8
32#ifndef OCRYPTO_RSA_H
33#define OCRYPTO_RSA_H
34
35#include <stddef.h>
36#include <stdint.h>
37
38#include "ocrypto_rsa_key.h"
39
40
41#ifdef __cplusplus
42extern "C" {
43#endif
44
45
73 uint8_t c[128],
74 const uint8_t *m, size_t m_len,
75 const uint8_t *seed, size_t s_len,
76 const ocrypto_rsa1024_pub_key *pk);
77
96 uint8_t *m, size_t m_len,
97 const uint8_t c[128],
98 const ocrypto_rsa1024_key *sk);
99
118 uint8_t *m, size_t m_len,
119 const uint8_t c[128],
120 const ocrypto_rsa1024_crt_key *sk);
121
142 uint8_t c[128],
143 const uint8_t *m, size_t m_len,
144 const uint8_t *label, size_t l_len,
145 const uint8_t seed[32],
146 const ocrypto_rsa1024_pub_key *pk);
147
168 uint8_t *m, size_t m_len,
169 const uint8_t c[128],
170 const uint8_t *label, size_t l_len,
171 const ocrypto_rsa1024_key *sk);
172
193 uint8_t *m, size_t m_len,
194 const uint8_t c[128],
195 const uint8_t *label, size_t l_len,
196 const ocrypto_rsa1024_crt_key *sk);
197
214 uint8_t s[128],
215 const uint8_t *m, size_t m_len,
216 const ocrypto_rsa1024_key *sk);
217
234 uint8_t s[128],
235 const uint8_t *m, size_t m_len,
236 const ocrypto_rsa1024_crt_key *sk);
237
254 const uint8_t s[128],
255 const uint8_t *m, size_t m_len,
256 const ocrypto_rsa1024_pub_key *pk);
257
277 uint8_t s[128],
278 const uint8_t *m, size_t m_len,
279 const uint8_t *salt, size_t s_len,
280 const ocrypto_rsa1024_key *sk);
281
301 uint8_t s[128],
302 const uint8_t *m, size_t m_len,
303 const uint8_t *salt, size_t s_len,
304 const ocrypto_rsa1024_crt_key *sk);
305
324 const uint8_t s[128],
325 const uint8_t *m, size_t m_len,
326 size_t s_len,
327 const ocrypto_rsa1024_pub_key *pk);
358 uint8_t c[256],
359 const uint8_t *m, size_t mlen,
360 const uint8_t *seed, size_t slen,
361 const ocrypto_rsa2048_pub_key *pk);
362
381 uint8_t *m, size_t mlen,
382 const uint8_t c[256],
383 const ocrypto_rsa2048_key *sk);
384
403 uint8_t *m, size_t mlen,
404 const uint8_t c[256],
405 const ocrypto_rsa2048_crt_key *sk);
406
427 uint8_t c[256],
428 const uint8_t *m, size_t mlen,
429 const uint8_t *label, size_t llen,
430 const uint8_t seed[32],
431 const ocrypto_rsa2048_pub_key *pk);
432
453 uint8_t *m, size_t mlen,
454 const uint8_t c[256],
455 const uint8_t *label, size_t llen,
456 const ocrypto_rsa2048_key *sk);
457
478 uint8_t *m, size_t mlen,
479 const uint8_t c[256],
480 const uint8_t *label, size_t llen,
481 const ocrypto_rsa2048_crt_key *sk);
482
499 uint8_t s[256],
500 const uint8_t *m, size_t mlen,
501 const ocrypto_rsa2048_key *sk);
502
519 uint8_t s[256],
520 const uint8_t *m, size_t mlen,
521 const ocrypto_rsa2048_crt_key *sk);
522
539 const uint8_t s[256],
540 const uint8_t *m, size_t mlen,
541 const ocrypto_rsa2048_pub_key *pk);
542
562 uint8_t s[256],
563 const uint8_t *m, size_t mlen,
564 const uint8_t *salt, size_t slen,
565 const ocrypto_rsa2048_key *sk);
566
586 uint8_t s[256],
587 const uint8_t *m, size_t mlen,
588 const uint8_t *salt, size_t slen,
589 const ocrypto_rsa2048_crt_key *sk);
590
609 const uint8_t s[256],
610 const uint8_t *m, size_t mlen,
611 size_t slen, // salt length
612 const ocrypto_rsa2048_pub_key *pk);
616#ifdef __cplusplus
617}
618#endif
619
620#endif
621
int ocrypto_rsa2048_pkcs1_v15_sha256_crt_sign(uint8_t s[256], const uint8_t *m, size_t mlen, const ocrypto_rsa2048_crt_key *sk)
int ocrypto_rsa2048_pkcs1_v15_sha256_verify(const uint8_t s[256], const uint8_t *m, size_t mlen, const ocrypto_rsa2048_pub_key *pk)
int ocrypto_rsa2048_pkcs1_v15_sha256_sign(uint8_t s[256], const uint8_t *m, size_t mlen, const ocrypto_rsa2048_key *sk)
int ocrypto_rsa1024_pkcs1_v15_decrypt(uint8_t *m, size_t m_len, const uint8_t c[128], const ocrypto_rsa1024_key *sk)
int ocrypto_rsa1024_pkcs1_v15_sha256_crt_sign(uint8_t s[128], const uint8_t *m, size_t m_len, const ocrypto_rsa1024_crt_key *sk)
int ocrypto_rsa2048_pss_sha256_sign(uint8_t s[256], const uint8_t *m, size_t mlen, const uint8_t *salt, size_t slen, const ocrypto_rsa2048_key *sk)
int ocrypto_rsa2048_oaep_sha256_encrypt(uint8_t c[256], const uint8_t *m, size_t mlen, const uint8_t *label, size_t llen, const uint8_t seed[32], const ocrypto_rsa2048_pub_key *pk)
int ocrypto_rsa1024_pss_sha256_sign(uint8_t s[128], const uint8_t *m, size_t m_len, const uint8_t *salt, size_t s_len, const ocrypto_rsa1024_key *sk)
int ocrypto_rsa1024_pkcs1_v15_sha256_verify(const uint8_t s[128], const uint8_t *m, size_t m_len, const ocrypto_rsa1024_pub_key *pk)
int ocrypto_rsa2048_oaep_sha256_crt_decrypt(uint8_t *m, size_t mlen, const uint8_t c[256], const uint8_t *label, size_t llen, const ocrypto_rsa2048_crt_key *sk)
int ocrypto_rsa1024_oaep_sha256_crt_decrypt(uint8_t *m, size_t m_len, const uint8_t c[128], const uint8_t *label, size_t l_len, const ocrypto_rsa1024_crt_key *sk)
int ocrypto_rsa1024_pkcs1_v15_encrypt(uint8_t c[128], const uint8_t *m, size_t m_len, const uint8_t *seed, size_t s_len, const ocrypto_rsa1024_pub_key *pk)
int ocrypto_rsa2048_pss_sha256_verify(const uint8_t s[256], const uint8_t *m, size_t mlen, size_t slen, const ocrypto_rsa2048_pub_key *pk)
int ocrypto_rsa1024_pkcs1_v15_crt_decrypt(uint8_t *m, size_t m_len, const uint8_t c[128], const ocrypto_rsa1024_crt_key *sk)
int ocrypto_rsa2048_pss_sha256_crt_sign(uint8_t s[256], const uint8_t *m, size_t mlen, const uint8_t *salt, size_t slen, const ocrypto_rsa2048_crt_key *sk)
int ocrypto_rsa2048_pkcs1_v15_encrypt(uint8_t c[256], const uint8_t *m, size_t mlen, const uint8_t *seed, size_t slen, const ocrypto_rsa2048_pub_key *pk)
int ocrypto_rsa1024_oaep_sha256_decrypt(uint8_t *m, size_t m_len, const uint8_t c[128], const uint8_t *label, size_t l_len, const ocrypto_rsa1024_key *sk)
int ocrypto_rsa2048_oaep_sha256_decrypt(uint8_t *m, size_t mlen, const uint8_t c[256], const uint8_t *label, size_t llen, const ocrypto_rsa2048_key *sk)
int ocrypto_rsa2048_pkcs1_v15_crt_decrypt(uint8_t *m, size_t mlen, const uint8_t c[256], const ocrypto_rsa2048_crt_key *sk)
int ocrypto_rsa1024_pss_sha256_verify(const uint8_t s[128], const uint8_t *m, size_t m_len, size_t s_len, const ocrypto_rsa1024_pub_key *pk)
int ocrypto_rsa1024_pss_sha256_crt_sign(uint8_t s[128], const uint8_t *m, size_t m_len, const uint8_t *salt, size_t s_len, const ocrypto_rsa1024_crt_key *sk)
int ocrypto_rsa2048_pkcs1_v15_decrypt(uint8_t *m, size_t mlen, const uint8_t c[256], const ocrypto_rsa2048_key *sk)
int ocrypto_rsa1024_oaep_sha256_encrypt(uint8_t c[128], const uint8_t *m, size_t m_len, const uint8_t *label, size_t l_len, const uint8_t seed[32], const ocrypto_rsa1024_pub_key *pk)
int ocrypto_rsa1024_pkcs1_v15_sha256_sign(uint8_t s[128], const uint8_t *m, size_t m_len, const ocrypto_rsa1024_key *sk)
RSA key setup, for 1024 and 2048 bit keys.
Definition ocrypto_rsa_key.h:78
Definition ocrypto_rsa_key.h:68
Definition ocrypto_rsa_key.h:58
Definition ocrypto_rsa_key.h:118
Definition ocrypto_rsa_key.h:108
Definition ocrypto_rsa_key.h:98