diff options
author | manuroe <manu@matrix.org> | 2019-04-08 18:48:09 +0200 |
---|---|---|
committer | manuroe <manu@matrix.org> | 2019-04-10 23:27:00 +0200 |
commit | 4057f59453d0276a7dbfeee284892c46786c156b (patch) | |
tree | 1f54e8202d6781cba47b771403ae2be6766992b2 /xcode/OLMKitTests | |
parent | 5de295da3e5f9ae7e4de6cfe009e2d0ad4e6a08b (diff) |
OLMKit: SAS: Added macLongKdf support
(cherry picked from commit 934d516eb35c488ee197e1bab78a4c81e3c8241d)
Diffstat (limited to 'xcode/OLMKitTests')
-rw-r--r-- | xcode/OLMKitTests/OLMKitSASTests.m | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/xcode/OLMKitTests/OLMKitSASTests.m b/xcode/OLMKitTests/OLMKitSASTests.m index 08a2490..e250a67 100644 --- a/xcode/OLMKitTests/OLMKitSASTests.m +++ b/xcode/OLMKitTests/OLMKitSASTests.m @@ -66,4 +66,21 @@ XCTAssertNil(bobError); } +- (void)testMACLongKdfsMatch { + [alice setTheirPublicKey:bob.publicKey]; + [bob setTheirPublicKey:alice.publicKey]; + + NSString *string = @"test"; + NSString *info = @"MAC"; + + NSError *aliceError, *bobError; + XCTAssertEqualObjects([alice calculateMacLongKdf:string info:info error:&aliceError], + [bob calculateMacLongKdf:string info:info error:&bobError]); + XCTAssertNotEqualObjects([alice calculateMacLongKdf:string info:info error:&aliceError], + [bob calculateMac:string info:info error:&bobError]); + XCTAssertNil(aliceError); + XCTAssertNil(bobError); +} + + @end |