| 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 #ifndef VBOOT_REFERENCE_CRYPTOLIB_H_ | 9 #ifndef VBOOT_REFERENCE_CRYPTOLIB_H_ |
| 10 #error "Do not include this file directly. Use cryptolib.h instead." | 10 #error "Do not include this file directly. Use cryptolib.h instead." |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 unsigned int algorithm); | 68 unsigned int algorithm); |
| 69 | 69 |
| 70 | 70 |
| 71 /* ----Some additional utility functions for RSA.---- */ | 71 /* ----Some additional utility functions for RSA.---- */ |
| 72 | 72 |
| 73 /* Returns the size of a pre-processed RSA public key in | 73 /* Returns the size of a pre-processed RSA public key in |
| 74 * [out_size] with the algorithm [algorithm]. | 74 * [out_size] with the algorithm [algorithm]. |
| 75 * | 75 * |
| 76 * Returns 1 on success, 0 on failure. | 76 * Returns 1 on success, 0 on failure. |
| 77 */ | 77 */ |
| 78 int RSAProcessedKeySize(unsigned int algorithm, int* out_size); | 78 uint64_t RSAProcessedKeySize(uint64_t algorithm, uint64_t* out_size); |
| 79 | 79 |
| 80 /* Allocate a new RSAPublicKey structure and initialize its pointer fields to | 80 /* Allocate a new RSAPublicKey structure and initialize its pointer fields to |
| 81 * NULL */ | 81 * NULL */ |
| 82 RSAPublicKey* RSAPublicKeyNew(void); | 82 RSAPublicKey* RSAPublicKeyNew(void); |
| 83 | 83 |
| 84 /* Deep free the contents of [key]. */ | 84 /* Deep free the contents of [key]. */ |
| 85 void RSAPublicKeyFree(RSAPublicKey* key); | 85 void RSAPublicKeyFree(RSAPublicKey* key); |
| 86 | 86 |
| 87 /* Create a RSAPublic key structure from binary blob [buf] of length | 87 /* Create a RSAPublic key structure from binary blob [buf] of length |
| 88 * [len]. | 88 * [len]. |
| 89 * | 89 * |
| 90 * Caller owns the returned key and must free it. | 90 * Caller owns the returned key and must free it. |
| 91 */ | 91 */ |
| 92 RSAPublicKey* RSAPublicKeyFromBuf(const uint8_t* buf, int len); | 92 RSAPublicKey* RSAPublicKeyFromBuf(const uint8_t* buf, uint64_t len); |
| 93 | 93 |
| 94 | 94 |
| 95 #endif /* VBOOT_REFERENCE_RSA_H_ */ | 95 #endif /* VBOOT_REFERENCE_RSA_H_ */ |
| OLD | NEW |