@@ -21,12 +21,12 @@ #import "OFSecureData.h" #import "OFHashAlreadyCalculatedException.h" #import "OFOutOfRangeException.h" -#define DIGEST_SIZE 20 -#define BLOCK_SIZE 64 +static const size_t digestSize = 20; +static const size_t blockSize = 64; OF_DIRECT_MEMBERS @interface OFSHA1Hash () - (void)of_resetState; @end @@ -99,16 +99,16 @@ @synthesize calculated = _calculated; @synthesize allowsSwappableMemory = _allowsSwappableMemory; + (size_t)digestSize { - return DIGEST_SIZE; + return digestSize; } + (size_t)blockSize { - return BLOCK_SIZE; + return blockSize; } + (instancetype)hashWithAllowsSwappableMemory: (bool)allowsSwappableMemory { return [[[self alloc] initWithAllowsSwappableMemory: @@ -152,16 +152,16 @@ [super dealloc]; } - (size_t)digestSize { - return DIGEST_SIZE; + return digestSize; } - (size_t)blockSize { - return BLOCK_SIZE; + return blockSize; } - (id)copy { OFSHA1Hash *copy = [[OFSHA1Hash alloc] of_init];