| OLD | NEW |
| 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 24 matching lines...) Expand all Loading... |
| 35 * the provisions above, a recipient may use your version of this file under | 35 * the provisions above, a recipient may use your version of this file under |
| 36 * the terms of any one of the MPL, the GPL or the LGPL. | 36 * the terms of any one of the MPL, the GPL or the LGPL. |
| 37 * | 37 * |
| 38 * ***** END LICENSE BLOCK ***** */ | 38 * ***** END LICENSE BLOCK ***** */ |
| 39 /* $Id: sha512.c,v 1.9 2006/10/13 16:54:04 wtchang%redhat.com Exp $ */ | 39 /* $Id: sha512.c,v 1.9 2006/10/13 16:54:04 wtchang%redhat.com Exp $ */ |
| 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 "crypto/third_party/nss/chromium-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 "crypto/third_party/nss/chromium-blapi.h" | 50 #include "crypto/third_party/nss/chromium-blapi.h" |
| 51 #include "crypto/third_party/nss/chromium-sha256.h" /* for struct SHA256Conte
xtStr */ | 51 #include "crypto/third_party/nss/chromium-sha256.h" /* for struct SHA256Conte
xtStr */ |
| 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))) |
| (...skipping 1326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 |
| OLD | NEW |