xref: /freebsd/contrib/wpa/src/tls/pkcs1.h (revision eda14cbc264d6969b02f2b1994cef11148e914f1)
1 /*
2  * PKCS #1 (RSA Encryption)
3  * Copyright (c) 2006-2009, 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 PKCS1_H
10 #define PKCS1_H
11 
12 struct crypto_public_key;
13 struct asn1_oid;
14 
15 int pkcs1_encrypt(int block_type, struct crypto_rsa_key *key,
16 		  int use_private, const u8 *in, size_t inlen,
17 		  u8 *out, size_t *outlen);
18 int pkcs1_v15_private_key_decrypt(struct crypto_rsa_key *key,
19 				  const u8 *in, size_t inlen,
20 				  u8 *out, size_t *outlen);
21 int pkcs1_decrypt_public_key(struct crypto_rsa_key *key,
22 			     const u8 *crypt, size_t crypt_len,
23 			     u8 *plain, size_t *plain_len);
24 int pkcs1_v15_sig_ver(struct crypto_public_key *pk,
25 		      const u8 *s, size_t s_len,
26 		      const struct asn1_oid *hash_alg,
27 		      const u8 *hash, size_t hash_len);
28 
29 #endif /* PKCS1_H */
30