Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(297)

Side by Side Diff: firmware/lib/cryptolib/include/rsa.h

Issue 6733018: Use uint64_t and avoid down casting as much as possible. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/vboot_reference.git@master
Patch Set: Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | firmware/lib/cryptolib/rsa_utility.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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_ */
OLDNEW
« no previous file with comments | « no previous file | firmware/lib/cryptolib/rsa_utility.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698