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

Side by Side Diff: mozilla/security/nss/lib/freebl/sha_fast.h

Issue 12207073: Update to NSS 3.14.3 Beta 1 for the TLS CBC constant-time (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/nss/
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* This Source Code Form is subject to the terms of the Mozilla Public 1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this 2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4 4
5 #ifndef _SHA_FAST_H_ 5 #ifndef _SHA_FAST_H_
6 #define _SHA_FAST_H_ 6 #define _SHA_FAST_H_
7 7
8 #include "prlong.h" 8 #include "prlong.h"
9 9
10 #define SHA1_INPUT_LEN 64 10 #define SHA1_INPUT_LEN 64
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 140
141 #elif defined(IS_LITTLE_ENDIAN) || defined( SHA1_USING_64_BIT ) 141 #elif defined(IS_LITTLE_ENDIAN) || defined( SHA1_USING_64_BIT )
142 #define SHA_STORE_RESULT \ 142 #define SHA_STORE_RESULT \
143 if (!((ptrdiff_t)hashout % sizeof(PRUint32))) { \ 143 if (!((ptrdiff_t)hashout % sizeof(PRUint32))) { \
144 SHA_STORE(0); \ 144 SHA_STORE(0); \
145 SHA_STORE(1); \ 145 SHA_STORE(1); \
146 SHA_STORE(2); \ 146 SHA_STORE(2); \
147 SHA_STORE(3); \ 147 SHA_STORE(3); \
148 SHA_STORE(4); \ 148 SHA_STORE(4); \
149 } else { \ 149 } else { \
150 ctx->u.w[0] = SHA_HTONL(ctx->H[0]); \ 150 tmpbuf[0] = SHA_HTONL(ctx->H[0]); \
151 ctx->u.w[1] = SHA_HTONL(ctx->H[1]); \ 151 tmpbuf[1] = SHA_HTONL(ctx->H[1]); \
152 ctx->u.w[2] = SHA_HTONL(ctx->H[2]); \ 152 tmpbuf[2] = SHA_HTONL(ctx->H[2]); \
153 ctx->u.w[3] = SHA_HTONL(ctx->H[3]); \ 153 tmpbuf[3] = SHA_HTONL(ctx->H[3]); \
154 ctx->u.w[4] = SHA_HTONL(ctx->H[4]); \ 154 tmpbuf[4] = SHA_HTONL(ctx->H[4]); \
wtc 2013/02/08 02:17:52 Why is it OK to change SHA_STORE_RESULT to *not* m
agl 2013/02/08 02:26:03 SHA_STORE_RESULT is used in End and EndRaw. Previo
155 memcpy(hashout, ctx->u.w, SHA1_LENGTH); \ 155 memcpy(hashout, tmpbuf, SHA1_LENGTH); \
156 } 156 }
157 157
158 #else 158 #else
159 #define SHA_STORE_RESULT \ 159 #define SHA_STORE_RESULT \
160 if (!((ptrdiff_t)hashout % sizeof(PRUint32))) { \ 160 if (!((ptrdiff_t)hashout % sizeof(PRUint32))) { \
161 SHA_STORE(0); \ 161 SHA_STORE(0); \
162 SHA_STORE(1); \ 162 SHA_STORE(1); \
163 SHA_STORE(2); \ 163 SHA_STORE(2); \
164 SHA_STORE(3); \ 164 SHA_STORE(3); \
165 SHA_STORE(4); \ 165 SHA_STORE(4); \
166 } else { \ 166 } else { \
167 memcpy(hashout, ctx->H, SHA1_LENGTH); \ 167 memcpy(hashout, ctx->H, SHA1_LENGTH); \
168 } 168 }
169 #endif 169 #endif
170 170
171 #endif /* _SHA_FAST_H_ */ 171 #endif /* _SHA_FAST_H_ */
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698