| 107 | } |
| 108 | |
| 109 | std::string decrypt(const std::string& input, const Bytes& key) { |
| 110 | auto data = parseEncrypted(input); |
| 111 | Bytes plaintext = decryptRaw(data.ciphertext_plus_mac, key, data.nonce); |
| 112 | return bytesToString(plaintext); |
| 113 | } |
| 114 | |
| 115 | EncryptedData parseEncrypted(const std::string& input) { |
| 116 | std::vector<std::string> nonce_and_rest = utils::StringUtils::split(input, EncryptionType::separator()); |
no test coverage detected