21#import "OFCryptographicHash.h"
23OF_ASSUME_NONNULL_BEGIN
30OF_SUBCLASSING_RESTRICTED
33 Class <OFCryptographicHash> _hashClass;
34 bool _allowsSwappableMemory;
35 id <OFCryptographicHash> _Nullable _outerHash, _innerHash;
36 id <OFCryptographicHash> _Nullable _outerHashCopy, _innerHashCopy;
43@property (readonly, nonatomic) Class <OFCryptographicHash>
hashClass;
58@property (readonly, nonatomic)
const unsigned char *
digest
59 OF_RETURNS_INNER_POINTER;
64@property (readonly, nonatomic)
size_t digestSize;
73+ (instancetype)HMACWithHashClass: (Class <OFCryptographicHash>)hashClass
74 allowsSwappableMemory: (
bool)allowsSwappableMemory;
76- (instancetype)
init OF_UNAVAILABLE;
86- (instancetype)initWithHashClass: (Class <OFCryptographicHash>)hashClass
87 allowsSwappableMemory: (
bool)allowsSwappableMemory
88 OF_DESIGNATED_INITIALIZER;
102- (void)setKey: (const
void *)key length: (
size_t)length;
111- (void)updateWithBuffer: (const
void *)buffer length: (
size_t)length;
A class which provides methods to calculate an HMAC.
Definition OFHMAC.h:32
Class< OFCryptographicHash > hashClass
The class for the cryptographic hash used by the HMAC.
Definition OFHMAC.h:43
void zero()
This is like reset, but also zeroes the hashed key and all state.
Definition OFHMAC.m:190
const unsigned char * digest
A buffer containing the HMAC.
Definition OFHMAC.m:165
void calculate()
Performs the final calculation of the HMAC.
Definition OFHMAC.m:149
bool allowsSwappableMemory
Whether data may be stored in swappable memory.
Definition OFHMAC.h:48
void reset()
Resets the HMAC so that it can be calculated for a new message.
Definition OFHMAC.m:178
size_t digestSize
The size of the digest.
Definition OFHMAC.m:173
The root class for all other classes inside ObjFW.
Definition OFObject.h:692
instancetype init()
Initializes an already allocated object.
Definition OFObject.m:696