ObjFW  Diff

Differences From Artifact [09c2333d11]:

To Artifact [78b7e000bc]:


141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
{
	uint32_t t;

	if (size == 0)
		return self;

	if (calculated)
		/* FIXME: Maybe a new exception would be better */
		@throw [OFInvalidArgumentException newWithClass: isa];

	/* Update bitcount */
	t = bits[0];
	if ((bits[0] = t + ((uint32_t)size << 3)) < t)
		/* Carry from low to high */
		bits[1]++;
	bits[1] += size >> 29;







<
|







141
142
143
144
145
146
147

148
149
150
151
152
153
154
155
{
	uint32_t t;

	if (size == 0)
		return self;

	if (calculated)

		@throw [OFHashAlreadyCalculatedException newWithClass: isa];

	/* Update bitcount */
	t = bits[0];
	if ((bits[0] = t + ((uint32_t)size << 3)) < t)
		/* Carry from low to high */
		bits[1]++;
	bits[1] += size >> 29;
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
- updateWithBuffer: (const char*)buf
	    ofSize: (size_t)size
{
	if (size == 0)
		return self;

	if (calculated)
		/* FIXME: Maybe a new exception would be better */
		@throw [OFInvalidArgumentException newWithClass: isa];

	sha1_update(state, &count, buffer, buf, size);

	return self;
}

- (uint8_t*)digest







<
|







379
380
381
382
383
384
385

386
387
388
389
390
391
392
393
- updateWithBuffer: (const char*)buf
	    ofSize: (size_t)size
{
	if (size == 0)
		return self;

	if (calculated)

		@throw [OFHashAlreadyCalculatedException newWithClass: isa];

	sha1_update(state, &count, buffer, buf, size);

	return self;
}

- (uint8_t*)digest