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.h60
1 files changed, 30 insertions, 30 deletions
diff --git a/src/include/gnunet_crypto_lib.h b/src/include/gnunet_crypto_lib.h
index 777ddd97e..879b1cae2 100644
--- a/src/include/gnunet_crypto_lib.h
+++ b/src/include/gnunet_crypto_lib.h
@@ -129,7 +129,7 @@ GNUNET_NETWORK_STRUCT_END
129 129
130 130
131/** 131/**
132 * @brief 0-terminated ASCII encoding of a GNUNET_HashCode. 132 * @brief 0-terminated ASCII encoding of a struct GNUNET_HashCode.
133 */ 133 */
134struct GNUNET_CRYPTO_HashAsciiEncoded 134struct GNUNET_CRYPTO_HashAsciiEncoded
135{ 135{
@@ -251,7 +251,7 @@ GNUNET_NETWORK_STRUCT_END
251 * @brief IV for sym cipher 251 * @brief IV for sym cipher
252 * 252 *
253 * NOTE: must be smaller (!) in size than the 253 * NOTE: must be smaller (!) in size than the
254 * GNUNET_HashCode. 254 * struct GNUNET_HashCode.
255 */ 255 */
256struct GNUNET_CRYPTO_AesInitializationVector 256struct GNUNET_CRYPTO_AesInitializationVector
257{ 257{
@@ -448,7 +448,7 @@ GNUNET_CRYPTO_aes_derive_iv_v (struct GNUNET_CRYPTO_AesInitializationVector *iv,
448 * safely cast to char*, a '\\0' termination is set). 448 * safely cast to char*, a '\\0' termination is set).
449 */ 449 */
450void 450void
451GNUNET_CRYPTO_hash_to_enc (const GNUNET_HashCode * block, 451GNUNET_CRYPTO_hash_to_enc (const struct GNUNET_HashCode * block,
452 struct GNUNET_CRYPTO_HashAsciiEncoded *result); 452 struct GNUNET_CRYPTO_HashAsciiEncoded *result);
453 453
454 454
@@ -465,7 +465,7 @@ GNUNET_CRYPTO_short_hash_to_enc (const struct GNUNET_CRYPTO_ShortHashCode * bloc
465 465
466 466
467/** 467/**
468 * Convert ASCII encoding back to a 'GNUNET_HashCode' 468 * Convert ASCII encoding back to a 'struct GNUNET_HashCode'
469 * 469 *
470 * @param enc the encoding 470 * @param enc the encoding
471 * @param enclen number of characters in 'enc' (without 0-terminator, which can be missing) 471 * @param enclen number of characters in 'enc' (without 0-terminator, which can be missing)
@@ -474,7 +474,7 @@ GNUNET_CRYPTO_short_hash_to_enc (const struct GNUNET_CRYPTO_ShortHashCode * bloc
474 */ 474 */
475int 475int
476GNUNET_CRYPTO_hash_from_string2 (const char *enc, size_t enclen, 476GNUNET_CRYPTO_hash_from_string2 (const char *enc, size_t enclen,
477 GNUNET_HashCode * result); 477 struct GNUNET_HashCode * result);
478 478
479 479
480/** 480/**
@@ -491,7 +491,7 @@ GNUNET_CRYPTO_short_hash_from_string2 (const char *enc, size_t enclen,
491 491
492 492
493/** 493/**
494 * Convert ASCII encoding back to GNUNET_HashCode 494 * Convert ASCII encoding back to struct GNUNET_HashCode
495 * 495 *
496 * @param enc the encoding 496 * @param enc the encoding
497 * @param result where to store the hash code 497 * @param result where to store the hash code
@@ -536,8 +536,8 @@ GNUNET_CRYPTO_short_hash_cmp (const struct GNUNET_CRYPTO_ShortHashCode * h1,
536 * @return number between 0 and UINT32_MAX 536 * @return number between 0 and UINT32_MAX
537 */ 537 */
538uint32_t 538uint32_t
539GNUNET_CRYPTO_hash_distance_u32 (const GNUNET_HashCode * a, 539GNUNET_CRYPTO_hash_distance_u32 (const struct GNUNET_HashCode * a,
540 const GNUNET_HashCode * b); 540 const struct GNUNET_HashCode * b);
541 541
542 542
543/** 543/**
@@ -548,7 +548,7 @@ GNUNET_CRYPTO_hash_distance_u32 (const GNUNET_HashCode * a,
548 * @param ret pointer to where to write the hashcode 548 * @param ret pointer to where to write the hashcode
549 */ 549 */
550void 550void
551GNUNET_CRYPTO_hash (const void *block, size_t size, GNUNET_HashCode * ret); 551GNUNET_CRYPTO_hash (const void *block, size_t size, struct GNUNET_HashCode * ret);
552 552
553 553
554/** 554/**
@@ -598,7 +598,7 @@ GNUNET_CRYPTO_short_hash_from_truncation (const struct GNUNET_HashCode *dh,
598void 598void
599GNUNET_CRYPTO_hmac (const struct GNUNET_CRYPTO_AuthKey *key, 599GNUNET_CRYPTO_hmac (const struct GNUNET_CRYPTO_AuthKey *key,
600 const void *plaintext, size_t plaintext_len, 600 const void *plaintext, size_t plaintext_len,
601 GNUNET_HashCode * hmac); 601 struct GNUNET_HashCode * hmac);
602 602
603 603
604/** 604/**
@@ -609,7 +609,7 @@ GNUNET_CRYPTO_hmac (const struct GNUNET_CRYPTO_AuthKey *key,
609 * @param res resulting hash, NULL on error 609 * @param res resulting hash, NULL on error
610 */ 610 */
611typedef void (*GNUNET_CRYPTO_HashCompletedCallback) (void *cls, 611typedef void (*GNUNET_CRYPTO_HashCompletedCallback) (void *cls,
612 const GNUNET_HashCode * 612 const struct GNUNET_HashCode *
613 res); 613 res);
614 614
615 615
@@ -652,7 +652,7 @@ GNUNET_CRYPTO_hash_file_cancel (struct GNUNET_CRYPTO_FileHashContext *fhc);
652 */ 652 */
653void 653void
654GNUNET_CRYPTO_hash_create_random (enum GNUNET_CRYPTO_Quality mode, 654GNUNET_CRYPTO_hash_create_random (enum GNUNET_CRYPTO_Quality mode,
655 GNUNET_HashCode * result); 655 struct GNUNET_HashCode * result);
656 656
657 657
658/** 658/**
@@ -663,9 +663,9 @@ GNUNET_CRYPTO_hash_create_random (enum GNUNET_CRYPTO_Quality mode,
663 * @param result set to b - a 663 * @param result set to b - a
664 */ 664 */
665void 665void
666GNUNET_CRYPTO_hash_difference (const GNUNET_HashCode * a, 666GNUNET_CRYPTO_hash_difference (const struct GNUNET_HashCode * a,
667 const GNUNET_HashCode * b, 667 const struct GNUNET_HashCode * b,
668 GNUNET_HashCode * result); 668 struct GNUNET_HashCode * result);
669 669
670 670
671/** 671/**
@@ -676,9 +676,9 @@ GNUNET_CRYPTO_hash_difference (const GNUNET_HashCode * a,
676 * @param result set to a + delta 676 * @param result set to a + delta
677 */ 677 */
678void 678void
679GNUNET_CRYPTO_hash_sum (const GNUNET_HashCode * a, 679GNUNET_CRYPTO_hash_sum (const struct GNUNET_HashCode * a,
680 const GNUNET_HashCode * delta, 680 const struct GNUNET_HashCode * delta,
681 GNUNET_HashCode * result); 681 struct GNUNET_HashCode * result);
682 682
683 683
684/** 684/**
@@ -689,8 +689,8 @@ GNUNET_CRYPTO_hash_sum (const GNUNET_HashCode * a,
689 * @param result set to a ^ b 689 * @param result set to a ^ b
690 */ 690 */
691void 691void
692GNUNET_CRYPTO_hash_xor (const GNUNET_HashCode * a, const GNUNET_HashCode * b, 692GNUNET_CRYPTO_hash_xor (const struct GNUNET_HashCode * a, const struct GNUNET_HashCode * b,
693 GNUNET_HashCode * result); 693 struct GNUNET_HashCode * result);
694 694
695 695
696/** 696/**
@@ -701,7 +701,7 @@ GNUNET_CRYPTO_hash_xor (const GNUNET_HashCode * a, const GNUNET_HashCode * b,
701 * @param iv set to a valid initialization vector 701 * @param iv set to a valid initialization vector
702 */ 702 */
703void 703void
704GNUNET_CRYPTO_hash_to_aes_key (const GNUNET_HashCode * hc, 704GNUNET_CRYPTO_hash_to_aes_key (const struct GNUNET_HashCode * hc,
705 struct GNUNET_CRYPTO_AesSessionKey *skey, 705 struct GNUNET_CRYPTO_AesSessionKey *skey,
706 struct GNUNET_CRYPTO_AesInitializationVector 706 struct GNUNET_CRYPTO_AesInitializationVector
707 *iv); 707 *iv);
@@ -715,11 +715,11 @@ GNUNET_CRYPTO_hash_to_aes_key (const GNUNET_HashCode * hc,
715 * @return Bit \a bit from hashcode \a code, -1 for invalid index 715 * @return Bit \a bit from hashcode \a code, -1 for invalid index
716 */ 716 */
717int 717int
718GNUNET_CRYPTO_hash_get_bit (const GNUNET_HashCode * code, unsigned int bit); 718GNUNET_CRYPTO_hash_get_bit (const struct GNUNET_HashCode * code, unsigned int bit);
719 719
720/** 720/**
721 * Determine how many low order bits match in two 721 * Determine how many low order bits match in two
722 * GNUNET_HashCodes. i.e. - 010011 and 011111 share 722 * struct GNUNET_HashCodes. i.e. - 010011 and 011111 share
723 * the first two lowest order bits, and therefore the 723 * the first two lowest order bits, and therefore the
724 * return value is two (NOT XOR distance, nor how many 724 * return value is two (NOT XOR distance, nor how many
725 * bits match absolutely!). 725 * bits match absolutely!).
@@ -730,8 +730,8 @@ GNUNET_CRYPTO_hash_get_bit (const GNUNET_HashCode * code, unsigned int bit);
730 * @return the number of bits that match 730 * @return the number of bits that match
731 */ 731 */
732unsigned int 732unsigned int
733GNUNET_CRYPTO_hash_matching_bits (const GNUNET_HashCode * first, 733GNUNET_CRYPTO_hash_matching_bits (const struct GNUNET_HashCode * first,
734 const GNUNET_HashCode * second); 734 const struct GNUNET_HashCode * second);
735 735
736 736
737/** 737/**
@@ -743,7 +743,7 @@ GNUNET_CRYPTO_hash_matching_bits (const GNUNET_HashCode * first,
743 * @return 1 if h1 > h2, -1 if h1 < h2 and 0 if h1 == h2. 743 * @return 1 if h1 > h2, -1 if h1 < h2 and 0 if h1 == h2.
744 */ 744 */
745int 745int
746GNUNET_CRYPTO_hash_cmp (const GNUNET_HashCode * h1, const GNUNET_HashCode * h2); 746GNUNET_CRYPTO_hash_cmp (const struct GNUNET_HashCode * h1, const struct GNUNET_HashCode * h2);
747 747
748 748
749/** 749/**
@@ -756,9 +756,9 @@ GNUNET_CRYPTO_hash_cmp (const GNUNET_HashCode * h1, const GNUNET_HashCode * h2);
756 * @return -1 if h1 is closer, 1 if h2 is closer and 0 if h1==h2. 756 * @return -1 if h1 is closer, 1 if h2 is closer and 0 if h1==h2.
757 */ 757 */
758int 758int
759GNUNET_CRYPTO_hash_xorcmp (const GNUNET_HashCode * h1, 759GNUNET_CRYPTO_hash_xorcmp (const struct GNUNET_HashCode * h1,
760 const GNUNET_HashCode * h2, 760 const struct GNUNET_HashCode * h2,
761 const GNUNET_HashCode * target); 761 const struct GNUNET_HashCode * target);
762 762
763 763
764/** 764/**
@@ -949,7 +949,7 @@ GNUNET_CRYPTO_setup_hostkey (const char *cfg_name);
949 * @return some private key purely dependent on input 949 * @return some private key purely dependent on input
950 */ 950 */
951struct GNUNET_CRYPTO_RsaPrivateKey * 951struct GNUNET_CRYPTO_RsaPrivateKey *
952GNUNET_CRYPTO_rsa_key_create_from_hash (const GNUNET_HashCode * hc); 952GNUNET_CRYPTO_rsa_key_create_from_hash (const struct GNUNET_HashCode * hc);
953 953
954 954
955/** 955/**