aboutsummaryrefslogtreecommitdiff
path: root/libcmix-crypto/curve25519/sodium
diff options
context:
space:
mode:
authorDennis Brentjes <d.brentjes@gmail.com>2016-11-01 17:40:17 +0100
committerDennis Brentjes <d.brentjes@gmail.com>2016-11-01 17:40:17 +0100
commit9531b6bea9fb29074c588a4e4e8838f6d9335a2b (patch)
tree4d0e9429203bf5976507b43e6663f9fe0b21e6d0 /libcmix-crypto/curve25519/sodium
parentbdc26e00ad99f4f670df1a65b5e6439d0dfadc87 (diff)
downloadcmix-9531b6bea9fb29074c588a4e4e8838f6d9335a2b.tar.gz
cmix-9531b6bea9fb29074c588a4e4e8838f6d9335a2b.tar.bz2
cmix-9531b6bea9fb29074c588a4e4e8838f6d9335a2b.zip
Moves cmix calculation stuff outisde of the node class.
Moves the computations and cryptography to the the libcmix library where we can group and memory manage the underlying crypto-library.
Diffstat (limited to 'libcmix-crypto/curve25519/sodium')
-rw-r--r--libcmix-crypto/curve25519/sodium/libsodium_curve25519.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/libcmix-crypto/curve25519/sodium/libsodium_curve25519.c b/libcmix-crypto/curve25519/sodium/libsodium_curve25519.c
index 6c3fe13..2405442 100644
--- a/libcmix-crypto/curve25519/sodium/libsodium_curve25519.c
+++ b/libcmix-crypto/curve25519/sodium/libsodium_curve25519.c
@@ -47,7 +47,7 @@ void curve25519_add_public_share(char** buffer, size_t* out_len, char const* sha
}
-struct SharedKey curve25519_derive_shared_key(struct KeyPair pair, unsigned char const* other_pub, size_t pub_len, unsigned char const* value, size_t value_len, void* priv_value, bool swap_pub_order) {
+GroupElement curve25519_derive_shared_key(struct KeyPair pair, unsigned char const* other_pub, size_t pub_len, unsigned char const* value, size_t value_len, void* priv_value, bool swap_pub_order) {
unsigned char* shared = (unsigned char*) sodium_malloc(crypto_generichash_BYTES);
crypto_generichash_state h;
@@ -71,9 +71,7 @@ struct SharedKey curve25519_derive_shared_key(struct KeyPair pair, unsigned char
sodium_free(scalarmult_q);
- return (struct SharedKey){
- shared,
- };
+ return shared;
}
void curve25519_deinitialize(void) {}