@@ -29,11 +29,11 @@ + (instancetype)generator { return [[[self alloc] init] autorelease]; } -- init +- (instancetype)init { self = [super init]; _length = 16; @@ -44,12 +44,12 @@ { OFSHA384Hash *siteHash = [OFSHA384Hash cryptoHash]; size_t passphraseLength, combinedPassphraseLength; char *combinedPassphrase; - [siteHash updateWithBuffer: [_site UTF8String] - length: [_site UTF8StringLength]]; + [siteHash updateWithBuffer: _site.UTF8String + length: _site.UTF8StringLength]; if (_output != NULL) { of_explicit_memset(_output, 0, _length); [self freeMemory: _output]; } @@ -56,14 +56,14 @@ _output = [self allocMemoryWithSize: _length + 1]; passphraseLength = combinedPassphraseLength = strlen(_passphrase); if (_keyfile != nil) { - if (SIZE_MAX - combinedPassphraseLength < [_keyfile count]) + if (SIZE_MAX - combinedPassphraseLength < _keyfile.count) @throw [OFOutOfRangeException exception]; - combinedPassphraseLength += [_keyfile count]; + combinedPassphraseLength += _keyfile.count; } if ((combinedPassphrase = malloc(combinedPassphraseLength)) == NULL) @throw [OFOutOfMemoryException exceptionWithRequestedSize: combinedPassphraseLength]; @@ -70,14 +70,14 @@ @try { memcpy(combinedPassphrase, _passphrase, passphraseLength); if (_keyfile != nil) memcpy(combinedPassphrase + passphraseLength, - [_keyfile items], [_keyfile count]); + _keyfile.items, _keyfile.count); - of_scrypt(8, 524288, 2, [siteHash digest], - [[siteHash class] digestSize], combinedPassphrase, + of_scrypt(8, 524288, 2, siteHash.digest, + [siteHash.class digestSize], combinedPassphrase, combinedPassphraseLength, _output, _length); } @finally { of_explicit_memset(combinedPassphrase, 0, combinedPassphraseLength); free(combinedPassphrase);