diff options
Diffstat (limited to 'src/include/gnunet_crypto_lib.h')
-rw-r--r-- | src/include/gnunet_crypto_lib.h | 63 |
1 files changed, 47 insertions, 16 deletions
diff --git a/src/include/gnunet_crypto_lib.h b/src/include/gnunet_crypto_lib.h index 31472f7a1..44db5f466 100644 --- a/src/include/gnunet_crypto_lib.h +++ b/src/include/gnunet_crypto_lib.h | |||
@@ -3158,9 +3158,19 @@ struct GNUNET_CRYPTO_CsBlindedMessage | |||
3158 | struct GNUNET_CRYPTO_CsC c[2]; | 3158 | struct GNUNET_CRYPTO_CsC c[2]; |
3159 | 3159 | ||
3160 | /** | 3160 | /** |
3161 | * Public nonce used to generate the R-values. | 3161 | * Nonce used in initial request. |
3162 | */ | 3162 | */ |
3163 | struct GNUNET_CRYPTO_CsSessionNonce nonce; | 3163 | struct GNUNET_CRYPTO_CsSessionNonce nonce; |
3164 | |||
3165 | }; | ||
3166 | |||
3167 | |||
3168 | /** | ||
3169 | * Pair of Public R values for Cs denominations | ||
3170 | */ | ||
3171 | struct GNUNET_CRYPTO_CSPublicRPairP | ||
3172 | { | ||
3173 | struct GNUNET_CRYPTO_CsRPublic r_pub[2]; | ||
3164 | }; | 3174 | }; |
3165 | 3175 | ||
3166 | 3176 | ||
@@ -3174,9 +3184,8 @@ struct GNUNET_CRYPTO_CsBlindedMessage | |||
3174 | * @param msg the message to blind in preparation for signing | 3184 | * @param msg the message to blind in preparation for signing |
3175 | * @param msg_len length of message msg | 3185 | * @param msg_len length of message msg |
3176 | * @param[out] blinded_c array of the two blinded c's | 3186 | * @param[out] blinded_c array of the two blinded c's |
3177 | * @param[out] blinded_r_pub array of the two blinded R | 3187 | * @param[out] r_pub_blind array of the two blinded R |
3178 | */ | 3188 | */ |
3179 | // FIXME: function signature can probably be improved... | ||
3180 | void | 3189 | void |
3181 | GNUNET_CRYPTO_cs_calc_blinded_c ( | 3190 | GNUNET_CRYPTO_cs_calc_blinded_c ( |
3182 | const struct GNUNET_CRYPTO_CsBlindingSecret bs[2], | 3191 | const struct GNUNET_CRYPTO_CsBlindingSecret bs[2], |
@@ -3185,7 +3194,7 @@ GNUNET_CRYPTO_cs_calc_blinded_c ( | |||
3185 | const void *msg, | 3194 | const void *msg, |
3186 | size_t msg_len, | 3195 | size_t msg_len, |
3187 | struct GNUNET_CRYPTO_CsC blinded_c[2], | 3196 | struct GNUNET_CRYPTO_CsC blinded_c[2], |
3188 | struct GNUNET_CRYPTO_CsRPublic blinded_r_pub[2]); | 3197 | struct GNUNET_CRYPTO_CSPublicRPairP *r_pub_blind); |
3189 | 3198 | ||
3190 | 3199 | ||
3191 | /** | 3200 | /** |
@@ -3471,15 +3480,6 @@ struct GNUNET_CRYPTO_BlindedMessage | |||
3471 | 3480 | ||
3472 | 3481 | ||
3473 | /** | 3482 | /** |
3474 | * Pair of Public R values for Cs denominations | ||
3475 | */ | ||
3476 | struct GNUNET_CRYPTO_CSPublicRPairP | ||
3477 | { | ||
3478 | struct GNUNET_CRYPTO_CsRPublic r_pub[2]; | ||
3479 | }; | ||
3480 | |||
3481 | |||
3482 | /** | ||
3483 | * Secret r for Cs denominations | 3483 | * Secret r for Cs denominations |
3484 | */ | 3484 | */ |
3485 | struct GNUNET_CRYPTO_CSPrivateRPairP | 3485 | struct GNUNET_CRYPTO_CSPrivateRPairP |
@@ -3520,6 +3520,35 @@ struct GNUNET_CRYPTO_BlindingInputValues | |||
3520 | 3520 | ||
3521 | 3521 | ||
3522 | /** | 3522 | /** |
3523 | * Nonce used to deterministiacally derive input values | ||
3524 | * used in multi-round blind signature protocols. | ||
3525 | */ | ||
3526 | union GNUNET_CRYPTO_BlindSessionNonce | ||
3527 | { | ||
3528 | /** | ||
3529 | * Nonce used when signing with CS. | ||
3530 | */ | ||
3531 | struct GNUNET_CRYPTO_CsSessionNonce cs_nonce; | ||
3532 | }; | ||
3533 | |||
3534 | |||
3535 | /** | ||
3536 | * Compute blinding input values for a given @a nonce and | ||
3537 | * @a salt. | ||
3538 | * | ||
3539 | * @param bsign_priv private key to compute input values for | ||
3540 | * @param nonce session nonce to derive input values from | ||
3541 | * @param salt salt to include in derivation logic | ||
3542 | * @return blinding input values | ||
3543 | */ | ||
3544 | struct GNUNET_CRYPTO_BlindingInputValues * | ||
3545 | GNUNET_CRYPTO_get_blinding_input_values ( | ||
3546 | const struct GNUNET_CRYPTO_BlindSignPrivateKey *bsign_priv, | ||
3547 | const union GNUNET_CRYPTO_BlindSessionNonce *nonce, | ||
3548 | const char *salt); | ||
3549 | |||
3550 | |||
3551 | /** | ||
3523 | * Decrement reference counter of a @a bsign_pub, and free it if it reaches zero. | 3552 | * Decrement reference counter of a @a bsign_pub, and free it if it reaches zero. |
3524 | * | 3553 | * |
3525 | * @param[in] bsign_pub key to free | 3554 | * @param[in] bsign_pub key to free |
@@ -3585,8 +3614,6 @@ GNUNET_CRYPTO_blinded_message_incref ( | |||
3585 | */ | 3614 | */ |
3586 | struct GNUNET_CRYPTO_BlindSignPublicKey * | 3615 | struct GNUNET_CRYPTO_BlindSignPublicKey * |
3587 | GNUNET_CRYPTO_bsign_pub_incref (struct GNUNET_CRYPTO_BlindSignPublicKey *bsign_pub); | 3616 | GNUNET_CRYPTO_bsign_pub_incref (struct GNUNET_CRYPTO_BlindSignPublicKey *bsign_pub); |
3588 | |||
3589 | |||
3590 | /** | 3617 | /** |
3591 | * Increment reference counter of the given @a bsign_priv. | 3618 | * Increment reference counter of the given @a bsign_priv. |
3592 | * | 3619 | * |
@@ -3733,6 +3760,8 @@ union GNUNET_CRYPTO_BlindingSecretP | |||
3733 | * | 3760 | * |
3734 | * @param bsign_pub public key to blind for | 3761 | * @param bsign_pub public key to blind for |
3735 | * @param bks blinding secret to use | 3762 | * @param bks blinding secret to use |
3763 | * @param nonce nonce used to obtain @a alg_values | ||
3764 | * can be NULL if input values are not used for the cipher | ||
3736 | * @param message message to sign | 3765 | * @param message message to sign |
3737 | * @param message_size number of bytes in @a message | 3766 | * @param message_size number of bytes in @a message |
3738 | * @param alg_values algorithm specific values to blind the @a message | 3767 | * @param alg_values algorithm specific values to blind the @a message |
@@ -3742,6 +3771,7 @@ struct GNUNET_CRYPTO_BlindedMessage * | |||
3742 | GNUNET_CRYPTO_message_blind_to_sign ( | 3771 | GNUNET_CRYPTO_message_blind_to_sign ( |
3743 | const struct GNUNET_CRYPTO_BlindSignPublicKey *bsign_pub, | 3772 | const struct GNUNET_CRYPTO_BlindSignPublicKey *bsign_pub, |
3744 | const union GNUNET_CRYPTO_BlindingSecretP *bks, | 3773 | const union GNUNET_CRYPTO_BlindingSecretP *bks, |
3774 | const union GNUNET_CRYPTO_BlindSessionNonce *nonce, | ||
3745 | const void *message, | 3775 | const void *message, |
3746 | size_t message_size, | 3776 | size_t message_size, |
3747 | const struct GNUNET_CRYPTO_BlindingInputValues *alg_values); | 3777 | const struct GNUNET_CRYPTO_BlindingInputValues *alg_values); |
@@ -3751,7 +3781,8 @@ GNUNET_CRYPTO_message_blind_to_sign ( | |||
3751 | * Create blind signature. | 3781 | * Create blind signature. |
3752 | * | 3782 | * |
3753 | * @param bsign_priv private key to use for signing | 3783 | * @param bsign_priv private key to use for signing |
3754 | * @param salt salt value to use for the HKDF | 3784 | * @param salt salt value to use for the HKDF, |
3785 | * can be NULL if input values are not used for the cipher | ||
3755 | * @param blinded_message the already blinded message to sign | 3786 | * @param blinded_message the already blinded message to sign |
3756 | * @return blind signature with RC=1, NULL on failure | 3787 | * @return blind signature with RC=1, NULL on failure |
3757 | */ | 3788 | */ |