diff options
Diffstat (limited to 'src/util/crypto_kdf.c')
-rw-r--r-- | src/util/crypto_kdf.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/src/util/crypto_kdf.c b/src/util/crypto_kdf.c index cd42a63bf..dc2e667af 100644 --- a/src/util/crypto_kdf.c +++ b/src/util/crypto_kdf.c | |||
@@ -42,23 +42,23 @@ | |||
42 | */ | 42 | */ |
43 | int | 43 | int |
44 | GNUNET_CRYPTO_kdf_v (void *result, size_t out_len, | 44 | GNUNET_CRYPTO_kdf_v (void *result, size_t out_len, |
45 | const void *xts, size_t xts_len, const void *skm, | 45 | const void *xts, size_t xts_len, const void *skm, |
46 | size_t skm_len, va_list argp) | 46 | size_t skm_len, va_list argp) |
47 | { | 47 | { |
48 | /* | 48 | /* |
49 | "Finally, we point out to a particularly advantageous instantiation using | 49 | * "Finally, we point out to a particularly advantageous instantiation using |
50 | HMAC-SHA512 as XTR and HMAC-SHA256 in PRF* (in which case the output from SHA-512 is | 50 | * HMAC-SHA512 as XTR and HMAC-SHA256 in PRF* (in which case the output from SHA-512 is |
51 | truncated to 256 bits). This makes sense in two ways: First, the extraction part is where we need a | 51 | * truncated to 256 bits). This makes sense in two ways: First, the extraction part is where we need a |
52 | stronger hash function due to the unconventional demand from the hash function in the extraction | 52 | * stronger hash function due to the unconventional demand from the hash function in the extraction |
53 | setting. Second, as shown in Section 6, using HMAC with a truncated output as an extractor | 53 | * setting. Second, as shown in Section 6, using HMAC with a truncated output as an extractor |
54 | allows to prove the security of HKDF under considerably weaker assumptions on the underlying | 54 | * allows to prove the security of HKDF under considerably weaker assumptions on the underlying |
55 | hash function." | 55 | * hash function." |
56 | 56 | * | |
57 | http://eprint.iacr.org/2010/264 | 57 | * http://eprint.iacr.org/2010/264 |
58 | */ | 58 | */ |
59 | 59 | ||
60 | return GNUNET_CRYPTO_hkdf_v (result, out_len, GCRY_MD_SHA512, GCRY_MD_SHA256, | 60 | return GNUNET_CRYPTO_hkdf_v (result, out_len, GCRY_MD_SHA512, GCRY_MD_SHA256, |
61 | xts, xts_len, skm, skm_len, argp); | 61 | xts, xts_len, skm, skm_len, argp); |
62 | } | 62 | } |
63 | 63 | ||
64 | /** | 64 | /** |
@@ -74,15 +74,15 @@ GNUNET_CRYPTO_kdf_v (void *result, size_t out_len, | |||
74 | */ | 74 | */ |
75 | int | 75 | int |
76 | GNUNET_CRYPTO_kdf (void *result, size_t out_len, | 76 | GNUNET_CRYPTO_kdf (void *result, size_t out_len, |
77 | const void *xts, size_t xts_len, const void *skm, | 77 | const void *xts, size_t xts_len, const void *skm, |
78 | size_t skm_len, ...) | 78 | size_t skm_len, ...) |
79 | { | 79 | { |
80 | va_list argp; | 80 | va_list argp; |
81 | int ret; | 81 | int ret; |
82 | 82 | ||
83 | va_start(argp, skm_len); | 83 | va_start (argp, skm_len); |
84 | ret = GNUNET_CRYPTO_kdf_v (result, out_len, xts, xts_len, skm, skm_len, argp); | 84 | ret = GNUNET_CRYPTO_kdf_v (result, out_len, xts, xts_len, skm, skm_len, argp); |
85 | va_end(argp); | 85 | va_end (argp); |
86 | 86 | ||
87 | return ret; | 87 | return ret; |
88 | } | 88 | } |