diff options
author | Christian Grothoff <grothoff@gnunet.org> | 2023-10-20 23:13:09 +0200 |
---|---|---|
committer | Christian Grothoff <grothoff@gnunet.org> | 2023-10-27 20:08:35 +0200 |
commit | 7278ae87e0d5de5fa31e076581a69d62f3d1fe65 (patch) | |
tree | 6072e2909226acca4dc32d1557c0e66f97e8201c /src/include/gnunet_crypto_lib.h | |
parent | d2e4ba93f679d4845c4bca883e53eae053c99e38 (diff) | |
download | gnunet-7278ae87e0d5de5fa31e076581a69d62f3d1fe65.tar.gz gnunet-7278ae87e0d5de5fa31e076581a69d62f3d1fe65.zip |
more work on new blind signature API and implementation
Diffstat (limited to 'src/include/gnunet_crypto_lib.h')
-rw-r--r-- | src/include/gnunet_crypto_lib.h | 56 |
1 files changed, 49 insertions, 7 deletions
diff --git a/src/include/gnunet_crypto_lib.h b/src/include/gnunet_crypto_lib.h index 11bd680e7..31472f7a1 100644 --- a/src/include/gnunet_crypto_lib.h +++ b/src/include/gnunet_crypto_lib.h | |||
@@ -3557,6 +3557,27 @@ GNUNET_CRYPTO_blinded_sig_decref ( | |||
3557 | 3557 | ||
3558 | 3558 | ||
3559 | /** | 3559 | /** |
3560 | * Decrement reference counter of a @a bm, and free it if it reaches zero. | ||
3561 | * | ||
3562 | * @param[in] bm blinded message to free | ||
3563 | */ | ||
3564 | void | ||
3565 | GNUNET_CRYPTO_blinded_message_decref ( | ||
3566 | struct GNUNET_CRYPTO_BlindedMessage *bm); | ||
3567 | |||
3568 | |||
3569 | /** | ||
3570 | * Increment reference counter of the given @a bm. | ||
3571 | * | ||
3572 | * @param[in,out] bm blinded message to increment reference counter for | ||
3573 | * @return alias of @a bm with RC incremented | ||
3574 | */ | ||
3575 | struct GNUNET_CRYPTO_BlindedMessage * | ||
3576 | GNUNET_CRYPTO_blinded_message_incref ( | ||
3577 | struct GNUNET_CRYPTO_BlindedMessage *bm); | ||
3578 | |||
3579 | |||
3580 | /** | ||
3560 | * Increment reference counter of the given @a bsign_pub. | 3581 | * Increment reference counter of the given @a bsign_pub. |
3561 | * | 3582 | * |
3562 | * @param[in,out] bsign_pub public key to increment reference counter for | 3583 | * @param[in,out] bsign_pub public key to increment reference counter for |
@@ -3630,7 +3651,7 @@ GNUNET_CRYPTO_ub_sig_cmp (const struct GNUNET_CRYPTO_UnblindedSignature *sig1, | |||
3630 | * @return 0 if the keys are equal, otherwise -1 or 1 | 3651 | * @return 0 if the keys are equal, otherwise -1 or 1 |
3631 | */ | 3652 | */ |
3632 | int | 3653 | int |
3633 | GNUNET_blind_sig_cmp ( | 3654 | GNUNET_CRYPTO_blind_sig_cmp ( |
3634 | const struct GNUNET_CRYPTO_BlindedSignature *sig1, | 3655 | const struct GNUNET_CRYPTO_BlindedSignature *sig1, |
3635 | const struct GNUNET_CRYPTO_BlindedSignature *sig2); | 3656 | const struct GNUNET_CRYPTO_BlindedSignature *sig2); |
3636 | 3657 | ||
@@ -3655,27 +3676,48 @@ GNUNET_CRYPTO_blinded_message_cmp ( | |||
3655 | * argument with the number of bits for 'n' (e.g. 2048) must | 3676 | * argument with the number of bits for 'n' (e.g. 2048) must |
3656 | * be passed. | 3677 | * be passed. |
3657 | * | 3678 | * |
3658 | * @param[out] denom_priv where to write the private key with RC 1 | 3679 | * @param[out] bsign_priv where to write the private key with RC 1 |
3659 | * @param[out] denom_pub where to write the public key with RC 1 | 3680 | * @param[out] bsign_pub where to write the public key with RC 1 |
3660 | * @param cipher which type of cipher to use | 3681 | * @param cipher which type of cipher to use |
3661 | * @param ... RSA key size (eg. 2048/3072/4096) | 3682 | * @param ... RSA key size (eg. 2048/3072/4096) |
3662 | * @return #GNUNET_OK on success, #GNUNET_NO if parameters were invalid | 3683 | * @return #GNUNET_OK on success, #GNUNET_NO if parameterst were invalid |
3663 | */ | 3684 | */ |
3664 | enum GNUNET_GenericReturnValue | 3685 | enum GNUNET_GenericReturnValue |
3665 | GNUNET_CRYPTO_blind_sign_keys_create ( | 3686 | GNUNET_CRYPTO_blind_sign_keys_create ( |
3666 | struct GNUNET_CRYPTO_BlindSignPrivateKey **denom_priv, | 3687 | struct GNUNET_CRYPTO_BlindSignPrivateKey **bsign_priv, |
3667 | struct GNUNET_CRYPTO_BlindSignPublicKey **denom_pub, | 3688 | struct GNUNET_CRYPTO_BlindSignPublicKey **bsign_pub, |
3668 | enum GNUNET_CRYPTO_BlindSignatureAlgorithm cipher, | 3689 | enum GNUNET_CRYPTO_BlindSignatureAlgorithm cipher, |
3669 | ...); | 3690 | ...); |
3670 | 3691 | ||
3671 | 3692 | ||
3672 | /** | 3693 | /** |
3694 | * Initialize public-private key pair for blind signatures. | ||
3695 | * | ||
3696 | * For #GNUNET_CRYPTO_BSA_RSA, an additional "unsigned int" | ||
3697 | * argument with the number of bits for 'n' (e.g. 2048) must | ||
3698 | * be passed. | ||
3699 | * | ||
3700 | * @param[out] bsign_priv where to write the private key with RC 1 | ||
3701 | * @param[out] bsign_pub where to write the public key with RC 1 | ||
3702 | * @param cipher which type of cipher to use | ||
3703 | * @param ap RSA key size (eg. 2048/3072/4096) | ||
3704 | * @return #GNUNET_OK on success, #GNUNET_NO if parameterst were invalid | ||
3705 | */ | ||
3706 | enum GNUNET_GenericReturnValue | ||
3707 | GNUNET_CRYPTO_blind_sign_keys_create_va ( | ||
3708 | struct GNUNET_CRYPTO_BlindSignPrivateKey **bsign_priv, | ||
3709 | struct GNUNET_CRYPTO_BlindSignPublicKey **bsign_pub, | ||
3710 | enum GNUNET_CRYPTO_BlindSignatureAlgorithm cipher, | ||
3711 | va_list ap); | ||
3712 | |||
3713 | |||
3714 | /** | ||
3673 | * @brief Type of blinding secrets. Must be exactly 32 bytes (DB). | 3715 | * @brief Type of blinding secrets. Must be exactly 32 bytes (DB). |
3674 | */ | 3716 | */ |
3675 | union GNUNET_CRYPTO_BlindingSecretP | 3717 | union GNUNET_CRYPTO_BlindingSecretP |
3676 | { | 3718 | { |
3677 | /** | 3719 | /** |
3678 | * Clause Schnorr nonce. | 3720 | * Clause Schnorr nonce. |
3679 | */ | 3721 | */ |
3680 | struct GNUNET_CRYPTO_CsBlindingNonce nonce; | 3722 | struct GNUNET_CRYPTO_CsBlindingNonce nonce; |
3681 | 3723 | ||