Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

djcs_t_share_decrypt needs private_key #6

Open
robinhundt opened this issue Jul 13, 2021 · 1 comment
Open

djcs_t_share_decrypt needs private_key #6

robinhundt opened this issue Jul 13, 2021 · 1 comment

Comments

@robinhundt
Copy link

Hi,
we'd like to use this library to implement a secure multi party computation protocol for a paper. Looking at the source code, I stumbled over the djcs_t_share_decrypt method which needs the private key.

/**
* For a given ciphertext @p cipher1, compute the server @p au's share and store
* the result in the variable @p rop. These shares can be managed, and then
* combined when sufficient shares have been accumulated using the
* djcs_t_share_combine function.
*
* @param vk A pointer to an initialised djcs_t_private_key
* @param au A pointer to an initialised djcs_t_auth_server
* @param rop mpz_t where the calculated share is stored
* @param cipher1 mpz_t which stores the ciphertext to decrypt
*/
void djcs_t_share_decrypt(djcs_t_private_key *vk, djcs_t_auth_server *au,
mpz_t rop, mpz_t cipher1);

This is in contrast to the equivalent method for the standard Paillier implementation here:

/**
* For a given ciphertext @p cipher1, compute the server @p au's share and store
* the result in the variable @p rop. These shares can be managed, and then
* combined when sufficient shares have been accumulated using the
* pcs_t_share_combine function.
*
* @param vk A pointer to an initialised pcs_t_private_key
* @param au A pointer to an initialised pcs_t_auth_server
* @param rop mpz_t where the calculated share is stored
* @param cipher1 mpz_t which stores the ciphertext to decrypt
*/
void pcs_t_share_decrypt(pcs_t_public_key *vk, pcs_t_auth_server *au,
mpz_t rop, mpz_t cipher1);

which says private key in the doc string, but actually takes a public key.

I've looked at the local_ecample.c and there paillier is used with the share_decrypt method and the public key as a parameter. Intuitively this seems to be the correct way to me, since share_decrypt is intended to be used to 'partially' decrypt a ciphertext with the secret key share which the auth server holds, right?

Is my understanding of the intended functionality wrong and there is a reason why djcs_t_share_decrypt needs a private key, while for the Paillier equivalent the public key suffices?

Thanks for the library :)

@robinhundt
Copy link
Author

If anyone stumbles over this: the fork at https://github.com/lemonviv/libhcs seemingly contains a fixed version of djcs.
I've also started my own fork where I've mainly fixed up some of the C++ interfaces https://github.com/robinhundt/libhcs and will likely also incorporate the fix for djcs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant