ObjFW  Diff

Differences From Artifact [15c7c9a7a5]:

To Artifact [0aa83b56cc]:


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 "OFSHA1Hash.h"
#import "OFSecureData.h"

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

#define DIGEST_SIZE 20
#define BLOCK_SIZE 64

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

#define F(a, b, c, d) ((d) ^ ((b) & ((c) ^ (d))))
#define G(a, b, c, d) ((b) ^ (c) ^ (d))
94
95
96
97
98
99
100
101

102
103
104
105
106

107
108
109
110
111
112
113
97
98
99
100
101
102
103

104
105
106
107
108

109
110
111
112
113
114
115
116







-
+




-
+







}

@implementation OFSHA1Hash
@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];
}

136
137
138
139
140
141
142










143
144
145
146
147
148
149
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162







+
+
+
+
+
+
+
+
+
+








- (void)dealloc
{
	[_iVarsData release];

	[super dealloc];
}

- (size_t)digestSize
{
	return DIGEST_SIZE;
}

- (size_t)blockSize
{
	return BLOCK_SIZE;
}

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

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