| 6 | _connection.reset(new EncryptedConnection(EncryptedConnection::Type::Signaling, encryptionKey, [](int, int) { |
| 7 | })); |
| 8 | } |
| 9 |
| 10 | SignalingEncryption::~SignalingEncryption() { |
| 11 |
| 12 | } |
| 13 |
| 14 | absl::optional<rtc::CopyOnWriteBuffer> SignalingEncryption::encryptOutgoing(std::vector<uint8_t> const &data) { |
| 15 | return _connection->encryptRawPacket(rtc::CopyOnWriteBuffer(data.data(), data.size())); |
| 16 | } |
| 17 |
| 18 | absl::optional<rtc::CopyOnWriteBuffer> SignalingEncryption::decryptIncoming(std::vector<uint8_t> const &data) { |
| 19 | return _connection->decryptRawPacket(rtc::CopyOnWriteBuffer(data.data(), data.size())); |
| 20 | } |
| 21 |
| 22 | } // namespace tgcalls |
| 23 |