-
Notifications
You must be signed in to change notification settings - Fork 168
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
feat(iroh-willow): Private Area Intersection #2422
Conversation
SHA512 is not a bad choice, but FWIW, That said, the most important factor in choosing this stuff (in my opinion) would be checking with what other people are planning on using. Are the earthstar folks planning to go with SHA-512, too? |
Cool, I didn't know. However the rustcrypto
Earthstar uses SHA512 too: https://willowprotocol.org/earthstar/spec/index.html#es6_wgps_pai
I did not yet add a domain separation tag but that'll be a straightforward change. |
Jup, we went with the recommendation in |
Aha, interesting. Will read more, I don't know enough about the differences between these primitives. I used ristretto because |
This is the RFC @AljoschaMeyer is referring to: https://www.rfc-editor.org/rfc/rfc9380.html |
Not that we should do it, this is how you'd do it: use the let mut hasher = blake3::Hasher::new();
hasher.update(b"Hello, world!");
let mut xof = hasher.finalize_xof();
let mut output = [0u8; 64];
xof.fill(&mut output); |
I am going to merge this. |
Description
Implementation of Private Area Intersection as defined in the WGPS spec.
The implementation of the
PaiFinder
is ported from the TypeScript implementation inwillow-js
.The PR currently uses the following cryptographic scheme:
PsiGroup
usesRistrettoPoint
fromcurve25519_dalek
, andhash_to_group
usessha512
for hashing to a curve point. Went withsha512
becauseRistrettoPoint::hash_from_bytes
needs a digest with 64 bytes length.PsiScalar
uses theScalar
type fromcurve25519_dalek
The smoke test passes 🔥
Breaking Changes
Notes & open questions
Earthstar) uses RFC 9380 with
edwards25519_XMD:SHA-512_ELL2_RO_
, which hashes to edwards25519, a different curve from ristretto255.We want to use the RFC as well, it seems the best option after a longer discussion (TODO: Link to Discord?). The
curve25519_dalek
crate from RustCrypto only supports hash-to-curve for ristretto255, but there's an open PR for hashing to an edwards25519 curve: dalek-cryptography/curve25519-dalek#377, which is waiting for review and might need updates because it was developed against a draft of the RFC.Change checklist