From 4057f59453d0276a7dbfeee284892c46786c156b Mon Sep 17 00:00:00 2001 From: manuroe Date: Mon, 8 Apr 2019 18:48:09 +0200 Subject: OLMKit: SAS: Added macLongKdf support (cherry picked from commit 934d516eb35c488ee197e1bab78a4c81e3c8241d) --- xcode/OLMKitTests/OLMKitSASTests.m | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'xcode/OLMKitTests') 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 -- cgit v1.2.3