aboutsummaryrefslogtreecommitdiff
path: root/src/pk.cpp
diff options
context:
space:
mode:
authorHubert Chathi <hubert@uhoreg.ca>2019-05-14 22:02:50 -0400
committerHubert Chathi <hubert@uhoreg.ca>2019-05-14 22:02:50 -0400
commit969c8b45e5417935bff0292a8016d1b92521b5bd (patch)
tree76af0ebba765a2079f572b0e56c6f433a16025de /src/pk.cpp
parent0757e6df409c3a625dd4d1c186d4a990ec1ca172 (diff)
add more consts and comments
Diffstat (limited to 'src/pk.cpp')
-rw-r--r--src/pk.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/pk.cpp b/src/pk.cpp
index c619aee..8d736b0 100644
--- a/src/pk.cpp
+++ b/src/pk.cpp
@@ -108,7 +108,7 @@ size_t olm_pk_encrypt(
void * ciphertext, size_t ciphertext_length,
void * mac, size_t mac_length,
void * ephemeral_key, size_t ephemeral_key_size,
- void * random, size_t random_length
+ const void * random, size_t random_length
) {
if (ciphertext_length
< olm_pk_ciphertext_length(encryption, plaintext_length)
@@ -127,7 +127,7 @@ size_t olm_pk_encrypt(
}
_olm_curve25519_key_pair ephemeral_keypair;
- _olm_crypto_curve25519_generate_key((uint8_t *) random, &ephemeral_keypair);
+ _olm_crypto_curve25519_generate_key((const uint8_t *) random, &ephemeral_keypair);
olm::encode_base64(
(const uint8_t *)ephemeral_keypair.public_key.public_key,
CURVE25519_KEY_LENGTH,
@@ -202,7 +202,7 @@ size_t olm_pk_key_length(void) {
size_t olm_pk_key_from_private(
OlmPkDecryption * decryption,
void * pubkey, size_t pubkey_length,
- void * privkey, size_t privkey_length
+ const void * privkey, size_t privkey_length
) {
if (pubkey_length < olm_pk_key_length()) {
decryption->last_error =
@@ -215,7 +215,7 @@ size_t olm_pk_key_from_private(
return std::size_t(-1);
}
- _olm_crypto_curve25519_generate_key((uint8_t *) privkey, &decryption->key_pair);
+ _olm_crypto_curve25519_generate_key((const uint8_t *) privkey, &decryption->key_pair);
olm::encode_base64(
(const uint8_t *)decryption->key_pair.public_key.public_key,
CURVE25519_KEY_LENGTH,
@@ -227,7 +227,7 @@ size_t olm_pk_key_from_private(
size_t olm_pk_generate_key(
OlmPkDecryption * decryption,
void * pubkey, size_t pubkey_length,
- void * privkey, size_t privkey_length
+ const void * privkey, size_t privkey_length
) {
return olm_pk_key_from_private(decryption, pubkey, pubkey_length, privkey, privkey_length);
}
@@ -447,7 +447,7 @@ size_t olm_pk_signing_public_key_length(void) {
size_t olm_pk_signing_key_from_seed(
OlmPkSigning * signing,
void * pubkey, size_t pubkey_length,
- void * seed, size_t seed_length
+ const void * seed, size_t seed_length
) {
if (pubkey_length < olm_pk_signing_public_key_length()) {
signing->last_error =
@@ -460,7 +460,7 @@ size_t olm_pk_signing_key_from_seed(
return std::size_t(-1);
}
- _olm_crypto_ed25519_generate_key((uint8_t *) seed, &signing->key_pair);
+ _olm_crypto_ed25519_generate_key((const uint8_t *) seed, &signing->key_pair);
olm::encode_base64(
(const uint8_t *)signing->key_pair.public_key.public_key,
ED25519_PUBLIC_KEY_LENGTH,
@@ -469,7 +469,7 @@ size_t olm_pk_signing_key_from_seed(
return 0;
}
-size_t olm_pk_signature_length() {
+size_t olm_pk_signature_length(void) {
return olm::encode_base64_length(ED25519_SIGNATURE_LENGTH);
}