ObjFW  Diff

Differences From Artifact [c7952ff29f]:

  • File src/OFMD5Hash.m — part of check-in [951f530aee] at 2016-07-24 00:06:30 on branch trunk — Rename OFHash to OFCryptoHash

    OFHash is too generic, as this protocol is for cryptographic hashes. It
    also solves the ambiguity of the +[hash] method (which is now
    +[cryptoHash]), which conflicted with -[hash] on the class itself,
    resulting in classes conforming to OFHash not being able to be used as a
    key in an OFDictionary. (user: js, size: 4749) [annotate] [blame] [check-ins using]

To Artifact [8b5373705c]:


173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
		if (_bufferLength == 64) {
			processBlock(_state, _buffer.words);
			_bufferLength = 0;
		}
	}
}

- (const uint8_t*)digest
{
	if (_calculated)
		return (const uint8_t*)_state;

	_buffer.bytes[_bufferLength] = 0x80;
	memset(_buffer.bytes + _bufferLength + 1, 0, 64 - _bufferLength - 1);








|







173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
		if (_bufferLength == 64) {
			processBlock(_state, _buffer.words);
			_bufferLength = 0;
		}
	}
}

- (const unsigned char*)digest
{
	if (_calculated)
		return (const uint8_t*)_state;

	_buffer.bytes[_bufferLength] = 0x80;
	memset(_buffer.bytes + _bufferLength + 1, 0, 64 - _bufferLength - 1);