blob: c7585bdecbc26326c7c23510f0c0961b0f4d111e [file] [log] [blame]
Tadeusz Strukcfc2bb32015-06-16 10:31:01 -07001/*
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/mpi.h>
16
17struct rsa_key {
18 MPI n;
19 MPI e;
20 MPI d;
21};
22
Tadeusz Struk22287b02015-10-08 09:26:55 -070023int rsa_parse_pub_key(struct rsa_key *rsa_key, const void *key,
24 unsigned int key_len);
25
26int rsa_parse_priv_key(struct rsa_key *rsa_key, const void *key,
27 unsigned int key_len);
Tadeusz Strukcfc2bb32015-06-16 10:31:01 -070028
29void rsa_free_key(struct rsa_key *rsa_key);
Andrzej Zaborowski3d5b1ec2015-12-05 17:09:34 +010030
31extern struct crypto_template rsa_pkcs1pad_tmpl;
Tadeusz Strukcfc2bb32015-06-16 10:31:01 -070032#endif