aboutsummaryrefslogtreecommitdiff
path: root/src/util/crypto_kdf.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-10-11 09:43:04 +0000
committerChristian Grothoff <christian@grothoff.org>2011-10-11 09:43:04 +0000
commitd9d94d0e53d26af75ec8241383d166544ebd79f3 (patch)
tree9080b73624389403a198257fe0547bb4634e64d2 /src/util/crypto_kdf.c
parent2d792ee2e9cc0c993b8907e2c8edb0c2b8465343 (diff)
downloadgnunet-d9d94d0e53d26af75ec8241383d166544ebd79f3.tar.gz
gnunet-d9d94d0e53d26af75ec8241383d166544ebd79f3.zip
converting to GNUNET_LOG_from*
Diffstat (limited to 'src/util/crypto_kdf.c')
-rw-r--r--src/util/crypto_kdf.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/util/crypto_kdf.c b/src/util/crypto_kdf.c
index eff4e6fd6..d8fcbd866 100644
--- a/src/util/crypto_kdf.c
+++ b/src/util/crypto_kdf.c
@@ -29,6 +29,8 @@
29#include "platform.h" 29#include "platform.h"
30#include "gnunet_crypto_lib.h" 30#include "gnunet_crypto_lib.h"
31 31
32#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
33
32/** 34/**
33 * @brief Derive key 35 * @brief Derive key
34 * @param result buffer for the derived key, allocated by caller 36 * @param result buffer for the derived key, allocated by caller
@@ -42,8 +44,8 @@
42 */ 44 */
43int 45int
44GNUNET_CRYPTO_kdf_v (void *result, size_t out_len, const void *xts, 46GNUNET_CRYPTO_kdf_v (void *result, size_t out_len, const void *xts,
45 size_t xts_len, const void *skm, size_t skm_len, 47 size_t xts_len, const void *skm, size_t skm_len,
46 va_list argp) 48 va_list argp)
47{ 49{
48 /* 50 /*
49 * "Finally, we point out to a particularly advantageous instantiation using 51 * "Finally, we point out to a particularly advantageous instantiation using
@@ -57,8 +59,9 @@ GNUNET_CRYPTO_kdf_v (void *result, size_t out_len, const void *xts,
57 * http://eprint.iacr.org/2010/264 59 * http://eprint.iacr.org/2010/264
58 */ 60 */
59 61
60 return GNUNET_CRYPTO_hkdf_v (result, out_len, GCRY_MD_SHA512, GCRY_MD_SHA256, 62 return GNUNET_CRYPTO_hkdf_v (result, out_len, GCRY_MD_SHA512,
61 xts, xts_len, skm, skm_len, argp); 63 GCRY_MD_SHA256, xts, xts_len, skm, skm_len,
64 argp);
62} 65}
63 66
64/** 67/**
@@ -74,13 +77,14 @@ GNUNET_CRYPTO_kdf_v (void *result, size_t out_len, const void *xts,
74 */ 77 */
75int 78int
76GNUNET_CRYPTO_kdf (void *result, size_t out_len, const void *xts, 79GNUNET_CRYPTO_kdf (void *result, size_t out_len, const void *xts,
77 size_t xts_len, const void *skm, size_t skm_len, ...) 80 size_t xts_len, const void *skm, size_t skm_len, ...)
78{ 81{
79 va_list argp; 82 va_list argp;
80 int ret; 83 int ret;
81 84
82 va_start (argp, skm_len); 85 va_start (argp, skm_len);
83 ret = GNUNET_CRYPTO_kdf_v (result, out_len, xts, xts_len, skm, skm_len, argp); 86 ret =
87 GNUNET_CRYPTO_kdf_v (result, out_len, xts, xts_len, skm, skm_len, argp);
84 va_end (argp); 88 va_end (argp);
85 89
86 return ret; 90 return ret;