diff options
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 |