d6c042a2ee52a5692ea2d486e0072d1e972a749e
[deliverable/linux.git] / include / crypto / internal / rsa.h
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_
15 #include <linux/types.h>
16
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 */
26 struct rsa_key {
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;
33 };
34
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);
40
41 extern struct crypto_template rsa_pkcs1pad_tmpl;
42 #endif
This page took 0.031899 seconds and 4 git commands to generate.