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 /include/olm/crypto.hh | |
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 'include/olm/crypto.hh')
-rw-r--r-- | include/olm/crypto.hh | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/include/olm/crypto.hh b/include/olm/crypto.hh index 484dc83..13fd7e9 100644 --- a/include/olm/crypto.hh +++ b/include/olm/crypto.hh @@ -25,23 +25,18 @@ namespace olm { -static const std::size_t ED25519_PRIVATE_KEY_LENGTH = 64; -static const std::size_t KEY_LENGTH = 32; -static const std::size_t SIGNATURE_LENGTH = 64; -static const std::size_t IV_LENGTH = 16; - struct Curve25519PublicKey { - std::uint8_t public_key[KEY_LENGTH]; + std::uint8_t public_key[CURVE25519_KEY_LENGTH]; }; struct Curve25519KeyPair : public Curve25519PublicKey { - std::uint8_t private_key[KEY_LENGTH]; + std::uint8_t private_key[CURVE25519_KEY_LENGTH]; }; struct Ed25519PublicKey { - std::uint8_t public_key[KEY_LENGTH]; + std::uint8_t public_key[ED25519_PUBLIC_KEY_LENGTH]; }; @@ -93,12 +88,12 @@ bool ed25519_verify( struct Aes256Key { - std::uint8_t key[KEY_LENGTH]; + std::uint8_t key[AES256_KEY_LENGTH]; }; struct Aes256Iv { - std::uint8_t iv[IV_LENGTH]; + std::uint8_t iv[AES256_IV_LENGTH]; }; |