diff options
author | Martin Schanzenbach <schanzen@gnunet.org> | 2020-11-10 19:44:32 +0900 |
---|---|---|
committer | Martin Schanzenbach <schanzen@gnunet.org> | 2020-11-10 19:44:32 +0900 |
commit | 82b5c638583860897fac1cab3dc1ebd2bed10949 (patch) | |
tree | 48c23cc69e11d71f463750b12f3465b31e5e0050 /src/include/gnunet_identity_service.h | |
parent | 10081ef560ef3e624d4dcadf5e19f0330b078d64 (diff) | |
download | gnunet-82b5c638583860897fac1cab3dc1ebd2bed10949.tar.gz gnunet-82b5c638583860897fac1cab3dc1ebd2bed10949.zip |
-minor API change
Diffstat (limited to 'src/include/gnunet_identity_service.h')
-rw-r--r-- | src/include/gnunet_identity_service.h | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/src/include/gnunet_identity_service.h b/src/include/gnunet_identity_service.h index 0174e52aa..e59cf65af 100644 --- a/src/include/gnunet_identity_service.h +++ b/src/include/gnunet_identity_service.h | |||
@@ -501,7 +501,7 @@ GNUNET_IDENTITY_write_signature_to_buffer (const struct | |||
501 | * The @a purpose data is the beginning of the data of which the signature is | 501 | * The @a purpose data is the beginning of the data of which the signature is |
502 | * to be created. The `size` field in @a purpose must correctly indicate the | 502 | * to be created. The `size` field in @a purpose must correctly indicate the |
503 | * number of bytes of the data structure, including its header. If possible, | 503 | * number of bytes of the data structure, including its header. If possible, |
504 | * use #GNUNET_IDENTITY_private_key_sign() instead of this function. | 504 | * use #GNUNET_IDENTITY_sign() instead of this function. |
505 | * | 505 | * |
506 | * @param priv private key to use for the signing | 506 | * @param priv private key to use for the signing |
507 | * @param purpose what to sign (size, purpose) | 507 | * @param purpose what to sign (size, purpose) |
@@ -509,7 +509,7 @@ GNUNET_IDENTITY_write_signature_to_buffer (const struct | |||
509 | * @return #GNUNET_SYSERR on error, #GNUNET_OK on success | 509 | * @return #GNUNET_SYSERR on error, #GNUNET_OK on success |
510 | */ | 510 | */ |
511 | int | 511 | int |
512 | GNUNET_IDENTITY_private_key_sign_ (const struct | 512 | GNUNET_IDENTITY_sign_ (const struct |
513 | GNUNET_IDENTITY_PrivateKey *priv, | 513 | GNUNET_IDENTITY_PrivateKey *priv, |
514 | const struct | 514 | const struct |
515 | GNUNET_CRYPTO_EccSignaturePurpose *purpose, | 515 | GNUNET_CRYPTO_EccSignaturePurpose *purpose, |
@@ -527,7 +527,7 @@ GNUNET_IDENTITY_private_key_sign_ (const struct | |||
527 | * @param ps packed struct with what to sign, MUST begin with a purpose | 527 | * @param ps packed struct with what to sign, MUST begin with a purpose |
528 | * @param[out] sig where to write the signature | 528 | * @param[out] sig where to write the signature |
529 | */ | 529 | */ |
530 | #define GNUNET_IDENTITY_private_key_sign(priv,ps,sig) do { \ | 530 | #define GNUNET_IDENTITY_sign(priv,ps,sig) do { \ |
531 | /* check size is set correctly */ \ | 531 | /* check size is set correctly */ \ |
532 | GNUNET_assert (ntohl ((ps)->purpose.size) == sizeof (*(ps))); \ | 532 | GNUNET_assert (ntohl ((ps)->purpose.size) == sizeof (*(ps))); \ |
533 | /* check 'ps' begins with the purpose */ \ | 533 | /* check 'ps' begins with the purpose */ \ |
@@ -548,7 +548,7 @@ GNUNET_IDENTITY_private_key_sign_ (const struct | |||
548 | * the number of bytes of the data structure, including its header. If @a | 548 | * the number of bytes of the data structure, including its header. If @a |
549 | * purpose does not match the purpose given in @a validate (the latter must be | 549 | * purpose does not match the purpose given in @a validate (the latter must be |
550 | * in big endian), signature verification fails. If possible, | 550 | * in big endian), signature verification fails. If possible, |
551 | * use #GNUNET_IDENTITY_public_key_verify() instead of this function (only if @a validate | 551 | * use #GNUNET_IDENTITY_signature_verify() instead of this function (only if @a validate |
552 | * is not fixed-size, you must use this function directly). | 552 | * is not fixed-size, you must use this function directly). |
553 | * | 553 | * |
554 | * @param purpose what is the purpose that the signature should have? | 554 | * @param purpose what is the purpose that the signature should have? |
@@ -558,12 +558,12 @@ GNUNET_IDENTITY_private_key_sign_ (const struct | |||
558 | * @returns #GNUNET_OK if ok, #GNUNET_SYSERR if invalid | 558 | * @returns #GNUNET_OK if ok, #GNUNET_SYSERR if invalid |
559 | */ | 559 | */ |
560 | int | 560 | int |
561 | GNUNET_IDENTITY_public_key_verify_ (uint32_t purpose, | 561 | GNUNET_IDENTITY_signature_verify_ (uint32_t purpose, |
562 | const struct | 562 | const struct |
563 | GNUNET_CRYPTO_EccSignaturePurpose *validate, | 563 | GNUNET_CRYPTO_EccSignaturePurpose *validate, |
564 | const struct GNUNET_IDENTITY_Signature *sig, | 564 | const struct GNUNET_IDENTITY_Signature *sig, |
565 | const struct | 565 | const struct |
566 | GNUNET_IDENTITY_PublicKey *pub); | 566 | GNUNET_IDENTITY_PublicKey *pub); |
567 | 567 | ||
568 | 568 | ||
569 | /** | 569 | /** |
@@ -579,7 +579,7 @@ GNUNET_IDENTITY_public_key_verify_ (uint32_t purpose, | |||
579 | * @param sig where to read the signature from | 579 | * @param sig where to read the signature from |
580 | * @param pub public key to use for the verifying | 580 | * @param pub public key to use for the verifying |
581 | */ | 581 | */ |
582 | #define GNUNET_IDENTITY_public_key_verify(purp,ps,sig,pub) ({ \ | 582 | #define GNUNET_IDENTITY_signature_verify(purp,ps,sig,pub) ({ \ |
583 | /* check size is set correctly */ \ | 583 | /* check size is set correctly */ \ |
584 | GNUNET_assert (ntohl ((ps)->purpose.size) == sizeof (*(ps))); \ | 584 | GNUNET_assert (ntohl ((ps)->purpose.size) == sizeof (*(ps))); \ |
585 | /* check 'ps' begins with the purpose */ \ | 585 | /* check 'ps' begins with the purpose */ \ |
@@ -608,11 +608,11 @@ GNUNET_IDENTITY_public_key_verify_ (uint32_t purpose, | |||
608 | * this size should be the same as @c len. | 608 | * this size should be the same as @c len. |
609 | */ | 609 | */ |
610 | ssize_t | 610 | ssize_t |
611 | GNUNET_IDENTITY_public_key_encrypt (const void *block, | 611 | GNUNET_IDENTITY_encrypt (const void *block, |
612 | size_t size, | 612 | size_t size, |
613 | const struct GNUNET_IDENTITY_PublicKey *pub, | 613 | const struct GNUNET_IDENTITY_PublicKey *pub, |
614 | struct GNUNET_CRYPTO_EcdhePublicKey *ecc, | 614 | struct GNUNET_CRYPTO_EcdhePublicKey *ecc, |
615 | void *result); | 615 | void *result); |
616 | 616 | ||
617 | 617 | ||
618 | /** | 618 | /** |
@@ -630,13 +630,13 @@ GNUNET_IDENTITY_public_key_encrypt (const void *block, | |||
630 | * this size should be the same as @c size. | 630 | * this size should be the same as @c size. |
631 | */ | 631 | */ |
632 | ssize_t | 632 | ssize_t |
633 | GNUNET_IDENTITY_private_key_decrypt (const void *block, | 633 | GNUNET_IDENTITY_decrypt (const void *block, |
634 | size_t size, | 634 | size_t size, |
635 | const struct | 635 | const struct |
636 | GNUNET_IDENTITY_PrivateKey *priv, | 636 | GNUNET_IDENTITY_PrivateKey *priv, |
637 | const struct | 637 | const struct |
638 | GNUNET_CRYPTO_EcdhePublicKey *ecc, | 638 | GNUNET_CRYPTO_EcdhePublicKey *ecc, |
639 | void *result); | 639 | void *result); |
640 | 640 | ||
641 | 641 | ||
642 | /** | 642 | /** |