xref: /aosp_15_r20/external/wpa_supplicant_8/src/tls/pkcs1.h (revision 03f9172ca588f91df233974f4258bab95191f931)
1*03f9172cSAndroid Build Coastguard Worker /*
2*03f9172cSAndroid Build Coastguard Worker  * PKCS #1 (RSA Encryption)
3*03f9172cSAndroid Build Coastguard Worker  * Copyright (c) 2006-2009, Jouni Malinen <[email protected]>
4*03f9172cSAndroid Build Coastguard Worker  *
5*03f9172cSAndroid Build Coastguard Worker  * This software may be distributed under the terms of the BSD license.
6*03f9172cSAndroid Build Coastguard Worker  * See README for more details.
7*03f9172cSAndroid Build Coastguard Worker  */
8*03f9172cSAndroid Build Coastguard Worker 
9*03f9172cSAndroid Build Coastguard Worker #ifndef PKCS1_H
10*03f9172cSAndroid Build Coastguard Worker #define PKCS1_H
11*03f9172cSAndroid Build Coastguard Worker 
12*03f9172cSAndroid Build Coastguard Worker struct crypto_public_key;
13*03f9172cSAndroid Build Coastguard Worker struct asn1_oid;
14*03f9172cSAndroid Build Coastguard Worker 
15*03f9172cSAndroid Build Coastguard Worker int pkcs1_encrypt(int block_type, struct crypto_rsa_key *key,
16*03f9172cSAndroid Build Coastguard Worker 		  int use_private, const u8 *in, size_t inlen,
17*03f9172cSAndroid Build Coastguard Worker 		  u8 *out, size_t *outlen);
18*03f9172cSAndroid Build Coastguard Worker int pkcs1_v15_private_key_decrypt(struct crypto_rsa_key *key,
19*03f9172cSAndroid Build Coastguard Worker 				  const u8 *in, size_t inlen,
20*03f9172cSAndroid Build Coastguard Worker 				  u8 *out, size_t *outlen);
21*03f9172cSAndroid Build Coastguard Worker int pkcs1_decrypt_public_key(struct crypto_rsa_key *key,
22*03f9172cSAndroid Build Coastguard Worker 			     const u8 *crypt, size_t crypt_len,
23*03f9172cSAndroid Build Coastguard Worker 			     u8 *plain, size_t *plain_len);
24*03f9172cSAndroid Build Coastguard Worker int pkcs1_v15_sig_ver(struct crypto_public_key *pk,
25*03f9172cSAndroid Build Coastguard Worker 		      const u8 *s, size_t s_len,
26*03f9172cSAndroid Build Coastguard Worker 		      const struct asn1_oid *hash_alg,
27*03f9172cSAndroid Build Coastguard Worker 		      const u8 *hash, size_t hash_len);
28*03f9172cSAndroid Build Coastguard Worker 
29*03f9172cSAndroid Build Coastguard Worker #endif /* PKCS1_H */
30