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.
21 lines
734 B
Swift
21 lines
734 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 MockAeadXChaCha20Poly1305Ietf: Mock<AeadXChaCha20Poly1305IetfType>, AeadXChaCha20Poly1305IetfType {
|
||
3 years ago
|
var KeyBytes: Int = 32
|
||
|
var ABytes: Int = 16
|
||
|
|
||
|
func encrypt(message: Bytes, secretKey: Bytes, nonce: Bytes, additionalData: Bytes?) -> Bytes? {
|
||
3 years ago
|
return accept(args: [message, secretKey, nonce, additionalData]) as? Bytes
|
||
3 years ago
|
}
|
||
|
|
||
|
func decrypt(authenticatedCipherText: Bytes, secretKey: Bytes, nonce: Bytes, additionalData: Bytes?) -> Bytes? {
|
||
3 years ago
|
return accept(args: [authenticatedCipherText, secretKey, nonce, additionalData]) as? Bytes
|
||
3 years ago
|
}
|
||
|
}
|