@@ -16,19 +16,20 @@ #import "OFObject.h" OF_ASSUME_NONNULL_BEGIN /** - * @protocol OFCryptoHash OFCryptoHash.h ObjFW/OFCryptoHash.h + * @protocol OFCryptographicHash \ + * OFCryptographicHash.h ObjFW/OFCryptographicHash.h * * @brief 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. */ -@protocol OFCryptoHash +@protocol OFCryptographicHash #ifdef OF_HAVE_CLASS_PROPERTIES @property (class, readonly, nonatomic) size_t digestSize; @property (class, readonly, nonatomic) size_t blockSize; #endif @@ -64,12 +65,11 @@ /** * @brief Creates a new cryptographic hash. * * @return A new autoreleased cryptographic hash */ -+ (instancetype)cryptoHashWithAllowsSwappableMemory: - (bool)allowsSwappableMemory; ++ (instancetype)hashWithAllowsSwappableMemory: (bool)allowsSwappableMemory; /** * @brief Returns the digest size of the cryptographic hash, in bytes. * * @return The digest size of the cryptographic hash, in bytes @@ -96,12 +96,11 @@ * @brief Adds a buffer to the cryptographic hash to be calculated. * * @param buffer The buffer which should be included into the calculation * @param length The length of the buffer */ -- (void)updateWithBuffer: (const void *)buffer - length: (size_t)length; +- (void)updateWithBuffer: (const void *)buffer length: (size_t)length; /** * @brief Resets all state so that a new hash can be calculated. * * @warning This invalidates any pointer previously returned by @ref digest. If