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

Unified Diff: nss/lib/freebl/chacha20/chacha20.c

Issue 515383002: Avoids MSVC warnings about possible value truncation. (Closed) Base URL: http://src.chromium.org/svn/trunk/deps/third_party/nss
Patch Set: Created 6 years, 4 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
« no previous file with comments | « no previous file | nss/lib/freebl/poly1305/poly1305.c » ('j') | patches/nss-chacha20-poly1305.patch » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: nss/lib/freebl/chacha20/chacha20.c
diff --git a/nss/lib/freebl/chacha20/chacha20.c b/nss/lib/freebl/chacha20/chacha20.c
index 34bea804e7d8cad5cc12b7e53055a5fb6c3fc46d..50b9aad6a8a94010bca4bb828c4fa57bba5b1571 100644
--- a/nss/lib/freebl/chacha20/chacha20.c
+++ b/nss/lib/freebl/chacha20/chacha20.c
@@ -78,7 +78,7 @@ void ChaCha20XOR(unsigned char *out, const unsigned char *in, unsigned int inLen
input[2] = U8TO32_LITTLE(sigma + 8);
input[3] = U8TO32_LITTLE(sigma + 12);
- input[12] = counter;
+ input[12] = (PRUint32)counter;
input[13] = counter >> 32;
wtc 2014/08/28 20:45:11 Just wanted to confirm: this line doesn't require
agl 2014/08/28 20:51:30 I might be tempted to put it anyway. I would guess
Peter Kasting 2014/08/28 21:11:44 MSVC doesn't require the cast to avoid triggering
input[14] = U8TO32_LITTLE(nonce + 0);
input[15] = U8TO32_LITTLE(nonce + 4);
« no previous file with comments | « no previous file | nss/lib/freebl/poly1305/poly1305.c » ('j') | patches/nss-chacha20-poly1305.patch » ('J')

Powered by Google App Engine
This is Rietveld 408576698