| OLD | NEW |
| 1 /* arcfour.c - the arc four algorithm. | 1 /* arcfour.c - the arc four algorithm. |
| 2 * | 2 * |
| 3 * This Source Code Form is subject to the terms of the Mozilla Public | 3 * This Source Code Form is subject to the terms of the Mozilla Public |
| 4 * License, v. 2.0. If a copy of the MPL was not distributed with this | 4 * License, v. 2.0. If a copy of the MPL was not distributed with this |
| 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
| 6 | 6 |
| 7 #ifdef FREEBL_NO_DEPEND | 7 #ifdef FREEBL_NO_DEPEND |
| 8 #include "stubs.h" | 8 #include "stubs.h" |
| 9 #endif | 9 #endif |
| 10 | 10 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 #endif | 23 #endif |
| 24 | 24 |
| 25 #if defined(AIX) || defined(OSF1) || defined(NSS_BEVAND_ARCFOUR) | 25 #if defined(AIX) || defined(OSF1) || defined(NSS_BEVAND_ARCFOUR) |
| 26 /* Treat array variables as words, not bytes, on CPUs that take | 26 /* Treat array variables as words, not bytes, on CPUs that take |
| 27 * much longer to write bytes than to write words, or when using | 27 * much longer to write bytes than to write words, or when using |
| 28 * assembler code that required it. | 28 * assembler code that required it. |
| 29 */ | 29 */ |
| 30 #define USE_WORD | 30 #define USE_WORD |
| 31 #endif | 31 #endif |
| 32 | 32 |
| 33 #if (defined(IS_64)) | 33 #if defined(IS_64) || defined(NSS_BEVAND_ARCFOUR) |
| 34 typedef PRUint64 WORD; | 34 typedef PRUint64 WORD; |
| 35 #else | 35 #else |
| 36 typedef PRUint32 WORD; | 36 typedef PRUint32 WORD; |
| 37 #endif | 37 #endif |
| 38 #define WORDSIZE sizeof(WORD) | 38 #define WORDSIZE sizeof(WORD) |
| 39 | 39 |
| 40 #if defined(USE_WORD) | 40 #if defined(USE_WORD) |
| 41 typedef WORD Stype; | 41 typedef WORD Stype; |
| 42 #else | 42 #else |
| 43 typedef PRUint8 Stype; | 43 typedef PRUint8 Stype; |
| (...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 564 /* Convert the byte-stream to a word-stream */ | 564 /* Convert the byte-stream to a word-stream */ |
| 565 return rc4_wordconv(cx, output, outputLen, maxOutputLen, input, inputLen
); | 565 return rc4_wordconv(cx, output, outputLen, maxOutputLen, input, inputLen
); |
| 566 #else | 566 #else |
| 567 /* Operate on bytes, but unroll the main loop */ | 567 /* Operate on bytes, but unroll the main loop */ |
| 568 return rc4_unrolled(cx, output, outputLen, maxOutputLen, input, inputLen
); | 568 return rc4_unrolled(cx, output, outputLen, maxOutputLen, input, inputLen
); |
| 569 #endif | 569 #endif |
| 570 } | 570 } |
| 571 | 571 |
| 572 #undef CONVERT_TO_WORDS | 572 #undef CONVERT_TO_WORDS |
| 573 #undef USE_WORD | 573 #undef USE_WORD |
| OLD | NEW |