diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-09-30 11:32:30 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-09-30 11:32:30 +0000 |
commit | 45b5c1f11144bc14fae34c991ae9db89d6ba8913 (patch) | |
tree | f4a2fbe70573e0d9bb56d4ccb8be29fcf0c50c55 /src/core | |
parent | 05ef63d9f8cf65561b7ed2234efdc80e3fb40bd0 (diff) | |
download | gnunet-45b5c1f11144bc14fae34c991ae9db89d6ba8913.tar.gz gnunet-45b5c1f11144bc14fae34c991ae9db89d6ba8913.zip |
-rename files/symbols from _aes to _symmetric
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/gnunet-service-core_kx.c | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/src/core/gnunet-service-core_kx.c b/src/core/gnunet-service-core_kx.c index bf5e9a5fa..675ac83a6 100644 --- a/src/core/gnunet-service-core_kx.c +++ b/src/core/gnunet-service-core_kx.c | |||
@@ -311,13 +311,13 @@ struct GSC_KeyExchangeInfo | |||
311 | * Key we use to encrypt our messages for the other peer | 311 | * Key we use to encrypt our messages for the other peer |
312 | * (initialized by us when we do the handshake). | 312 | * (initialized by us when we do the handshake). |
313 | */ | 313 | */ |
314 | struct GNUNET_CRYPTO_AesSessionKey encrypt_key; | 314 | struct GNUNET_CRYPTO_SymmetricSessionKey encrypt_key; |
315 | 315 | ||
316 | /** | 316 | /** |
317 | * Key we use to decrypt messages from the other peer | 317 | * Key we use to decrypt messages from the other peer |
318 | * (given to us by the other peer during the handshake). | 318 | * (given to us by the other peer during the handshake). |
319 | */ | 319 | */ |
320 | struct GNUNET_CRYPTO_AesSessionKey decrypt_key; | 320 | struct GNUNET_CRYPTO_SymmetricSessionKey decrypt_key; |
321 | 321 | ||
322 | /** | 322 | /** |
323 | * At what time did the other peer generate the decryption key? | 323 | * At what time did the other peer generate the decryption key? |
@@ -425,13 +425,13 @@ static GNUNET_SCHEDULER_TaskIdentifier rekey_task; | |||
425 | */ | 425 | */ |
426 | static void | 426 | static void |
427 | derive_auth_key (struct GNUNET_CRYPTO_AuthKey *akey, | 427 | derive_auth_key (struct GNUNET_CRYPTO_AuthKey *akey, |
428 | const struct GNUNET_CRYPTO_AesSessionKey *skey, uint32_t seed) | 428 | const struct GNUNET_CRYPTO_SymmetricSessionKey *skey, uint32_t seed) |
429 | { | 429 | { |
430 | static const char ctx[] = "authentication key"; | 430 | static const char ctx[] = "authentication key"; |
431 | 431 | ||
432 | GNUNET_CRYPTO_hmac_derive_key (akey, skey, | 432 | GNUNET_CRYPTO_hmac_derive_key (akey, skey, |
433 | &seed, sizeof (seed), | 433 | &seed, sizeof (seed), |
434 | skey, sizeof (struct GNUNET_CRYPTO_AesSessionKey), | 434 | skey, sizeof (struct GNUNET_CRYPTO_SymmetricSessionKey), |
435 | ctx, sizeof (ctx), | 435 | ctx, sizeof (ctx), |
436 | NULL); | 436 | NULL); |
437 | } | 437 | } |
@@ -446,13 +446,13 @@ derive_auth_key (struct GNUNET_CRYPTO_AuthKey *akey, | |||
446 | * @param identity identity of the other peer to use | 446 | * @param identity identity of the other peer to use |
447 | */ | 447 | */ |
448 | static void | 448 | static void |
449 | derive_iv (struct GNUNET_CRYPTO_AesInitializationVector *iv, | 449 | derive_iv (struct GNUNET_CRYPTO_SymmetricInitializationVector *iv, |
450 | const struct GNUNET_CRYPTO_AesSessionKey *skey, uint32_t seed, | 450 | const struct GNUNET_CRYPTO_SymmetricSessionKey *skey, uint32_t seed, |
451 | const struct GNUNET_PeerIdentity *identity) | 451 | const struct GNUNET_PeerIdentity *identity) |
452 | { | 452 | { |
453 | static const char ctx[] = "initialization vector"; | 453 | static const char ctx[] = "initialization vector"; |
454 | 454 | ||
455 | GNUNET_CRYPTO_aes_derive_iv (iv, skey, &seed, sizeof (seed), | 455 | GNUNET_CRYPTO_symmetric_derive_iv (iv, skey, &seed, sizeof (seed), |
456 | &identity->hashPubKey.bits, | 456 | &identity->hashPubKey.bits, |
457 | sizeof (identity->hashPubKey.bits), ctx, | 457 | sizeof (identity->hashPubKey.bits), ctx, |
458 | sizeof (ctx), NULL); | 458 | sizeof (ctx), NULL); |
@@ -469,13 +469,13 @@ derive_iv (struct GNUNET_CRYPTO_AesInitializationVector *iv, | |||
469 | * @param identity identity of the other peer to use | 469 | * @param identity identity of the other peer to use |
470 | */ | 470 | */ |
471 | static void | 471 | static void |
472 | derive_pong_iv (struct GNUNET_CRYPTO_AesInitializationVector *iv, | 472 | derive_pong_iv (struct GNUNET_CRYPTO_SymmetricInitializationVector *iv, |
473 | const struct GNUNET_CRYPTO_AesSessionKey *skey, uint32_t seed, | 473 | const struct GNUNET_CRYPTO_SymmetricSessionKey *skey, uint32_t seed, |
474 | uint32_t challenge, const struct GNUNET_PeerIdentity *identity) | 474 | uint32_t challenge, const struct GNUNET_PeerIdentity *identity) |
475 | { | 475 | { |
476 | static const char ctx[] = "pong initialization vector"; | 476 | static const char ctx[] = "pong initialization vector"; |
477 | 477 | ||
478 | GNUNET_CRYPTO_aes_derive_iv (iv, skey, &seed, sizeof (seed), | 478 | GNUNET_CRYPTO_symmetric_derive_iv (iv, skey, &seed, sizeof (seed), |
479 | &identity->hashPubKey.bits, | 479 | &identity->hashPubKey.bits, |
480 | sizeof (identity->hashPubKey.bits), &challenge, | 480 | sizeof (identity->hashPubKey.bits), &challenge, |
481 | sizeof (challenge), ctx, sizeof (ctx), NULL); | 481 | sizeof (challenge), ctx, sizeof (ctx), NULL); |
@@ -494,11 +494,11 @@ static void | |||
494 | derive_aes_key (const struct GNUNET_PeerIdentity *sender, | 494 | derive_aes_key (const struct GNUNET_PeerIdentity *sender, |
495 | const struct GNUNET_PeerIdentity *receiver, | 495 | const struct GNUNET_PeerIdentity *receiver, |
496 | const struct GNUNET_HashCode *key_material, | 496 | const struct GNUNET_HashCode *key_material, |
497 | struct GNUNET_CRYPTO_AesSessionKey *skey) | 497 | struct GNUNET_CRYPTO_SymmetricSessionKey *skey) |
498 | { | 498 | { |
499 | static const char ctx[] = "aes key generation vector"; | 499 | static const char ctx[] = "aes key generation vector"; |
500 | 500 | ||
501 | GNUNET_CRYPTO_kdf (skey, sizeof (struct GNUNET_CRYPTO_AesSessionKey), | 501 | GNUNET_CRYPTO_kdf (skey, sizeof (struct GNUNET_CRYPTO_SymmetricSessionKey), |
502 | ctx, sizeof (ctx), | 502 | ctx, sizeof (ctx), |
503 | key_material, sizeof (struct GNUNET_HashCode), | 503 | key_material, sizeof (struct GNUNET_HashCode), |
504 | sender, sizeof (struct GNUNET_PeerIdentity), | 504 | sender, sizeof (struct GNUNET_PeerIdentity), |
@@ -520,7 +520,7 @@ derive_aes_key (const struct GNUNET_PeerIdentity *sender, | |||
520 | */ | 520 | */ |
521 | static int | 521 | static int |
522 | do_encrypt (struct GSC_KeyExchangeInfo *kx, | 522 | do_encrypt (struct GSC_KeyExchangeInfo *kx, |
523 | const struct GNUNET_CRYPTO_AesInitializationVector *iv, | 523 | const struct GNUNET_CRYPTO_SymmetricInitializationVector *iv, |
524 | const void *in, void *out, size_t size) | 524 | const void *in, void *out, size_t size) |
525 | { | 525 | { |
526 | if (size != (uint16_t) size) | 526 | if (size != (uint16_t) size) |
@@ -529,7 +529,7 @@ do_encrypt (struct GSC_KeyExchangeInfo *kx, | |||
529 | return GNUNET_NO; | 529 | return GNUNET_NO; |
530 | } | 530 | } |
531 | GNUNET_assert (size == | 531 | GNUNET_assert (size == |
532 | GNUNET_CRYPTO_aes_encrypt (in, (uint16_t) size, | 532 | GNUNET_CRYPTO_symmetric_encrypt (in, (uint16_t) size, |
533 | &kx->encrypt_key, iv, out)); | 533 | &kx->encrypt_key, iv, out)); |
534 | GNUNET_STATISTICS_update (GSC_stats, gettext_noop ("# bytes encrypted"), size, | 534 | GNUNET_STATISTICS_update (GSC_stats, gettext_noop ("# bytes encrypted"), size, |
535 | GNUNET_NO); | 535 | GNUNET_NO); |
@@ -561,7 +561,7 @@ do_encrypt (struct GSC_KeyExchangeInfo *kx, | |||
561 | */ | 561 | */ |
562 | static int | 562 | static int |
563 | do_decrypt (struct GSC_KeyExchangeInfo *kx, | 563 | do_decrypt (struct GSC_KeyExchangeInfo *kx, |
564 | const struct GNUNET_CRYPTO_AesInitializationVector *iv, | 564 | const struct GNUNET_CRYPTO_SymmetricInitializationVector *iv, |
565 | const void *in, void *out, size_t size) | 565 | const void *in, void *out, size_t size) |
566 | { | 566 | { |
567 | if (size != (uint16_t) size) | 567 | if (size != (uint16_t) size) |
@@ -576,7 +576,7 @@ do_decrypt (struct GSC_KeyExchangeInfo *kx, | |||
576 | return GNUNET_SYSERR; | 576 | return GNUNET_SYSERR; |
577 | } | 577 | } |
578 | if (size != | 578 | if (size != |
579 | GNUNET_CRYPTO_aes_decrypt (in, (uint16_t) size, &kx->decrypt_key, iv, | 579 | GNUNET_CRYPTO_symmetric_decrypt (in, (uint16_t) size, &kx->decrypt_key, iv, |
580 | out)) | 580 | out)) |
581 | { | 581 | { |
582 | GNUNET_break (0); | 582 | GNUNET_break (0); |
@@ -635,7 +635,7 @@ setup_fresh_ping (struct GSC_KeyExchangeInfo *kx) | |||
635 | { | 635 | { |
636 | struct PingMessage pp; | 636 | struct PingMessage pp; |
637 | struct PingMessage *pm; | 637 | struct PingMessage *pm; |
638 | struct GNUNET_CRYPTO_AesInitializationVector iv; | 638 | struct GNUNET_CRYPTO_SymmetricInitializationVector iv; |
639 | 639 | ||
640 | pm = &kx->ping; | 640 | pm = &kx->ping; |
641 | pm->header.size = htons (sizeof (struct PingMessage)); | 641 | pm->header.size = htons (sizeof (struct PingMessage)); |
@@ -911,7 +911,7 @@ GSC_KX_handle_ping (struct GSC_KeyExchangeInfo *kx, | |||
911 | struct PingMessage t; | 911 | struct PingMessage t; |
912 | struct PongMessage tx; | 912 | struct PongMessage tx; |
913 | struct PongMessage tp; | 913 | struct PongMessage tp; |
914 | struct GNUNET_CRYPTO_AesInitializationVector iv; | 914 | struct GNUNET_CRYPTO_SymmetricInitializationVector iv; |
915 | uint16_t msize; | 915 | uint16_t msize; |
916 | 916 | ||
917 | msize = ntohs (msg->size); | 917 | msize = ntohs (msg->size); |
@@ -1056,7 +1056,7 @@ GSC_KX_handle_pong (struct GSC_KeyExchangeInfo *kx, | |||
1056 | { | 1056 | { |
1057 | const struct PongMessage *m; | 1057 | const struct PongMessage *m; |
1058 | struct PongMessage t; | 1058 | struct PongMessage t; |
1059 | struct GNUNET_CRYPTO_AesInitializationVector iv; | 1059 | struct GNUNET_CRYPTO_SymmetricInitializationVector iv; |
1060 | uint16_t msize; | 1060 | uint16_t msize; |
1061 | 1061 | ||
1062 | msize = ntohs (msg->size); | 1062 | msize = ntohs (msg->size); |
@@ -1214,7 +1214,7 @@ GSC_KX_encrypt_and_transmit (struct GSC_KeyExchangeInfo *kx, | |||
1214 | char cbuf[used]; /* ciphertext */ | 1214 | char cbuf[used]; /* ciphertext */ |
1215 | struct EncryptedMessage *em; /* encrypted message */ | 1215 | struct EncryptedMessage *em; /* encrypted message */ |
1216 | struct EncryptedMessage *ph; /* plaintext header */ | 1216 | struct EncryptedMessage *ph; /* plaintext header */ |
1217 | struct GNUNET_CRYPTO_AesInitializationVector iv; | 1217 | struct GNUNET_CRYPTO_SymmetricInitializationVector iv; |
1218 | struct GNUNET_CRYPTO_AuthKey auth_key; | 1218 | struct GNUNET_CRYPTO_AuthKey auth_key; |
1219 | 1219 | ||
1220 | ph = (struct EncryptedMessage *) pbuf; | 1220 | ph = (struct EncryptedMessage *) pbuf; |
@@ -1281,7 +1281,7 @@ GSC_KX_handle_encrypted_message (struct GSC_KeyExchangeInfo *kx, | |||
1281 | struct GNUNET_HashCode ph; | 1281 | struct GNUNET_HashCode ph; |
1282 | uint32_t snum; | 1282 | uint32_t snum; |
1283 | struct GNUNET_TIME_Absolute t; | 1283 | struct GNUNET_TIME_Absolute t; |
1284 | struct GNUNET_CRYPTO_AesInitializationVector iv; | 1284 | struct GNUNET_CRYPTO_SymmetricInitializationVector iv; |
1285 | struct GNUNET_CRYPTO_AuthKey auth_key; | 1285 | struct GNUNET_CRYPTO_AuthKey auth_key; |
1286 | struct DeliverMessageContext dmc; | 1286 | struct DeliverMessageContext dmc; |
1287 | uint16_t size = ntohs (msg->size); | 1287 | uint16_t size = ntohs (msg->size); |