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

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: Also add a PRUint32 cast to counter >> 32. 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') | no next file with comments »
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..ca0b1fff344d3ba9661066b8126ad554ff7f8127 100644
--- a/nss/lib/freebl/chacha20/chacha20.c
+++ b/nss/lib/freebl/chacha20/chacha20.c
@@ -78,8 +78,8 @@ 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[13] = counter >> 32;
+ input[12] = (PRUint32)counter;
+ input[13] = (PRUint32)(counter >> 32);
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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698