19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
#import "OFMD5Hash.h"
#import "OFSecureData.h"
#import "OFHashAlreadyCalculatedException.h"
#import "OFOutOfRangeException.h"
#define DIGEST_SIZE 16
#define BLOCK_SIZE 64
OF_DIRECT_MEMBERS
@interface OFMD5Hash ()
- (void)of_resetState;
@end
#define F(a, b, c) (((a) & (b)) | (~(a) & (c)))
|
|
|
|
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
#import "OFMD5Hash.h"
#import "OFSecureData.h"
#import "OFHashAlreadyCalculatedException.h"
#import "OFOutOfRangeException.h"
static const size_t digestSize = 16;
static const size_t blockSize = 64;
OF_DIRECT_MEMBERS
@interface OFMD5Hash ()
- (void)of_resetState;
@end
#define F(a, b, c) (((a) & (b)) | (~(a) & (c)))
|
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
|
@implementation OFMD5Hash
@synthesize calculated = _calculated;
@synthesize allowsSwappableMemory = _allowsSwappableMemory;
+ (size_t)digestSize
{
return DIGEST_SIZE;
}
+ (size_t)blockSize
{
return BLOCK_SIZE;
}
+ (instancetype)hashWithAllowsSwappableMemory: (bool)allowsSwappableMemory
{
return [[[self alloc] initWithAllowsSwappableMemory:
allowsSwappableMemory] autorelease];
}
|
|
|
|
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
|
@implementation OFMD5Hash
@synthesize calculated = _calculated;
@synthesize allowsSwappableMemory = _allowsSwappableMemory;
+ (size_t)digestSize
{
return digestSize;
}
+ (size_t)blockSize
{
return blockSize;
}
+ (instancetype)hashWithAllowsSwappableMemory: (bool)allowsSwappableMemory
{
return [[[self alloc] initWithAllowsSwappableMemory:
allowsSwappableMemory] autorelease];
}
|
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
|
[_iVarsData release];
[super dealloc];
}
- (size_t)digestSize
{
return DIGEST_SIZE;
}
- (size_t)blockSize
{
return BLOCK_SIZE;
}
- (id)copy
{
OFMD5Hash *copy = [[OFMD5Hash alloc] of_init];
copy->_iVarsData = [_iVarsData copy];
|
|
|
|
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
|
[_iVarsData release];
[super dealloc];
}
- (size_t)digestSize
{
return digestSize;
}
- (size_t)blockSize
{
return blockSize;
}
- (id)copy
{
OFMD5Hash *copy = [[OFMD5Hash alloc] of_init];
copy->_iVarsData = [_iVarsData copy];
|