@@ -22,10 +22,13 @@ #import "OFSHA1Hash.h" #import "OFSecureData.h" #import "OFHashAlreadyCalculatedException.h" #import "OFOutOfRangeException.h" + +#define DIGEST_SIZE 20 +#define BLOCK_SIZE 64 @interface OFSHA1Hash () - (void)of_resetState; @end @@ -96,16 +99,16 @@ @implementation OFSHA1Hash @synthesize calculated = _calculated; + (size_t)digestSize { - return 20; + return DIGEST_SIZE; } + (size_t)blockSize { - return 64; + return BLOCK_SIZE; } + (instancetype)cryptoHash { return [[[self alloc] init] autorelease]; @@ -138,10 +141,20 @@ { [_iVarsData release]; [super dealloc]; } + +- (size_t)digestSize +{ + return DIGEST_SIZE; +} + +- (size_t)blockSize +{ + return BLOCK_SIZE; +} - (id)copy { OFSHA1Hash *copy = [[OFSHA1Hash alloc] of_init];