OLD | NEW |
1 /* Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 /* Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
2 * Use of this source code is governed by a BSD-style license that can be | 2 * Use of this source code is governed by a BSD-style license that can be |
3 * found in the LICENSE file. | 3 * found in the LICENSE file. |
4 */ | 4 */ |
5 | 5 |
6 #ifndef VBOOT_REFERENCE_RSA_H_ | 6 #ifndef VBOOT_REFERENCE_RSA_H_ |
7 #define VBOOT_REFERENCE_RSA_H_ | 7 #define VBOOT_REFERENCE_RSA_H_ |
8 | 8 |
9 #include <inttypes.h> | 9 #include <inttypes.h> |
10 | 10 |
(...skipping 10 matching lines...) Expand all Loading... |
21 typedef struct RSAPublicKey { | 21 typedef struct RSAPublicKey { |
22 int len; /* Length of n[] in number of uint32_t */ | 22 int len; /* Length of n[] in number of uint32_t */ |
23 uint32_t n0inv; /* -1 / n[0] mod 2^32 */ | 23 uint32_t n0inv; /* -1 / n[0] mod 2^32 */ |
24 uint32_t* n; /* modulus as little endian array */ | 24 uint32_t* n; /* modulus as little endian array */ |
25 uint32_t* rr; /* R^2 as little endian array */ | 25 uint32_t* rr; /* R^2 as little endian array */ |
26 } RSAPublicKey; | 26 } RSAPublicKey; |
27 | 27 |
28 /* Verify a RSA PKCS1.5 signature [sig] of [sig_type] and length [sig_len] | 28 /* Verify a RSA PKCS1.5 signature [sig] of [sig_type] and length [sig_len] |
29 * against an expected [hash] using [key]. Returns 0 on failure, 1 on success. | 29 * against an expected [hash] using [key]. Returns 0 on failure, 1 on success. |
30 */ | 30 */ |
31 int RSA_verify(const RSAPublicKey *key, | 31 int RSAVerify(const RSAPublicKey *key, |
32 const uint8_t* sig, | 32 const uint8_t* sig, |
33 const int sig_len, | 33 const int sig_len, |
34 const uint8_t sig_type, | 34 const uint8_t sig_type, |
35 const uint8_t* hash); | 35 const uint8_t* hash); |
36 | 36 |
37 #endif /* VBOOT_REFERENCE_RSA_H_ */ | 37 #endif /* VBOOT_REFERENCE_RSA_H_ */ |
OLD | NEW |