OLD | NEW |
1 /* | 1 /* |
2 * SHA-1 in C | 2 * SHA-1 in C |
3 * By Steve Reid <sreid@sea-to-sky.net> | 3 * By Steve Reid <sreid@sea-to-sky.net> |
4 * 100% Public Domain | 4 * 100% Public Domain |
5 * | 5 * |
6 * ----------------- | 6 * ----------------- |
7 * Modified 7/98 | 7 * Modified 7/98 |
8 * By James H. Brown <jbrown@burgoyne.com> | 8 * By James H. Brown <jbrown@burgoyne.com> |
9 * Still 100% Public Domain | 9 * Still 100% Public Domain |
10 * | 10 * |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 * ----------------- | 100 * ----------------- |
101 * Modified 10/2015 | 101 * Modified 10/2015 |
102 * By Peter Boström <pbos@webrtc.org> | 102 * By Peter Boström <pbos@webrtc.org> |
103 * Change uint32(8) back to uint32(8)_t (undoes (03/2012) change). | 103 * Change uint32(8) back to uint32(8)_t (undoes (03/2012) change). |
104 */ | 104 */ |
105 | 105 |
106 // Enabling SHA1HANDSOFF preserves the caller's data buffer. | 106 // Enabling SHA1HANDSOFF preserves the caller's data buffer. |
107 // Disabling SHA1HANDSOFF the buffer will be modified (end swapped). | 107 // Disabling SHA1HANDSOFF the buffer will be modified (end swapped). |
108 #define SHA1HANDSOFF | 108 #define SHA1HANDSOFF |
109 | 109 |
110 #include "webrtc/rtc_base/sha1.h" | 110 #include "webrtc/base/sha1.h" |
111 | 111 |
112 #include <stdio.h> | 112 #include <stdio.h> |
113 #include <string.h> | 113 #include <string.h> |
114 | 114 |
115 namespace rtc { | 115 namespace rtc { |
116 | 116 |
117 namespace { | 117 namespace { |
118 | 118 |
119 #define rol(value, bits) (((value) << (bits)) | ((value) >> (32 - (bits)))) | 119 #define rol(value, bits) (((value) << (bits)) | ((value) >> (32 - (bits)))) |
120 | 120 |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 memset(context->state, 0, 20); | 289 memset(context->state, 0, 20); |
290 memset(context->count, 0, 8); | 290 memset(context->count, 0, 8); |
291 memset(finalcount, 0, 8); // SWR | 291 memset(finalcount, 0, 8); // SWR |
292 | 292 |
293 #ifdef SHA1HANDSOFF // Make SHA1Transform overwrite its own static vars. | 293 #ifdef SHA1HANDSOFF // Make SHA1Transform overwrite its own static vars. |
294 SHA1Transform(context->state, context->buffer); | 294 SHA1Transform(context->state, context->buffer); |
295 #endif | 295 #endif |
296 } | 296 } |
297 | 297 |
298 } // namespace rtc | 298 } // namespace rtc |
OLD | NEW |