2022-02-21 00:01:53 +01:00
|
|
|
// Copyright © 2022 Rangeproof Pty Ltd. All rights reserved.
|
|
|
|
|
|
|
|
import Foundation
|
|
|
|
import Sodium
|
|
|
|
|
|
|
|
@testable import SessionMessagingKit
|
|
|
|
|
2022-03-11 06:57:28 +01:00
|
|
|
class MockAeadXChaCha20Poly1305Ietf: Mock<AeadXChaCha20Poly1305IetfType>, AeadXChaCha20Poly1305IetfType {
|
2022-03-02 01:24:08 +01:00
|
|
|
var KeyBytes: Int = 32
|
|
|
|
var ABytes: Int = 16
|
|
|
|
|
|
|
|
func encrypt(message: Bytes, secretKey: Bytes, nonce: Bytes, additionalData: Bytes?) -> Bytes? {
|
2022-03-11 06:57:28 +01:00
|
|
|
return accept(args: [message, secretKey, nonce, additionalData]) as? Bytes
|
2022-03-02 01:24:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
func decrypt(authenticatedCipherText: Bytes, secretKey: Bytes, nonce: Bytes, additionalData: Bytes?) -> Bytes? {
|
2022-03-11 06:57:28 +01:00
|
|
|
return accept(args: [authenticatedCipherText, secretKey, nonce, additionalData]) as? Bytes
|
2022-02-21 00:01:53 +01:00
|
|
|
}
|
|
|
|
}
|