ObjFW  Diff

Differences From Artifact [3842b26a7e]:

To Artifact [03939c1eca]:


20
21
22
23
24
25
26



27
28
29
30
31
32
33
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36







+
+
+







#include <string.h>

#import "OFRIPEMD160Hash.h"
#import "OFSecureData.h"

#import "OFHashAlreadyCalculatedException.h"
#import "OFOutOfRangeException.h"

#define DIGEST_SIZE 20
#define BLOCK_SIZE 64

@interface OFRIPEMD160Hash ()
- (void)of_resetState;
@end

#define F(a, b, c) ((a) ^ (b) ^ (c))
#define G(a, b, c) (((a) & (b)) | (~(a) & (c)))
134
135
136
137
138
139
140
141

142
143
144
145
146

147
148
149
150
151
152
153
137
138
139
140
141
142
143

144
145
146
147
148

149
150
151
152
153
154
155
156







-
+




-
+







}

@implementation OFRIPEMD160Hash
@synthesize calculated = _calculated;

+ (size_t)digestSize
{
	return 20;
	return DIGEST_SIZE;
}

+ (size_t)blockSize
{
	return 64;
	return BLOCK_SIZE;
}

+ (instancetype)cryptoHash
{
	return [[[self alloc] init] autorelease];
}

176
177
178
179
180
181
182










183
184
185
186
187
188
189
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202







+
+
+
+
+
+
+
+
+
+








- (void)dealloc
{
	[_iVarsData release];

	[super dealloc];
}

- (size_t)digestSize
{
	return DIGEST_SIZE;
}

- (size_t)blockSize
{
	return BLOCK_SIZE;
}

- (id)copy
{
	OFRIPEMD160Hash *copy = [[OFRIPEMD160Hash alloc] of_init];

	copy->_iVarsData = [_iVarsData copy];
	copy->_iVars = copy->_iVarsData.mutableItems;