mirror of https://github.com/oxen-io/session-ios
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
649 B
Swift
24 lines
649 B
Swift
3 years ago
|
// Copyright © 2022 Rangeproof Pty Ltd. All rights reserved.
|
||
|
|
||
|
import Foundation
|
||
|
import PromiseKit
|
||
|
import Sodium
|
||
|
|
||
|
@testable import SessionMessagingKit
|
||
|
|
||
3 years ago
|
class MockSign: Mock<SignType>, SignType {
|
||
3 years ago
|
var PublicKeyBytes: Int = 32
|
||
|
|
||
3 years ago
|
func signature(message: Bytes, secretKey: Bytes) -> Bytes? {
|
||
3 years ago
|
return accept(args: [message, secretKey]) as? Bytes
|
||
3 years ago
|
}
|
||
|
|
||
|
func verify(message: Bytes, publicKey: Bytes, signature: Bytes) -> Bool {
|
||
3 years ago
|
return accept(args: [message, publicKey, signature]) as! Bool
|
||
3 years ago
|
}
|
||
3 years ago
|
|
||
|
func toX25519(ed25519PublicKey: Bytes) -> Bytes? {
|
||
3 years ago
|
return accept(args: [ed25519PublicKey]) as? Bytes
|
||
3 years ago
|
}
|
||
3 years ago
|
}
|