Differences From Artifact [d5b60b898c]:
- File
src/OFSHA384Or512Hash.m
— part of check-in
[4af49a13c3]
at
2017-05-07 20:10:13
on branch trunk
— Small code style change
Casts are now written like types in variable declarations. (user: js, size: 6039) [annotate] [blame] [check-ins using]
To Artifact [6ff07dab9e]:
- File
src/OFSHA384Or512Hash.m
— part of check-in
[6b77a5dd8b]
at
2017-05-21 21:28:57
on branch trunk
— Prefix private methods with of_ instead of OF_
This matches Apple's style. (user: js, size: 6100) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
18 19 20 21 22 23 24 25 26 27 28 29 30 31 | #include <stdlib.h> #include <string.h> #import "OFSHA384Or512Hash.h" #import "OFHashAlreadyCalculatedException.h" static const uint64_t table[] = { 0x428A2F98D728AE22, 0x7137449123EF65CD, 0xB5C0FBCFEC4D3B2F, 0xE9B5DBA58189DBBC, 0x3956C25BF348B538, 0x59F111F1B605D019, 0x923F82A4AF194F9B, 0xAB1C5ED5DA6D8118, 0xD807AA98A3030242, 0x12835B0145706FBE, 0x243185BE4EE4B28C, 0x550C7DC3D5FFB4E2, 0x72BE5D74F27B896F, 0x80DEB1FE3B1696B1, 0x9BDC06A725C71235, | > > > > | 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | #include <stdlib.h> #include <string.h> #import "OFSHA384Or512Hash.h" #import "OFHashAlreadyCalculatedException.h" @interface OFSHA384Or512Hash () - (void)of_resetState; @end static const uint64_t table[] = { 0x428A2F98D728AE22, 0x7137449123EF65CD, 0xB5C0FBCFEC4D3B2F, 0xE9B5DBA58189DBBC, 0x3956C25BF348B538, 0x59F111F1B605D019, 0x923F82A4AF194F9B, 0xAB1C5ED5DA6D8118, 0xD807AA98A3030242, 0x12835B0145706FBE, 0x243185BE4EE4B28C, 0x550C7DC3D5FFB4E2, 0x72BE5D74F27B896F, 0x80DEB1FE3B1696B1, 0x9BDC06A725C71235, |
︙ | ︙ | |||
143 144 145 146 147 148 149 | @try { if ([self class] == [OFSHA384Or512Hash class]) { [self doesNotRecognizeSelector: _cmd]; abort(); } | | | 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 | @try { if ([self class] == [OFSHA384Or512Hash class]) { [self doesNotRecognizeSelector: _cmd]; abort(); } [self of_resetState]; } @catch (id e) { [self release]; @throw e; } return self; } |
︙ | ︙ | |||
230 231 232 233 234 235 236 | _calculated = true; return (const uint8_t *)_state; } - (void)reset { | | | | 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 | _calculated = true; return (const uint8_t *)_state; } - (void)reset { [self of_resetState]; memset(_bits, 0, sizeof(_bits)); memset(&_buffer, 0, sizeof(_buffer)); _bufferLength = 0; _calculated = false; } - (void)of_resetState { OF_UNRECOGNIZED_SELECTOR } @end |