]> git.cryptolib.org Git - arm-crypto-lib.git/blob - rsa/rsassa_pkcs1v15.h
improving present
[arm-crypto-lib.git] / rsa / rsassa_pkcs1v15.h
1 /* rsassa_pkcs1v15.h */
2 /*
3     This file is part of the AVR-Crypto-Lib.
4     Copyright (C) 2012 Daniel Otte (daniel.otte@rub.de)
5
6     This program is free software: you can redistribute it and/or modify
7     it under the terms of the GNU General Public License as published by
8     the Free Software Foundation, either version 3 of the License, or
9     (at your option) any later version.
10
11     This program is distributed in the hope that it will be useful,
12     but WITHOUT ANY WARRANTY; without even the implied warranty of
13     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14     GNU General Public License for more details.
15
16     You should have received a copy of the GNU General Public License
17     along with this program.  If not, see <http://www.gnu.org/licenses/>.
18 */
19
20 #ifndef RSASSA_PKCS1V15_H_
21 #define RSASSA_PKCS1V15_H_
22
23 #include <stdint.h>
24 #include "rsa_basic.h"
25
26 typedef struct {
27         const uint8_t length;
28         const uint8_t *data;
29 } pkcs1v15_algo_prefix_t;
30
31 extern const pkcs1v15_algo_prefix_t pkcs1v15_md5_prefix;
32 extern const pkcs1v15_algo_prefix_t pkcs1v15_sha1_prefix;
33 extern const pkcs1v15_algo_prefix_t pkcs1v15_sha224_prefix;
34 extern const pkcs1v15_algo_prefix_t pkcs1v15_sha256_prefix;
35 extern const pkcs1v15_algo_prefix_t pkcs1v15_sha384_prefix;
36 extern const pkcs1v15_algo_prefix_t pkcs1v15_sha512_prefix;
37
38 uint8_t rsa_sign_pkcs1v15(void* dest, uint16_t* out_length_B, const void* hash,
39                 uint16_t hash_length_B, const rsa_privatekey_t* key,
40                 const pkcs1v15_algo_prefix_t* algo_prefix);
41
42 uint8_t rsa_verify_pkcs1v15(const void* signature, uint16_t signature_length_B,
43                 const void* hash, uint16_t hash_length_B, const rsa_publickey_t* key,
44                 const pkcs1v15_algo_prefix_t* algo_prefix);
45
46 #endif /* RSASSA_PKCS1V15_H_ */