ObjFW
|
A protocol for classes providing cryptographic hash functions. More...
#include <ObjFW/ObjFW.h>
Instance Methods | |
(instancetype) | - initWithAllowsSwappableMemory: |
Initializes an already allocated cryptographic hash. | |
(void) | - updateWithBuffer:length: |
Adds a buffer to the cryptographic hash to be calculated. | |
(void) | - calculate |
Performs the final calculation of the cryptographic hash. | |
(void) | - reset |
Resets all state so that a new hash can be calculated. | |
Instance Methods inherited from <OFObject> | |
(Class) | - class |
Returns the class of the object. | |
(nullable Class) | - superclass |
Returns the superclass of the object. | |
(unsigned long) | - hash |
Returns a hash for the object. | |
(unsigned int) | - retainCount |
Returns the retain count. | |
(bool) | - isProxy |
Returns whether the object is a proxy object. | |
(bool) | - isKindOfClass: |
Returns a boolean whether the object is of the specified kind. | |
(bool) | - isMemberOfClass: |
Returns a boolean whether the object is a member of the specified class. | |
(bool) | - respondsToSelector: |
Returns a boolean whether the object responds to the specified selector. | |
(bool) | - conformsToProtocol: |
Checks whether the object conforms to the specified protocol. | |
(nullable IMP) | - methodForSelector: |
Returns the implementation for the specified selector. | |
(nullable id) | - performSelector: |
Performs the specified selector. | |
(nullable id) | - performSelector:withObject: |
Performs the specified selector with the specified object. | |
(nullable id) | - performSelector:withObject:withObject: |
Performs the specified selector with the specified objects. | |
(nullable id) | - performSelector:withObject:withObject:withObject: |
Performs the specified selector with the specified objects. | |
(nullable id) | - performSelector:withObject:withObject:withObject:withObject: |
Performs the specified selector with the specified objects. | |
(bool) | - isEqual: |
Checks two objects for equality. | |
(instancetype) | - retain |
Increases the retain count. | |
(void) | - release |
Decreases the retain count. | |
(instancetype) | - autorelease |
Adds the object to the topmost autorelease pool of the thread's autorelease pool stack. | |
(instancetype) | - self |
Returns the receiver. | |
(bool) | - allowsWeakReference |
Returns whether the object allows a weak reference. | |
(bool) | - retainWeakReference |
Retain a weak reference to this object. | |
Instance Methods inherited from <OFCopying> | |
(id) | - copy |
Copies the object. | |
Class Methods | |
(instancetype) | + hashWithAllowsSwappableMemory: |
Creates a new cryptographic hash. | |
(size_t) | + digestSize |
Returns the digest size of the cryptographic hash, in bytes. | |
(size_t) | + blockSize |
Returns the block size of the cryptographic hash, in bytes. | |
Properties | |
size_t | digestSize |
The digest size of the cryptographic hash, in bytes. | |
size_t | blockSize |
The block size of the cryptographic hash, in bytes. | |
bool | allowsSwappableMemory |
Whether data may be stored in swappable memory. | |
bool | calculated |
A boolean whether the hash has already been calculated. | |
const unsigned char * | digest |
A buffer containing the cryptographic hash. | |
A protocol for classes providing cryptographic hash functions.
A cryptographic hash implementing this protocol can be copied. The entire state is copied, allowing to calculate a new hash from there. This is especially useful for generating many hashes with a common prefix.
+ (size_t) blockSize |
Returns the block size of the cryptographic hash, in bytes.
- (void) calculate |
Performs the final calculation of the cryptographic hash.
OFHashAlreadyCalculatedException | The hash has already been calculated |
+ (size_t) digestSize |
Returns the digest size of the cryptographic hash, in bytes.
+ (instancetype) hashWithAllowsSwappableMemory: | (bool) | allowsSwappableMemory |
Creates a new cryptographic hash.
- (instancetype) initWithAllowsSwappableMemory: | (bool) | allowsSwappableMemory |
Initializes an already allocated cryptographic hash.
- (void) reset |
- (void) updateWithBuffer: | (const void *) | buffer | |
length: | (size_t) | length |
Adds a buffer to the cryptographic hash to be calculated.
buffer | The buffer which should be included into the calculation |
length | The length of the buffer |
OFHashAlreadyCalculatedException | The hash has already been calculated |
|
readnonatomicassign |
A buffer containing the cryptographic hash.
The size of the buffer depends on the hash used. The buffer is part of the receiver's memory pool.
OFHashNotCalculatedException | The hash hasn't been calculated yet |