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

Unified Diff: src/platform/vboot_reference/crypto/rsa_utility.c

Issue 660261: Refactor siglen_map[] to store key size in bytes instead of 32-bit words. (Closed)
Patch Set: Created 10 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: src/platform/vboot_reference/crypto/rsa_utility.c
diff --git a/src/platform/vboot_reference/crypto/rsa_utility.c b/src/platform/vboot_reference/crypto/rsa_utility.c
index a64b0620aab362a7b5e3b03d5283e79bf217ed4f..ecb00a1bc35b78cbe8f78c125fdb5d915ef02545 100644
--- a/src/platform/vboot_reference/crypto/rsa_utility.c
+++ b/src/platform/vboot_reference/crypto/rsa_utility.c
@@ -11,8 +11,8 @@
#include "utility.h"
int RSAProcessedKeySize(int algorithm) {
- int key_len = siglen_map[algorithm] * sizeof(uint32_t); /* Key length in
- * bytes. */
+ int key_len = siglen_map[algorithm]; /* Key length in
+ * bytes. */
/* Total size needed by a RSAPublicKey structure is =
* 2 * key_len bytes for the n and rr arrays
* + sizeof len + sizeof n0inv.
@@ -69,7 +69,7 @@ int RSAVerifyBinary_f(const uint8_t* key_blob,
if (algorithm >= kNumAlgorithms)
return 0; /* Invalid algorithm. */
key_size = RSAProcessedKeySize(algorithm);
- sig_size = siglen_map[algorithm] * sizeof(uint32_t);
+ sig_size = siglen_map[algorithm];
if (key_blob && !key)
verification_key = RSAPublicKeyFromBuf(key_blob, key_size);
« no previous file with comments | « src/platform/vboot_reference/crypto/rsa.c ('k') | src/platform/vboot_reference/tests/rsa_verify_benchmark.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698