ObjFW  Diff

Differences From Artifact [5a22333932]:

To 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]


121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
}

+ (size_t)blockSize
{
	return 64;
}

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

- init
{
	self = [super init];







|







121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
}

+ (size_t)blockSize
{
	return 64;
}

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

- init
{
	self = [super init];
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
- (void)updateWithBuffer: (const void*)buffer_
		  length: (size_t)length
{
	const uint8_t *buffer = buffer_;

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

	_bits += (length * 8);

	while (length > 0) {
		size_t min = 64 - _bufferLength;

		if (min > length)







|







150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
- (void)updateWithBuffer: (const void*)buffer_
		  length: (size_t)length
{
	const uint8_t *buffer = buffer_;

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

	_bits += (length * 8);

	while (length > 0) {
		size_t min = 64 - _bufferLength;

		if (min > length)