18d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt/*
28d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * PKCS #1 (RSA Encryption)
38d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * Copyright (c) 2006-2009, Jouni Malinen <j@w1.fi>
48d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt *
5c5ec7f57ead87efa365800228aa0b09a12d9e6c4Dmitry Shmidt * This software may be distributed under the terms of the BSD license.
6c5ec7f57ead87efa365800228aa0b09a12d9e6c4Dmitry Shmidt * See README for more details.
78d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt */
88d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
98d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#ifndef PKCS1_H
108d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define PKCS1_H
118d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
128d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint pkcs1_encrypt(int block_type, struct crypto_rsa_key *key,
138d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		  int use_private, const u8 *in, size_t inlen,
148d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		  u8 *out, size_t *outlen);
158d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint pkcs1_v15_private_key_decrypt(struct crypto_rsa_key *key,
168d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt				  const u8 *in, size_t inlen,
178d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt				  u8 *out, size_t *outlen);
188d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint pkcs1_decrypt_public_key(struct crypto_rsa_key *key,
198d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt			     const u8 *crypt, size_t crypt_len,
208d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt			     u8 *plain, size_t *plain_len);
218d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
228d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#endif /* PKCS1_H */
23