From ba430ff1fbce68a8940e448f0e0fe7266fa638b5 Mon Sep 17 00:00:00 2001 From: Supriti Singh Date: Fri, 7 Feb 2014 00:14:43 +0000 Subject: Computing finger identity using libgcrypt functions. --- src/include/gnunet_crypto_lib.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/include') diff --git a/src/include/gnunet_crypto_lib.h b/src/include/gnunet_crypto_lib.h index 2e333bd17..3d9241b64 100644 --- a/src/include/gnunet_crypto_lib.h +++ b/src/include/gnunet_crypto_lib.h @@ -1267,6 +1267,19 @@ GNUNET_CRYPTO_ecdsa_private_key_derive (const struct GNUNET_CRYPTO_EcdsaPrivateK const char *context); +/** + * Computes a new PeerIdentity using the Chord formula. + * new_peer_identity = ((my_identity + pow(2,i)) mod (pow(2,m) + * where m, size of struct GNUNET_PeerIdentity in bits. + * i, 0 <= i <= m + * @param my_identity original PeerIdentity + * @param value of i. + * @return finger_identity + */ +struct GNUNET_PeerIdentity * +GNUNET_CRYPTO_compute_finger(struct GNUNET_PeerIdentity *my_identity,unsigned int index); + + /** * @ingroup crypto * Derive a public key from a given public key and a label. -- cgit v1.2.3