xref: /freebsd/contrib/wpa/src/tls/rsa.h (revision b2d48be1bc7df45ddd13b143a160d0acb5a383c5)
1 /*
2  * RSA
3  * Copyright (c) 2006, Jouni Malinen <j@w1.fi>
4  *
5  * This software may be distributed under the terms of the BSD license.
6  * See README for more details.
7  */
8 
9 #ifndef RSA_H
10 #define RSA_H
11 
12 struct crypto_rsa_key;
13 
14 struct crypto_rsa_key *
15 crypto_rsa_import_public_key(const u8 *buf, size_t len);
16 struct crypto_rsa_key *
17 crypto_rsa_import_public_key_parts(const u8 *n, size_t n_len,
18 				   const u8 *e, size_t e_len);
19 struct crypto_rsa_key *
20 crypto_rsa_import_private_key(const u8 *buf, size_t len);
21 size_t crypto_rsa_get_modulus_len(struct crypto_rsa_key *key);
22 int crypto_rsa_exptmod(const u8 *in, size_t inlen, u8 *out, size_t *outlen,
23 		       struct crypto_rsa_key *key, int use_private);
24 void crypto_rsa_free(struct crypto_rsa_key *key);
25 
26 #endif /* RSA_H */
27