*/
#include "platform.h"
-#include "gnunet_common.h"
-#include "gnunet_crypto_lib.h"
-#include "gnunet_disk_lib.h"
-#include "gnunet_strings_lib.h"
+#include "gnunet_util_lib.h"
#include <gcrypt.h>
#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
/**
* @ingroup hash
- *
+ *
* Compute the distance between 2 hashcodes. The computation must be
* fast, not involve bits[0] or bits[4] (they're used elsewhere), and be
* somewhat consistent. And of course, the result should be a positive
*/
void
GNUNET_CRYPTO_hash_to_aes_key (const struct GNUNET_HashCode *hc,
- struct GNUNET_CRYPTO_AesSessionKey *skey,
- struct GNUNET_CRYPTO_AesInitializationVector *iv)
+ struct GNUNET_CRYPTO_SymmetricSessionKey *skey,
+ struct GNUNET_CRYPTO_SymmetricInitializationVector *iv)
{
GNUNET_assert (GNUNET_YES ==
- GNUNET_CRYPTO_kdf (skey, sizeof (struct GNUNET_CRYPTO_AesSessionKey),
+ GNUNET_CRYPTO_kdf (skey, sizeof (struct GNUNET_CRYPTO_SymmetricSessionKey),
"Hash key derivation", strlen ("Hash key derivation"),
hc, sizeof (struct GNUNET_HashCode),
NULL, 0));
GNUNET_assert (GNUNET_YES ==
- GNUNET_CRYPTO_kdf (iv, sizeof (struct GNUNET_CRYPTO_AesInitializationVector),
+ GNUNET_CRYPTO_kdf (iv, sizeof (struct GNUNET_CRYPTO_SymmetricInitializationVector),
"Initialization vector derivation", strlen ("Initialization vector derivation"),
hc, sizeof (struct GNUNET_HashCode),
NULL, 0));
* @return 1 if h1 > h2, -1 if h1 < h2 and 0 if h1 == h2.
*/
int
-GNUNET_CRYPTO_hash_cmp (const struct GNUNET_HashCode *h1,
+GNUNET_CRYPTO_hash_cmp (const struct GNUNET_HashCode *h1,
const struct GNUNET_HashCode *h2)
{
unsigned int *i1;
*/
void
GNUNET_CRYPTO_hmac_derive_key (struct GNUNET_CRYPTO_AuthKey *key,
- const struct GNUNET_CRYPTO_AesSessionKey *rkey,
+ const struct GNUNET_CRYPTO_SymmetricSessionKey *rkey,
const void *salt, size_t salt_len, ...)
{
va_list argp;
*/
void
GNUNET_CRYPTO_hmac_derive_key_v (struct GNUNET_CRYPTO_AuthKey *key,
- const struct GNUNET_CRYPTO_AesSessionKey *rkey,
+ const struct GNUNET_CRYPTO_SymmetricSessionKey *rkey,
const void *salt, size_t salt_len,
va_list argp)
{
- GNUNET_CRYPTO_kdf_v (key->key, sizeof (key->key),
- salt, salt_len,
- rkey, sizeof (struct GNUNET_CRYPTO_AesSessionKey),
+ GNUNET_CRYPTO_kdf_v (key->key, sizeof (key->key),
+ salt, salt_len,
+ rkey, sizeof (struct GNUNET_CRYPTO_SymmetricSessionKey),
argp);
}