2022-03-11 06:57:28 +01:00
|
|
|
// Copyright © 2022 Rangeproof Pty Ltd. All rights reserved.
|
|
|
|
|
|
|
|
import Foundation
|
|
|
|
import Sodium
|
2023-03-09 23:42:36 +01:00
|
|
|
import SessionUtilitiesKit
|
2022-03-11 06:57:28 +01:00
|
|
|
|
|
|
|
@testable import SessionMessagingKit
|
|
|
|
|
|
|
|
class MockEd25519: Mock<Ed25519Type>, Ed25519Type {
|
2023-03-09 23:42:36 +01:00
|
|
|
func sign(data: Bytes, keyPair: KeyPair) throws -> Bytes? {
|
2022-03-15 05:19:23 +01:00
|
|
|
return accept(args: [data, keyPair]) as? Bytes
|
|
|
|
}
|
|
|
|
|
2022-03-11 06:57:28 +01:00
|
|
|
func verifySignature(_ signature: Data, publicKey: Data, data: Data) throws -> Bool {
|
|
|
|
return accept(args: [signature, publicKey, data]) as! Bool
|
|
|
|
}
|
|
|
|
}
|