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

Side by Side Diff: openssl/ssl/fnv1a64.c

Issue 9254031: Upgrade chrome's OpenSSL to same version Android ships with. (Closed) Base URL: http://src.chromium.org/svn/trunk/deps/third_party/openssl/
Patch Set: '' Created 8 years, 11 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 | « openssl/ssl/fnv1a64.h ('k') | openssl/ssl/install.com » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /* ssl/fnv1a64.c */
2
3 /* Open sourcing FIXME: include correct copyright header here. */
4
5 /* Fowler-Noll-Vo (FNV) hash: http://isthe.com/chongo/tech/comp/fnv/ */
6
7 #include "fnv1a64.h"
8
9 /* http://www.isthe.com/chongo/tech/comp/fnv/index.html#FNV-param */
10 static const FNV1A64 FNV1A64_OFFSET_BASIS = 14695981039346656037ull;
11 static const FNV1A64 FNV1A64_PRIME = 1099511628211ull;
12
13 void fnv1a64_init(FNV1A64* ctx)
14 {
15 *ctx = FNV1A64_OFFSET_BASIS;
16 }
17
18 void fnv1a64_update(FNV1A64* ctx, const void* voiddata, unsigned int length)
19 {
20 const unsigned char *data = voiddata;
21 unsigned int i;
22
23 for (i = 0; i < length; i++)
24 {
25 *ctx ^= data[i];
26 *ctx *= FNV1A64_PRIME;
27 }
28 }
29
30 void fnv1a64_final(unsigned char out[8], const FNV1A64 *ctx)
31 {
32 const FNV1A64 native_endian_result = *ctx;
33 unsigned int i;
34
35 for (i = 0; i < 8; i++)
36 out[i] = (unsigned char) (native_endian_result >> (8 * (sizeof(F NV1A64) - i - 1)));
37 }
OLDNEW
« no previous file with comments | « openssl/ssl/fnv1a64.h ('k') | openssl/ssl/install.com » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698