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

enhancement request: implement KDF (SDHI and/or Naor-Reingold) #423

Open
udf2457 opened this issue Apr 11, 2023 · 4 comments
Open

enhancement request: implement KDF (SDHI and/or Naor-Reingold) #423

udf2457 opened this issue Apr 11, 2023 · 4 comments
Labels
good first issue help wanted Extra attention is needed question Further information is requested

Comments

@udf2457
Copy link

udf2457 commented Apr 11, 2023

By way of backround, this request is based on my reading about Meta Anonymous Credential Service which they recently open-sourced (unfortunately in C !) https://github.com/facebookresearch/acs.

Anyways ... TL;DR, the curious beast in me thought I might have a go at re-implementing it in Go so I can play around with it.

Obviously Go stdlib doesn't provide many of the necessary building crypto building blocks, but circl does:

  • VOPRF ✅
  • DLEQ ✅
  • Ed25519 ✅

But unfortunately .....

"attribute-based key derivation function" ❌

Meta say in their blog post:

We recommend Strong Diffie–Hellman Inversion (SDHI) or Naor-Reingold for better key transparency.

Hence this request 😉
( espcially as my github searches seem to show nobody else has a Go implementation of either of those KDFs either)

Perhaps see also comments in the header files re: SDHI and Naor-Reingold:
kdf/kdf_sdhi.h
kdf/kdf_naor_reingold.h

@armfazh armfazh added help wanted Extra attention is needed question Further information is requested good first issue labels Aug 31, 2023
@armfazh
Copy link
Contributor

armfazh commented Aug 31, 2023

Implementing either algorithm can benefit from using CIRCL's group interface, as they only require conventional elliptic curve arithmetic.

We would like to hear other use cases. I leave this ticket open in case anyone wants to contribute with the implementation.

@HamdaanAliQuatil
Copy link

hey @armfazh 👋 If someone hasn't started already - can I take this up, please?

@armfazh
Copy link
Contributor

armfazh commented Jun 18, 2024

One question here is whether these KDFs can be implemented using the CIRCL's public API, i.e., without including the KDFs as part of CIRCL. If so, then these can be implemented elsewhere using CIRCL as a dependency.

OTOH, if, for some reason, the KDFs need to play with the internals of CIRCL to make them work, then we may consider add support to these KDFs.

Let's figure out this first, open for comments.

@HamdaanAliQuatil
Copy link

Hey @armfazh it took me some time to get to a conclusion but I believe, both SDHI and Naor-Reingold KDF could be implemented using existing APIs.

Here's my implementation for SDHI, please let me know if you find anything wrong: https://gist.github.com/HamdaanAliQuatil/e186aa1a9a1b40e550303a58c47cb709

I'm not 100% certain about Naor-Reingold and am trying to implement it following this code: https://github.com/facebookresearch/acs/blob/main/lib/kdf/kdf_naor_reingold.c

Please let me know if you think otherwise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants