@@ -42,10 +42,15 @@ /*! * @brief The block size of the cryptographic hash, in bytes. */ @property (readonly, nonatomic) size_t blockSize; +/*! + * @brief Whether data may be stored in swappable memory. + */ +@property (readonly, nonatomic) bool allowsSwappableMemory; + /*! * @brief A boolean whether the hash has already been calculated. */ @property (readonly, nonatomic, getter=isCalculated) bool calculated; @@ -59,13 +64,14 @@ OF_RETURNS_INNER_POINTER; /*! * @brief Creates a new cryptographic hash. * - * @return A new autoreleased OFCryptoHash + * @return A new autoreleased cryptographic hash */ -+ (instancetype)cryptoHash; ++ (instancetype)cryptoHashWithAllowsSwappableMemory: + (bool)allowsSwappableMemory; /*! * @brief Returns the digest size of the cryptographic hash, in bytes. * * @return The digest size of the cryptographic hash, in bytes @@ -77,10 +83,19 @@ * * @return The block size of the cryptographic hash, in bytes */ + (size_t)blockSize; +/*! + * @brief Initializes an already allocated cryptographic hash. + * + * @return An initialized cryptographic hash + */ +- (instancetype)initWithAllowsSwappableMemory: (bool)allowsSwappableMemory; + +- (instancetype)init OF_UNAVAILABLE; + /*! * @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