Overview
Comment: | OFHMAC: Allow resetting while keeping the key |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
c55c5dff513e04dc8f896cfed3af470e |
User & Date: | js on 2016-07-24 20:51:18 |
Other Links: | manifest | tags |
Context
2016-07-25
| ||
22:30 | Implement PBKDF2 check-in: 49d1987eaf user: js tags: trunk | |
2016-07-24
| ||
20:51 | OFHMAC: Allow resetting while keeping the key check-in: c55c5dff51 user: js tags: trunk | |
20:05 | OF*Hash: Call [self reset] in -[dealloc] check-in: 096dd743b5 user: js tags: trunk | |
Changes
Modified src/OFHMAC.h from [682e9b5139] to [fe33092934].
︙ | |||
22 23 24 25 26 27 28 29 | 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | + + - + + + + | /*! * @class OFHMAC OFHMAC.h ObjFW/OFHMAC.h * * @brief A class which provides methods to calculate an HMAC. */ @interface OFHMAC: OFObject { Class <OFCryptoHash> _hashClass; id <OFCryptoHash> _outerHash, _innerHash; id <OFCryptoHash> _outerHashCopy, _innerHashCopy; |
︙ | |||
46 47 48 49 50 51 52 53 54 55 56 57 58 59 | 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 | + + + + + + | * @return An initialized OFHMAC */ - initWithHashClass: (Class <OFCryptoHash>)class; /*! * @brief Sets the key for the HMAC. * * @note This resets the HMAC! * * @warning This invalidates any pointer previously returned by @ref digest. If * you are still interested in the previous digest, you need to memcpy * it yourself before calling @ref setKey:length:! * * @param key The key for the HMAC * @param length The length of the key for the HMAC */ - (void)setKey: (const void*)key length: (size_t)length; /*! |
︙ | |||
79 80 81 82 83 84 85 | 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 | - + + + + + | * @brief Returns the size of the digest. * * @return The size of the digest. */ - (size_t)digestSize; /*! |
Modified src/OFHMAC.m from [9c331f3be4] to [8de8a11875].
︙ | |||
16 17 18 19 20 21 22 23 24 25 26 27 | 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 | + + - + - - - + - - - - - - - - + + + - + + + + + + + - - + - + - - + + + + - + + + + + - + + + + - + - + - - + + + + + - + | #import "OFHMAC.h" #import "OFHashAlreadyCalculatedException.h" #import "OFInvalidArgumentException.h" @implementation OFHMAC @synthesize hashClass = _hashClass; + (instancetype)HMACWithHashClass: (Class <OFCryptoHash>)class { return [[[self alloc] initWithHashClass: class] autorelease]; } |