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

Side by Side Diff: crypto/third_party/nss/sha512.cc

Issue 6805019: Move crypto files out of base, to a top level directory. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 8 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 /* 1 /*
2 * sha512.c - implementation of SHA256, SHA384 and SHA512 2 * sha512.c - implementation of SHA256, SHA384 and SHA512
3 * 3 *
4 * ***** BEGIN LICENSE BLOCK ***** 4 * ***** BEGIN LICENSE BLOCK *****
5 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 5 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
6 * 6 *
7 * The contents of this file are subject to the Mozilla Public License Version 7 * The contents of this file are subject to the Mozilla Public License Version
8 * 1.1 (the "License"); you may not use this file except in compliance with 8 * 1.1 (the "License"); you may not use this file except in compliance with
9 * the License. You may obtain a copy of the License at 9 * the License. You may obtain a copy of the License at
10 * http://www.mozilla.org/MPL/ 10 * http://www.mozilla.org/MPL/
(...skipping 29 matching lines...) Expand all
40 40
41 // Prevent manual unrolling in the sha256 code, which reduces the binary code 41 // Prevent manual unrolling in the sha256 code, which reduces the binary code
42 // size from ~10k to ~1k. The performance should be reasonable for our use. 42 // size from ~10k to ~1k. The performance should be reasonable for our use.
43 #define NOUNROLL256 1 43 #define NOUNROLL256 1
44 44
45 #include "base/third_party/nspr/prtypes.h" /* for PRUintXX */ 45 #include "base/third_party/nspr/prtypes.h" /* for PRUintXX */
46 #if defined(_X86_) || defined(SHA_NO_LONG_LONG) 46 #if defined(_X86_) || defined(SHA_NO_LONG_LONG)
47 #define NOUNROLL512 1 47 #define NOUNROLL512 1
48 #undef HAVE_LONG_LONG 48 #undef HAVE_LONG_LONG
49 #endif 49 #endif
50 #include "base/third_party/nss/blapi.h" 50 #include "crypto/third_party/nss/blapi.h"
51 #include "base/third_party/nss/sha256.h" /* for struct SHA256ContextStr */ 51 #include "crypto/third_party/nss/sha256.h" /* for struct SHA256ContextStr */
52 52
53 #include <stdlib.h> 53 #include <stdlib.h>
54 #include <string.h> 54 #include <string.h>
55 #define PORT_New(type) static_cast<type*>(malloc(sizeof(type))) 55 #define PORT_New(type) static_cast<type*>(malloc(sizeof(type)))
56 #define PORT_ZFree(ptr, len) do { memset(ptr, 0, len); free(ptr); } while (0) 56 #define PORT_ZFree(ptr, len) do { memset(ptr, 0, len); free(ptr); } while (0)
57 #define PORT_Strlen(s) static_cast<unsigned int>(strlen(s)) 57 #define PORT_Strlen(s) static_cast<unsigned int>(strlen(s))
58 #define PORT_Memcpy memcpy 58 #define PORT_Memcpy memcpy
59 59
60 /* ============= Common constants and defines ======================= */ 60 /* ============= Common constants and defines ======================= */
61 61
(...skipping 1320 matching lines...) Expand 10 before | Expand all | Expand 10 after
1382 } else { 1382 } else {
1383 while (i-- > 0) { 1383 while (i-- > 0) {
1384 time512(); 1384 time512();
1385 } 1385 }
1386 printf("done\n"); 1386 printf("done\n");
1387 } 1387 }
1388 return 0; 1388 return 0;
1389 } 1389 }
1390 1390
1391 #endif 1391 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698