ObjFW
Toggle main menu visibility
Loading...
Searching...
No Matches
OFCryptographicHash.h
1
/*
2
* Copyright (c) 2008-2026 Jonathan Schleifer <js@nil.im>
3
*
4
* All rights reserved.
5
*
6
* This program is free software: you can redistribute it and/or modify it
7
* under the terms of the GNU Lesser General Public License version 3.0 only,
8
* as published by the Free Software Foundation.
9
*
10
* This program is distributed in the hope that it will be useful, but WITHOUT
11
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
13
* version 3.0 for more details.
14
*
15
* You should have received a copy of the GNU Lesser General Public License
16
* version 3.0 along with this program. If not, see
17
* <https://www.gnu.org/licenses/>.
18
*/
19
20
#import "
OFObject.h
"
21
22
OF_ASSUME_NONNULL_BEGIN
23
33
@protocol
OFCryptographicHash <
OFObject
, OFCopying>
34
#ifdef OF_HAVE_CLASS_PROPERTIES
35
@property
(
class
, readonly, nonatomic)
size_t
digestSize
;
36
@property
(
class
, readonly, nonatomic)
size_t
blockSize
;
37
#endif
38
42
@property
(readonly, nonatomic)
size_t
digestSize
;
43
47
@property
(readonly, nonatomic)
size_t
blockSize
;
48
52
@property
(readonly, nonatomic)
bool
allowsSwappableMemory
;
53
57
@property
(readonly, nonatomic, getter=isCalculated)
bool
calculated
;
58
67
@property
(readonly, nonatomic)
const
unsigned
char
*
digest
68
OF_RETURNS_INNER_POINTER;
69
75
+ (instancetype)hashWithAllowsSwappableMemory: (
bool
)allowsSwappableMemory;
76
82
+ (size_t)
digestSize
;
83
89
+ (size_t)
blockSize
;
90
96
- (instancetype)initWithAllowsSwappableMemory: (
bool
)allowsSwappableMemory;
97
98
- (instancetype)init OF_UNAVAILABLE;
99
107
- (void)updateWithBuffer: (const
void
*)buffer length: (
size_t
)length;
108
114
- (void)
calculate
;
115
123
- (void)
reset
;
124
@end
125
126
OF_ASSUME_NONNULL_END
OFObject.h
OFObject
The root class for all other classes inside ObjFW.
Definition
OFObject.h:956
-[OFCryptographicHash-p calculate]
void calculate()
Performs the final calculation of the cryptographic hash.
OFCryptographicHash-p::allowsSwappableMemory
bool allowsSwappableMemory
Whether data may be stored in swappable memory.
Definition
OFCryptographicHash.h:52
OFCryptographicHash-p::calculated
bool calculated
A boolean whether the hash has already been calculated.
Definition
OFCryptographicHash.h:57
-[OFCryptographicHash-p reset]
void reset()
Resets all state so that a new hash can be calculated.
OFCryptographicHash-p::blockSize
size_t blockSize
The block size of the cryptographic hash, in bytes.
Definition
OFCryptographicHash.h:47
OFCryptographicHash-p::digestSize
size_t digestSize
The digest size of the cryptographic hash, in bytes.
Definition
OFCryptographicHash.h:42
OFCryptographicHash-p::digest
const unsigned char * digest
A buffer containing the cryptographic hash.
Definition
OFCryptographicHash.h:68
src
OFCryptographicHash.h
Generated by
1.17.0