aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_crypto_lib.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/gnunet_crypto_lib.h')
-rw-r--r--src/include/gnunet_crypto_lib.h34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/include/gnunet_crypto_lib.h b/src/include/gnunet_crypto_lib.h
index b8e38a2a2..1d000c29a 100644
--- a/src/include/gnunet_crypto_lib.h
+++ b/src/include/gnunet_crypto_lib.h
@@ -209,7 +209,7 @@ struct GNUNET_CRYPTO_EccPrivateKey
209/** 209/**
210 * @brief type for session keys 210 * @brief type for session keys
211 */ 211 */
212struct GNUNET_CRYPTO_AesSessionKey 212struct GNUNET_CRYPTO_SymmetricSessionKey
213{ 213{
214 /** 214 /**
215 * Actual key for AES. 215 * Actual key for AES.
@@ -231,7 +231,7 @@ GNUNET_NETWORK_STRUCT_END
231 * NOTE: must be smaller (!) in size than the 231 * NOTE: must be smaller (!) in size than the
232 * `struct GNUNET_HashCode`. 232 * `struct GNUNET_HashCode`.
233 */ 233 */
234struct GNUNET_CRYPTO_AesInitializationVector 234struct GNUNET_CRYPTO_SymmetricInitializationVector
235{ 235{
236 unsigned char aes_iv[GNUNET_CRYPTO_AES_KEY_LENGTH / 2]; 236 unsigned char aes_iv[GNUNET_CRYPTO_AES_KEY_LENGTH / 2];
237 237
@@ -352,7 +352,7 @@ GNUNET_CRYPTO_random_permute (enum GNUNET_CRYPTO_Quality mode, unsigned int n);
352 * @param key key to initialize 352 * @param key key to initialize
353 */ 353 */
354void 354void
355GNUNET_CRYPTO_aes_create_session_key (struct GNUNET_CRYPTO_AesSessionKey *key); 355GNUNET_CRYPTO_symmetric_create_session_key (struct GNUNET_CRYPTO_SymmetricSessionKey *key);
356 356
357 357
358/** 358/**
@@ -367,9 +367,9 @@ GNUNET_CRYPTO_aes_create_session_key (struct GNUNET_CRYPTO_AesSessionKey *key);
367 * @return the size of the encrypted block, -1 for errors 367 * @return the size of the encrypted block, -1 for errors
368 */ 368 */
369ssize_t 369ssize_t
370GNUNET_CRYPTO_aes_encrypt (const void *block, size_t len, 370GNUNET_CRYPTO_symmetric_encrypt (const void *block, size_t len,
371 const struct GNUNET_CRYPTO_AesSessionKey *sessionkey, 371 const struct GNUNET_CRYPTO_SymmetricSessionKey *sessionkey,
372 const struct GNUNET_CRYPTO_AesInitializationVector 372 const struct GNUNET_CRYPTO_SymmetricInitializationVector
373 *iv, void *result); 373 *iv, void *result);
374 374
375 375
@@ -385,9 +385,9 @@ GNUNET_CRYPTO_aes_encrypt (const void *block, size_t len,
385 * @return -1 on failure, size of decrypted block on success 385 * @return -1 on failure, size of decrypted block on success
386 */ 386 */
387ssize_t 387ssize_t
388GNUNET_CRYPTO_aes_decrypt (const void *block, size_t size, 388GNUNET_CRYPTO_symmetric_decrypt (const void *block, size_t size,
389 const struct GNUNET_CRYPTO_AesSessionKey *sessionkey, 389 const struct GNUNET_CRYPTO_SymmetricSessionKey *sessionkey,
390 const struct GNUNET_CRYPTO_AesInitializationVector 390 const struct GNUNET_CRYPTO_SymmetricInitializationVector
391 *iv, void *result); 391 *iv, void *result);
392 392
393 393
@@ -401,8 +401,8 @@ GNUNET_CRYPTO_aes_decrypt (const void *block, size_t size,
401 * @param ... pairs of void * & size_t for context chunks, terminated by NULL 401 * @param ... pairs of void * & size_t for context chunks, terminated by NULL
402 */ 402 */
403void 403void
404GNUNET_CRYPTO_aes_derive_iv (struct GNUNET_CRYPTO_AesInitializationVector *iv, 404GNUNET_CRYPTO_symmetric_derive_iv (struct GNUNET_CRYPTO_SymmetricInitializationVector *iv,
405 const struct GNUNET_CRYPTO_AesSessionKey *skey, 405 const struct GNUNET_CRYPTO_SymmetricSessionKey *skey,
406 const void *salt, size_t salt_len, ...); 406 const void *salt, size_t salt_len, ...);
407 407
408 408
@@ -415,8 +415,8 @@ GNUNET_CRYPTO_aes_derive_iv (struct GNUNET_CRYPTO_AesInitializationVector *iv,
415 * @param argp pairs of void * & size_t for context chunks, terminated by NULL 415 * @param argp pairs of void * & size_t for context chunks, terminated by NULL
416 */ 416 */
417void 417void
418GNUNET_CRYPTO_aes_derive_iv_v (struct GNUNET_CRYPTO_AesInitializationVector *iv, 418GNUNET_CRYPTO_symmetric_derive_iv_v (struct GNUNET_CRYPTO_SymmetricInitializationVector *iv,
419 const struct GNUNET_CRYPTO_AesSessionKey *skey, 419 const struct GNUNET_CRYPTO_SymmetricSessionKey *skey,
420 const void *salt, size_t salt_len, va_list argp); 420 const void *salt, size_t salt_len, va_list argp);
421 421
422 422
@@ -610,8 +610,8 @@ GNUNET_CRYPTO_hash_xor (const struct GNUNET_HashCode * a, const struct GNUNET_Ha
610 */ 610 */
611void 611void
612GNUNET_CRYPTO_hash_to_aes_key (const struct GNUNET_HashCode * hc, 612GNUNET_CRYPTO_hash_to_aes_key (const struct GNUNET_HashCode * hc,
613 struct GNUNET_CRYPTO_AesSessionKey *skey, 613 struct GNUNET_CRYPTO_SymmetricSessionKey *skey,
614 struct GNUNET_CRYPTO_AesInitializationVector 614 struct GNUNET_CRYPTO_SymmetricInitializationVector
615 *iv); 615 *iv);
616 616
617 617
@@ -685,7 +685,7 @@ GNUNET_CRYPTO_hash_xorcmp (const struct GNUNET_HashCode * h1,
685 */ 685 */
686void 686void
687GNUNET_CRYPTO_hmac_derive_key_v (struct GNUNET_CRYPTO_AuthKey *key, 687GNUNET_CRYPTO_hmac_derive_key_v (struct GNUNET_CRYPTO_AuthKey *key,
688 const struct GNUNET_CRYPTO_AesSessionKey *rkey, 688 const struct GNUNET_CRYPTO_SymmetricSessionKey *rkey,
689 const void *salt, size_t salt_len, 689 const void *salt, size_t salt_len,
690 va_list argp); 690 va_list argp);
691 691
@@ -701,7 +701,7 @@ GNUNET_CRYPTO_hmac_derive_key_v (struct GNUNET_CRYPTO_AuthKey *key,
701 */ 701 */
702void 702void
703GNUNET_CRYPTO_hmac_derive_key (struct GNUNET_CRYPTO_AuthKey *key, 703GNUNET_CRYPTO_hmac_derive_key (struct GNUNET_CRYPTO_AuthKey *key,
704 const struct GNUNET_CRYPTO_AesSessionKey *rkey, 704 const struct GNUNET_CRYPTO_SymmetricSessionKey *rkey,
705 const void *salt, size_t salt_len, ...); 705 const void *salt, size_t salt_len, ...);
706 706
707 707