Add new generation algorithm

The scrypt-genpass compatible one is now the legacy algorithm
(activated with -L or --legacy).
This commit is contained in:
Jonathan Schleifer 2016-10-08 14:08:36 +02:00
parent cfb910164f
commit 914314b927
No known key found for this signature in database
GPG key ID: 338C3541DB54E169
7 changed files with 178 additions and 33 deletions

View file

@ -23,8 +23,7 @@
#import "LegacyPasswordGenerator.h"
@implementation LegacyPasswordGenerator
@synthesize length = _length, site = _site, passphrase = _passphrase;
@synthesize output = _output;
@synthesize site = _site, passphrase = _passphrase, output = _output;
+ (instancetype)generator
{
@ -40,6 +39,19 @@
return self;
}
- (void)setLength: (size_t)length
{
if (length < 3)
@throw [OFInvalidArgumentException exception];
_length = length;
}
- (size_t)length
{
return _length;
}
- (void)derivePassword
{
OFSHA256Hash *siteHash = [OFSHA256Hash cryptoHash];