diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2017-12-07 13:27:11 +0000 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2017-12-25 19:28:03 +0000 |
commit | 1e5491e942d0a372ebebe9ef3d40941fc4a4fbb6 (patch) | |
tree | d13f404893c3994db28935da90947fbea1fc7cd5 /tests/unit_tests | |
parent | Merge pull request #2936 (diff) | |
download | monero-1e5491e942d0a372ebebe9ef3d40941fc4a4fbb6.tar.xz |
Add a chacha20 variant to go with chacha8
Diffstat (limited to '')
-rw-r--r-- | tests/unit_tests/CMakeLists.txt | 2 | ||||
-rw-r--r-- | tests/unit_tests/chacha.cpp (renamed from tests/unit_tests/chacha8.cpp) | 2 | ||||
-rw-r--r-- | tests/unit_tests/serialization.cpp | 8 |
3 files changed, 6 insertions, 6 deletions
diff --git a/tests/unit_tests/CMakeLists.txt b/tests/unit_tests/CMakeLists.txt index cfacd5688..ba3acef0c 100644 --- a/tests/unit_tests/CMakeLists.txt +++ b/tests/unit_tests/CMakeLists.txt @@ -36,7 +36,7 @@ set(unit_tests_sources block_reward.cpp bulletproofs.cpp canonical_amounts.cpp - chacha8.cpp + chacha.cpp checkpoints.cpp command_line.cpp crypto.cpp diff --git a/tests/unit_tests/chacha8.cpp b/tests/unit_tests/chacha.cpp index bf0699eba..eadebf9d8 100644 --- a/tests/unit_tests/chacha8.cpp +++ b/tests/unit_tests/chacha.cpp @@ -32,7 +32,7 @@ #include "gtest/gtest.h" -#include "crypto/chacha8.h" +#include "crypto/chacha.h" namespace { diff --git a/tests/unit_tests/serialization.cpp b/tests/unit_tests/serialization.cpp index 9e76efadf..2ef1097da 100644 --- a/tests/unit_tests/serialization.cpp +++ b/tests/unit_tests/serialization.cpp @@ -802,12 +802,12 @@ TEST(Serialization, portability_outputs) // decrypt (copied from wallet2::decrypt) auto decrypt = [] (const std::string &ciphertext, const crypto::secret_key &skey, bool authenticated) -> string { - const size_t prefix_size = sizeof(chacha8_iv) + (authenticated ? sizeof(crypto::signature) : 0); + const size_t prefix_size = sizeof(chacha_iv) + (authenticated ? sizeof(crypto::signature) : 0); if(ciphertext.size() < prefix_size) return {}; - crypto::chacha8_key key; - crypto::generate_chacha8_key(&skey, sizeof(skey), key); - const crypto::chacha8_iv &iv = *(const crypto::chacha8_iv*)&ciphertext[0]; + crypto::chacha_key key; + crypto::generate_chacha_key(&skey, sizeof(skey), key); + const crypto::chacha_iv &iv = *(const crypto::chacha_iv*)&ciphertext[0]; std::string plaintext; plaintext.resize(ciphertext.size() - prefix_size); if (authenticated) |