ObjFW  Diff

Differences From Artifact [fb812c0e73]:

To Artifact [b4e6d30015]:


155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
	bits[1] += size >> 29;

	/* Bytes already in shsInfo->data */
	t = (t >> 3) & 0x3F;

	/* Handle any leading odd-sized chunks */
	if (t) {
		char *p = in + t;

		t = 64 - t;

		if (size < t) {
			memcpy(p, buffer, size);
			return self;
		}







|







155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
	bits[1] += size >> 29;

	/* Bytes already in shsInfo->data */
	t = (t >> 3) & 0x3F;

	/* Handle any leading odd-sized chunks */
	if (t) {
		uint8_t *p = in + t;

		t = 64 - t;

		if (size < t) {
			memcpy(p, buffer, size);
			return self;
		}
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
	memcpy(in, buffer, size);

	return self;
}

- (char*)digest
{
	char	*p;
	size_t	count;

	if (calculated)
		return (char*)buf;

	/* Compute number of bytes mod 64 */
	count = (bits[0] >> 3) & 0x3F;







|







190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
	memcpy(in, buffer, size);

	return self;
}

- (char*)digest
{
	uint8_t	*p;
	size_t	count;

	if (calculated)
		return (char*)buf;

	/* Compute number of bytes mod 64 */
	count = (bits[0] >> 3) & 0x3F;
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
	OF_BSWAP_V(in, 14);

	/* Append length in bits and transform */
	((uint32_t*)in)[14] = bits[0];
	((uint32_t*)in)[15] = bits[1];

	md5_transform(buf, (uint32_t*)in);
	OF_BSWAP_V((char*)buf, 4);

	calculated = YES;

	return (char*)buf;
}
@end








|







229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
	OF_BSWAP_V(in, 14);

	/* Append length in bits and transform */
	((uint32_t*)in)[14] = bits[0];
	((uint32_t*)in)[15] = bits[1];

	md5_transform(buf, (uint32_t*)in);
	OF_BSWAP_V((uint8_t*)buf, 4);

	calculated = YES;

	return (char*)buf;
}
@end