Overview
Comment: | Add OFSHA256Hash
Took me some time to figure out the RFC is buggy and SSIG0(t-15) should |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
46af1252a5804f071ed65c357a874fcb |
User & Date: | js on 2014-09-01 11:08:43 |
Other Links: | manifest | tags |
Context
2014-09-01
| ||
23:42 | Add OFSHA224Hash check-in: a1931f59a2 user: js tags: trunk | |
11:08 | Add OFSHA256Hash check-in: 46af1252a5 user: js tags: trunk | |
10:47 | OF{MD5,SHA1}Hash: Zero _buffer when done check-in: 23dc2c7ff8 user: js tags: trunk | |
Changes
Modified ObjFW.xcodeproj/project.pbxproj from [bd47af1654] to [70bebc9fac].
︙ | |||
145 146 147 148 149 150 151 152 153 154 155 156 157 158 | 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 | + + | 4B325EDF1605F3A0007836CA /* OFTimer.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B325EDB1605F3A0007836CA /* OFTimer.h */; settings = {ATTRIBUTES = (Public, ); }; }; 4B325EE01605F3A0007836CA /* OFTimer.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B325EDC1605F3A0007836CA /* OFTimer.m */; }; 4B3379CF1979326A0088E97E /* threading.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B3379CE1979326A0088E97E /* threading.m */; }; 4B39844213D3A24600E6F825 /* OFSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B39844013D3A24600E6F825 /* OFSet.h */; settings = {ATTRIBUTES = (Public, ); }; }; 4B39844313D3A24600E6F825 /* OFSet.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B39844113D3A24600E6F825 /* OFSet.m */; }; 4B39844713D3AFB400E6F825 /* OFMutableSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B39844513D3AFB400E6F825 /* OFMutableSet.h */; settings = {ATTRIBUTES = (Public, ); }; }; 4B39844813D3AFB400E6F825 /* OFMutableSet.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B39844613D3AFB400E6F825 /* OFMutableSet.m */; }; 4B3B03EB19B3F70500F70C05 /* OFSHA256Hash.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B3B03E919B3F70500F70C05 /* OFSHA256Hash.h */; settings = {ATTRIBUTES = (Public, ); }; }; 4B3B03EC19B3F70500F70C05 /* OFSHA256Hash.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B3B03EA19B3F70500F70C05 /* OFSHA256Hash.m */; }; 4B3B0798166978780044E634 /* OFMapTable.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B3B0796166978780044E634 /* OFMapTable.h */; settings = {ATTRIBUTES = (Public, ); }; }; 4B3B0799166978780044E634 /* OFMapTable.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B3B0797166978780044E634 /* OFMapTable.m */; }; 4B3D238B1337FC0D00DD29B8 /* OFApplication.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B175C1E116D130B003C99CB /* OFApplication.m */; }; 4B3D238C1337FC0D00DD29B8 /* OFArray.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B67995B1099E7C50041064A /* OFArray.m */; }; 4B3D238D1337FC0D00DD29B8 /* OFAutoreleasePool.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B67995D1099E7C50041064A /* OFAutoreleasePool.m */; }; 4B3D238E1337FC0D00DD29B8 /* OFBlock.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BD86D811237A6C600ED9912 /* OFBlock.m */; }; 4B3D238F1337FC0D00DD29B8 /* OFConstantString.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BE5F0D812DF4225005C7A0C /* OFConstantString.m */; }; |
︙ | |||
632 633 634 635 636 637 638 639 640 641 642 643 644 645 | 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 | + + | 4B325EDB1605F3A0007836CA /* OFTimer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFTimer.h; path = src/OFTimer.h; sourceTree = "<group>"; }; 4B325EDC1605F3A0007836CA /* OFTimer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFTimer.m; path = src/OFTimer.m; sourceTree = "<group>"; }; 4B3379CE1979326A0088E97E /* threading.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = threading.m; path = src/threading.m; sourceTree = "<group>"; }; 4B39844013D3A24600E6F825 /* OFSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFSet.h; path = src/OFSet.h; sourceTree = "<group>"; }; 4B39844113D3A24600E6F825 /* OFSet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFSet.m; path = src/OFSet.m; sourceTree = "<group>"; }; 4B39844513D3AFB400E6F825 /* OFMutableSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFMutableSet.h; path = src/OFMutableSet.h; sourceTree = "<group>"; }; 4B39844613D3AFB400E6F825 /* OFMutableSet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFMutableSet.m; path = src/OFMutableSet.m; sourceTree = "<group>"; }; 4B3B03E919B3F70500F70C05 /* OFSHA256Hash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFSHA256Hash.h; path = src/OFSHA256Hash.h; sourceTree = "<group>"; }; 4B3B03EA19B3F70500F70C05 /* OFSHA256Hash.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFSHA256Hash.m; path = src/OFSHA256Hash.m; sourceTree = "<group>"; }; 4B3B0796166978780044E634 /* OFMapTable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFMapTable.h; path = src/OFMapTable.h; sourceTree = "<group>"; }; 4B3B0797166978780044E634 /* OFMapTable.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFMapTable.m; path = src/OFMapTable.m; sourceTree = "<group>"; }; 4B3D236D1337FB5800DD29B8 /* base64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = base64.h; path = src/base64.h; sourceTree = "<group>"; }; 4B3D236E1337FB5800DD29B8 /* base64.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = base64.m; path = src/base64.m; sourceTree = "<group>"; }; 4B3D23761337FBC800DD29B8 /* ObjFW.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = ObjFW.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 4B3D23BB1337FC5800DD29B8 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Info.plist; path = support/Info.plist; sourceTree = SOURCE_ROOT; }; 4B3D5693139A617D0010A78F /* OFSerializationTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFSerializationTests.m; path = tests/OFSerializationTests.m; sourceTree = "<group>"; }; |
︙ | |||
1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 | 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 | + + | 4BA85BC9140ECCE800E91D51 /* OFSet_hashtable.m */, 4B8385141951BF9500D5358A /* OFSettings.h */, 4B8385151951BF9500D5358A /* OFSettings.m */, 4B8385121951BF9500D5358A /* OFSettings_INIFile.h */, 4B8385131951BF9500D5358A /* OFSettings_INIFile.m */, 4BF1BCC411C9663F0025511F /* OFSHA1Hash.h */, 4BF1BCC511C9663F0025511F /* OFSHA1Hash.m */, 4B3B03E919B3F70500F70C05 /* OFSHA256Hash.h */, 4B3B03EA19B3F70500F70C05 /* OFSHA256Hash.m */, 4B141BA215FCDF74000C21A8 /* OFSortedList.h */, 4B141BA315FCDF74000C21A8 /* OFSortedList.m */, 4B0256E2172B60400062B5F1 /* OFStdIOStream.h */, 4B0256E3172B60400062B5F1 /* OFStdIOStream.m */, 4B67997D1099E7C50041064A /* OFStream.h */, 4B67997E1099E7C50041064A /* OFStream.m */, 4B6C8AD217BD5C2E00B194F2 /* OFStream+Private.h */, |
︙ | |||
1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 | 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 | + | 4B674405163C395900EB1E59 /* OFRecursiveMutex.h in Headers */, 4B325EDD1605F3A0007836CA /* OFRunLoop.h in Headers */, 4B3D23D31337FCB000DD29B8 /* OFSeekableStream.h in Headers */, 4B989C2F13771A3700109A30 /* OFSerialization.h in Headers */, 4B39844213D3A24600E6F825 /* OFSet.h in Headers */, 4B8385181951BF9500D5358A /* OFSettings.h in Headers */, 4B3D23D41337FCB000DD29B8 /* OFSHA1Hash.h in Headers */, 4B3B03EB19B3F70500F70C05 /* OFSHA256Hash.h in Headers */, 4B141BA415FCDF74000C21A8 /* OFSortedList.h in Headers */, 4B0256E4172B60400062B5F1 /* OFStdIOStream.h in Headers */, 4B3D23D51337FCB000DD29B8 /* OFStream.h in Headers */, 4B3D23D71337FCB000DD29B8 /* OFStreamSocket.h in Headers */, 4B3D23D81337FCB000DD29B8 /* OFString.h in Headers */, 4B3D23D91337FCB000DD29B8 /* OFString+Hashing.h in Headers */, 4B5CF8F914940BD2007AA324 /* OFString+JSONValue.h in Headers */, |
︙ | |||
1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 | 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 | + | 4B325EDE1605F3A0007836CA /* OFRunLoop.m in Sources */, 4B3D23A11337FC0D00DD29B8 /* OFSeekableStream.m in Sources */, 4B39844313D3A24600E6F825 /* OFSet.m in Sources */, 4BA85BCF140ECCE800E91D51 /* OFSet_hashtable.m in Sources */, 4B8385191951BF9500D5358A /* OFSettings.m in Sources */, 4B8385171951BF9500D5358A /* OFSettings_INIFile.m in Sources */, 4B3D23A21337FC0D00DD29B8 /* OFSHA1Hash.m in Sources */, 4B3B03EC19B3F70500F70C05 /* OFSHA256Hash.m in Sources */, 4B141BA515FCDF74000C21A8 /* OFSortedList.m in Sources */, 4B0256E5172B60400062B5F1 /* OFStdIOStream.m in Sources */, 4B3D23A31337FC0D00DD29B8 /* OFStream.m in Sources */, 4B3D23A51337FC0D00DD29B8 /* OFStreamSocket.m in Sources */, 4B3D23A61337FC0D00DD29B8 /* OFString.m in Sources */, 4B3D23A71337FC0D00DD29B8 /* OFString+Hashing.m in Sources */, 4B5CF8FA14940BD2007AA324 /* OFString+JSONValue.m in Sources */, |
︙ |
Modified src/Makefile from [fd862fcfd6] to [f19a28457b].
︙ | |||
40 41 42 43 44 45 46 47 48 49 50 51 52 53 | 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | + | OFObject+Serialization.m \ OFOptionsParser.m \ ${OFPROCESS_M} \ OFRunLoop.m \ OFSeekableStream.m \ OFSet.m \ OFSHA1Hash.m \ OFSHA256Hash.m \ OFSortedList.m \ OFStdIOStream.m \ OFStream.m \ OFString.m \ OFString+Hashing.m \ OFString+JSONValue.m \ OFString+Serialization.m \ |
︙ |
Modified src/OFDataArray+Hashing.h from [67534c24f6] to [5ff2170c80].
︙ | |||
36 37 38 39 40 41 42 43 | 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | + + + + + + + + | /*! * @brief Returns the SHA-1 hash of the data array as an autoreleased OFString. * * @return The SHA-1 hash of the data array as an autoreleased OFString */ - (OFString*)SHA1Hash; /*! * @brief Returns the SHA-256 hash of the data array as an autoreleased * OFString. * * @return The SHA-256 hash of the data array as an autoreleased OFString */ - (OFString*)SHA256Hash; @end |
Modified src/OFDataArray+Hashing.m from [b68e631dbd] to [0013993037].
︙ | |||
17 18 19 20 21 22 23 24 25 26 27 28 29 30 | 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | + | #include "config.h" #import "OFDataArray.h" #import "OFString.h" #import "OFHash.h" #import "OFMD5Hash.h" #import "OFSHA1Hash.h" #import "OFSHA256Hash.h" int _OFDataArray_Hashing_reference; @implementation OFDataArray (Hashing) - (OFString*)OF_hashAsStringWithHash: (Class <OFHash>)hashClass { void *pool = objc_autoreleasePoolPush(); |
︙ | |||
60 61 62 63 64 65 66 67 | 61 62 63 64 65 66 67 68 69 70 71 72 73 | + + + + + | return [self OF_hashAsStringWithHash: [OFMD5Hash class]]; } - (OFString*)SHA1Hash { return [self OF_hashAsStringWithHash: [OFSHA1Hash class]]; } - (OFString*)SHA256Hash { return [self OF_hashAsStringWithHash: [OFSHA256Hash class]]; } @end |
Modified src/OFMD5Hash.m from [210a4456e6] to [8c6a093adf].
︙ | |||
23 24 25 26 27 28 29 | 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | - + | #import "OFHashAlreadyCalculatedException.h" #define F(a, b, c) (((a) & (b)) | (~(a) & (c))) #define G(a, b, c) (((a) & (c)) | ((b) & ~(c))) #define H(a, b, c) ((a) ^ (b) ^ (c)) #define I(a, b, c) ((b) ^ ((a) | ~(c))) |
︙ | |||
88 89 90 91 92 93 94 | 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 | - + | const uint_fast8_t a = (4 - (i & 3)) & 3; \ const uint_fast8_t b = (a + 1) & 3; \ const uint_fast8_t c = (a + 2) & 3; \ const uint_fast8_t d = (a + 3) & 3; \ const uint_fast8_t r = rotateBits[(i % 4) + (i / 16) * 4]; \ \ new[a] += f(new[b], new[c], new[d]) + \ |
︙ |
Modified src/OFSHA1Hash.h from [19853167ae] to [9abc68012e].
︙ | |||
15 16 17 18 19 20 21 | 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | - + | */ #import "OFHash.h" /*! * @class OFSHA1Hash OFSHA1Hash.h ObjFW/OFSHA1Hash.h * |
Added src/OFSHA256Hash.h version [7c4c8f3bab].
|
Added src/OFSHA256Hash.m version [979b11a5fc].