nrfxlib API 2.7.99
Loading...
Searching...
No Matches
ocrypto_rsa.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2016 - 2024 Nordic Semiconductor ASA
3 * Copyright (c) since 2013 Oberon microsystems AG
4 *
5 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
6 */
7
8
25#ifndef OCRYPTO_RSA_H
26#define OCRYPTO_RSA_H
27
28#include <stddef.h>
29#include <stdint.h>
30
31#include "ocrypto_rsa_key.h"
32
33
34#ifdef __cplusplus
35extern "C" {
36#endif
37
38
65 uint8_t c[128],
66 const uint8_t *m, size_t m_len,
67 const uint8_t *seed, size_t s_len,
68 const ocrypto_rsa1024_pub_key *pk);
69
88 uint8_t *m, size_t m_len,
89 const uint8_t c[128],
90 const ocrypto_rsa1024_key *sk);
91
110 uint8_t *m, size_t m_len,
111 const uint8_t c[128],
112 const ocrypto_rsa1024_crt_key *sk);
113
134 uint8_t c[128],
135 const uint8_t *m, size_t m_len,
136 const uint8_t *label, size_t l_len,
137 const uint8_t seed[32],
138 const ocrypto_rsa1024_pub_key *pk);
139
160 uint8_t *m, size_t m_len,
161 const uint8_t c[128],
162 const uint8_t *label, size_t l_len,
163 const ocrypto_rsa1024_key *sk);
164
185 uint8_t *m, size_t m_len,
186 const uint8_t c[128],
187 const uint8_t *label, size_t l_len,
188 const ocrypto_rsa1024_crt_key *sk);
189
206 uint8_t s[128],
207 const uint8_t *m, size_t m_len,
208 const ocrypto_rsa1024_key *sk);
209
226 uint8_t s[128],
227 const uint8_t *m, size_t m_len,
228 const ocrypto_rsa1024_crt_key *sk);
229
246 const uint8_t s[128],
247 const uint8_t *m, size_t m_len,
248 const ocrypto_rsa1024_pub_key *pk);
249
269 uint8_t s[128],
270 const uint8_t *m, size_t m_len,
271 const uint8_t *salt, size_t s_len,
272 const ocrypto_rsa1024_key *sk);
273
293 uint8_t s[128],
294 const uint8_t *m, size_t m_len,
295 const uint8_t *salt, size_t s_len,
296 const ocrypto_rsa1024_crt_key *sk);
297
316 const uint8_t s[128],
317 const uint8_t *m, size_t m_len,
318 size_t s_len,
319 const ocrypto_rsa1024_pub_key *pk);
349 uint8_t c[256],
350 const uint8_t *m, size_t mlen,
351 const uint8_t *seed, size_t slen,
352 const ocrypto_rsa2048_pub_key *pk);
353
372 uint8_t *m, size_t mlen,
373 const uint8_t c[256],
374 const ocrypto_rsa2048_key *sk);
375
394 uint8_t *m, size_t mlen,
395 const uint8_t c[256],
396 const ocrypto_rsa2048_crt_key *sk);
397
418 uint8_t c[256],
419 const uint8_t *m, size_t mlen,
420 const uint8_t *label, size_t llen,
421 const uint8_t seed[32],
422 const ocrypto_rsa2048_pub_key *pk);
423
444 uint8_t *m, size_t mlen,
445 const uint8_t c[256],
446 const uint8_t *label, size_t llen,
447 const ocrypto_rsa2048_key *sk);
448
469 uint8_t *m, size_t mlen,
470 const uint8_t c[256],
471 const uint8_t *label, size_t llen,
472 const ocrypto_rsa2048_crt_key *sk);
473
490 uint8_t s[256],
491 const uint8_t *m, size_t mlen,
492 const ocrypto_rsa2048_key *sk);
493
510 uint8_t s[256],
511 const uint8_t *m, size_t mlen,
512 const ocrypto_rsa2048_crt_key *sk);
513
530 const uint8_t s[256],
531 const uint8_t *m, size_t mlen,
532 const ocrypto_rsa2048_pub_key *pk);
533
553 uint8_t s[256],
554 const uint8_t *m, size_t mlen,
555 const uint8_t *salt, size_t slen,
556 const ocrypto_rsa2048_key *sk);
557
577 uint8_t s[256],
578 const uint8_t *m, size_t mlen,
579 const uint8_t *salt, size_t slen,
580 const ocrypto_rsa2048_crt_key *sk);
581
600 const uint8_t s[256],
601 const uint8_t *m, size_t mlen,
602 size_t slen, // salt length
603 const ocrypto_rsa2048_pub_key *pk);
607#ifdef __cplusplus
608}
609#endif
610
611#endif
612
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)
Definition: ocrypto_rsa_key.h:66
Definition: ocrypto_rsa_key.h:56
Definition: ocrypto_rsa_key.h:46
Definition: ocrypto_rsa_key.h:105
Definition: ocrypto_rsa_key.h:95
Definition: ocrypto_rsa_key.h:85