blob: dd9ecdc98cac89ac39b58b2477c94254b050f76f [file] [log] [blame]
Pankaj Gupta95c7eee2020-12-09 14:02:39 +05301/*
Pankaj Gupta7834b462021-03-25 15:15:52 +05302 * Copyright 2017-2021 NXP
Pankaj Gupta95c7eee2020-12-09 14:02:39 +05303 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 *
6 */
7
8#ifndef _RSA_H__
9#define _RSA_H__
10
11/* RSA key size defines */
12#define RSA_4K_KEY_SZ 4096
13#define RSA_4K_KEY_SZ_BYTES (RSA_4K_KEY_SZ/8)
14#define RSA_2K_KEY_SZ 2048
15#define RSA_2K_KEY_SZ_BYTES (RSA_2K_KEY_SZ/8)
16#define RSA_1K_KEY_SZ 1024
17#define RSA_1K_KEY_SZ_BYTES (RSA_1K_KEY_SZ/8)
18
19#define SHA256_BYTES (256/8)
20
21struct pk_in_params {
22 uint8_t *e;
23 uint32_t e_siz;
24 uint8_t *n;
25 uint32_t n_siz;
26 uint8_t *a;
27 uint32_t a_siz;
28 uint8_t *b;
29 uint32_t b_siz;
30};
31
32struct rsa_context {
33 struct pk_in_params pkin;
34};
35
36int rsa_verify_signature(void *hash_ptr, unsigned int hash_len,
37 void *sig_ptr, unsigned int sig_len,
38 void *pk_ptr, unsigned int pk_len);
39
40#endif