ObjFW  Diff

Differences From Artifact [2e98081b44]:

To Artifact [1827be5212]:


42
43
44
45
46
47
48
49

50
51
52
53
54
55
56
42
43
44
45
46
47
48

49
50
51
52
53
54
55
56







-
+







	[_innerHash release];
	[_outerHashCopy release];
	[_innerHashCopy release];

	[super dealloc];
}

- (void)setKey: (const void*)key
- (void)setKey: (const void *)key
	length: (size_t)length
{
	void *pool = objc_autoreleasePoolPush();
	size_t blockSize = [_hashClass blockSize];
	uint8_t outerKeyPad[blockSize], innerKeyPad[blockSize];

	[_outerHash release];
96
97
98
99
100
101
102
103

104
105
106
107
108
109
110
111
112
113
114
115
116
117

118
119
120
121
122
123
124
96
97
98
99
100
101
102

103
104
105
106
107
108
109
110
111
112
113
114
115
116

117
118
119
120
121
122
123
124







-
+













-
+








	_outerHashCopy = [_outerHash copy];
	_innerHashCopy = [_innerHash copy];

	_calculated = false;
}

- (void)updateWithBuffer: (const void*)buffer
- (void)updateWithBuffer: (const void *)buffer
		  length: (size_t)length
{
	if (_innerHash == nil)
		@throw [OFInvalidArgumentException exception];

	if (_calculated)
		@throw [OFHashAlreadyCalculatedException
		    exceptionWithObject: self];

	[_innerHash updateWithBuffer: buffer
			      length: length];
}

- (const unsigned char*)digest
- (const unsigned char *)digest
{
	if (_outerHash == nil || _innerHash == nil)
		@throw [OFInvalidArgumentException exception];

	if (_calculated)
		return [_outerHash digest];