diff options
author | Richard van der Hoff <richard@matrix.org> | 2016-05-24 12:06:47 +0100 |
---|---|---|
committer | Richard van der Hoff <richard@matrix.org> | 2016-05-24 12:06:47 +0100 |
commit | 2fd28a66824bda7b86c08b065736009c39761987 (patch) | |
tree | 8bd7226ffd290b7eb2863733460e2ec0f2685306 /src/cipher.cpp | |
parent | d4a3c8dbaa6730519d3b6b13004e7fd9ea288870 (diff) |
Rewrite _olm_cipher_aes_sha_256 initialisation
Replace the init-static-var dance with some preprocessor macros
Diffstat (limited to 'src/cipher.cpp')
-rw-r--r-- | src/cipher.cpp | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/src/cipher.cpp b/src/cipher.cpp index 7830f6c..8c3de92 100644 --- a/src/cipher.cpp +++ b/src/cipher.cpp @@ -130,25 +130,12 @@ size_t aes_sha_256_cipher_decrypt( return plaintext_length; } +} // namespace -const _olm_cipher_ops aes_sha_256_cipher_ops = { +const struct _olm_cipher_ops _olm_cipher_aes_sha_256_ops = { aes_sha_256_cipher_mac_length, aes_sha_256_cipher_encrypt_ciphertext_length, aes_sha_256_cipher_encrypt, aes_sha_256_cipher_decrypt_max_plaintext_length, aes_sha_256_cipher_decrypt, }; - -} // namespace - - -_olm_cipher *_olm_cipher_aes_sha_256_init( - struct _olm_cipher_aes_sha_256 *cipher, - uint8_t const * kdf_info, - size_t kdf_info_length -) { - cipher->base_cipher.ops = &aes_sha_256_cipher_ops; - cipher->kdf_info = kdf_info; - cipher->kdf_info_length = kdf_info_length; - return &(cipher->base_cipher); -} |