]>
Commit | Line | Data |
---|---|---|
cfc2bb32 TS |
1 | /* |
2 | * RSA internal helpers | |
3 | * | |
4 | * Copyright (c) 2015, Intel Corporation | |
5 | * Authors: Tadeusz Struk <tadeusz.struk@intel.com> | |
6 | * | |
7 | * This program is free software; you can redistribute it and/or modify it | |
8 | * under the terms of the GNU General Public License as published by the Free | |
9 | * Software Foundation; either version 2 of the License, or (at your option) | |
10 | * any later version. | |
11 | * | |
12 | */ | |
13 | #ifndef _RSA_HELPER_ | |
14 | #define _RSA_HELPER_ | |
5a7de973 | 15 | #include <linux/types.h> |
cfc2bb32 | 16 | |
5a7de973 TA |
17 | /** |
18 | * rsa_key - RSA key structure | |
19 | * @n : RSA modulus raw byte stream | |
20 | * @e : RSA public exponent raw byte stream | |
21 | * @d : RSA private exponent raw byte stream | |
22 | * @n_sz : length in bytes of RSA modulus n | |
23 | * @e_sz : length in bytes of RSA public exponent | |
24 | * @d_sz : length in bytes of RSA private exponent | |
25 | */ | |
cfc2bb32 | 26 | struct rsa_key { |
5a7de973 TA |
27 | const u8 *n; |
28 | const u8 *e; | |
29 | const u8 *d; | |
30 | size_t n_sz; | |
31 | size_t e_sz; | |
32 | size_t d_sz; | |
cfc2bb32 TS |
33 | }; |
34 | ||
22287b0b TS |
35 | int rsa_parse_pub_key(struct rsa_key *rsa_key, const void *key, |
36 | unsigned int key_len); | |
37 | ||
38 | int rsa_parse_priv_key(struct rsa_key *rsa_key, const void *key, | |
39 | unsigned int key_len); | |
cfc2bb32 | 40 | |
3d5b1ecd | 41 | extern struct crypto_template rsa_pkcs1pad_tmpl; |
cfc2bb32 | 42 | #endif |