diff options
author | Richard van der Hoff <github@rvanderhoff.org.uk> | 2016-09-05 10:36:43 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-05 10:36:43 +0100 |
commit | 9d16d820890e7b301baa8b69694aaea19f9bfc7f (patch) | |
tree | 659be65eb1b131073bf9580292214b3fc24aa982 /src/crypto.cpp | |
parent | 0c3f527dfd46d3056d5b3690836c102f0e0adfb4 (diff) | |
parent | 39212987bdef8e16794e756e3c78b531be25b70a (diff) |
Merge pull request #13 from matrix-org/rav/split_out_key_lengths
Create new constants for key lengths, etc
Diffstat (limited to 'src/crypto.cpp')
-rw-r--r-- | src/crypto.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/crypto.cpp b/src/crypto.cpp index 83493be..0b08c54 100644 --- a/src/crypto.cpp +++ b/src/crypto.cpp @@ -31,7 +31,7 @@ namespace { static const std::uint8_t CURVE25519_BASEPOINT[32] = {9}; static const std::size_t AES_KEY_SCHEDULE_LENGTH = 60; -static const std::size_t AES_KEY_BITS = 8 * olm::KEY_LENGTH; +static const std::size_t AES_KEY_BITS = 8 * AES256_KEY_LENGTH; static const std::size_t AES_BLOCK_LENGTH = 16; static const std::size_t SHA256_BLOCK_LENGTH = 64; static const std::uint8_t HKDF_DEFAULT_SALT[32] = {}; @@ -104,7 +104,7 @@ void olm::curve25519_generate_key( std::uint8_t const * random_32_bytes, olm::Curve25519KeyPair & key_pair ) { - std::memcpy(key_pair.private_key, random_32_bytes, KEY_LENGTH); + std::memcpy(key_pair.private_key, random_32_bytes, CURVE25519_KEY_LENGTH); ::curve25519_donna( key_pair.public_key, key_pair.private_key, CURVE25519_BASEPOINT ); |