Skip to content

Commit

Permalink
rename encryption / decryption methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Consti10 committed Aug 6, 2023
1 parent be3a014 commit 45a73c5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/Encryption.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ static constexpr auto ENCRYPTION_ADDITIONAL_VALIDATION_DATA=crypto_aead_chacha20
static std::array<uint8_t,32> create_onetimeauth_subkey(const uint64_t nonce,const std::array<uint8_t, crypto_aead_chacha20poly1305_KEYBYTES> session_key){
// sub-key for this packet
std::array<uint8_t, 32> subkey{};
// We only have an 8 byte nonce, this should be enough entropy
std::array<uint8_t,16> nonce_buf{0};
memcpy(nonce_buf.data(),(uint8_t*)&nonce,8);
crypto_core_hchacha20(subkey.data(),nonce_buf.data(),session_key.data(), nullptr);
Expand Down

0 comments on commit 45a73c5

Please sign in to comment.