ObjFW  Diff

Differences From Artifact [cb91073b60]:

To Artifact [41ace0d09a]:


177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
			@throw [OFOutOfMemoryException
			    exceptionWithRequestedSize: parallelization * 128 *
							blockSize];

		HMAC = [[OFHMAC alloc] initWithHashClass: [OFSHA256Hash class]];

		of_pbkdf2(HMAC, 1, salt, saltLength, password, passwordLength,
		    (unsigned char*)buffer, parallelization * 128 * blockSize);

		for (size_t i = 0; i < parallelization; i++)
			of_scrypt_romix(buffer + i * 32 * blockSize, blockSize,
			    costFactor, tmp);

		of_pbkdf2(HMAC, 1, (unsigned char*)buffer, parallelization *
		    128 * blockSize, password, passwordLength, key, keyLength);
	} @finally {
		of_explicit_memset(tmp, 0, (costFactor + 1) * blockSize * 128);
		free(tmp);

		of_explicit_memset(buffer, 0,
		    parallelization * 128 * blockSize);







|





|







177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
			@throw [OFOutOfMemoryException
			    exceptionWithRequestedSize: parallelization * 128 *
							blockSize];

		HMAC = [[OFHMAC alloc] initWithHashClass: [OFSHA256Hash class]];

		of_pbkdf2(HMAC, 1, salt, saltLength, password, passwordLength,
		    (unsigned char *)buffer, parallelization * 128 * blockSize);

		for (size_t i = 0; i < parallelization; i++)
			of_scrypt_romix(buffer + i * 32 * blockSize, blockSize,
			    costFactor, tmp);

		of_pbkdf2(HMAC, 1, (unsigned char *)buffer, parallelization *
		    128 * blockSize, password, passwordLength, key, keyLength);
	} @finally {
		of_explicit_memset(tmp, 0, (costFactor + 1) * blockSize * 128);
		free(tmp);

		of_explicit_memset(buffer, 0,
		    parallelization * 128 * blockSize);