PoprfServer::evaluate(input, None) disagrees with interactive POPRF finalization for empty public info
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 84/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- rust
- Domain
- cryptography
Research direction
Start by locating PoprfServer::evaluate and the server_evaluate_hash_input helper mentioned in the issue, then compare how they handle None and Some(&[]). Use the supplied regression test and check both direct evaluation paths against interactive finalization; done means all three produce the same PRF output for empty public info.
Written by the indexing model from the issue text.
Description
When the public info is empty, PoprfServer::evaluate(input, None) returns a different PRF output from the interactive POPRF protocol for the same key and private input. Passing Some(&[]) to evaluate produces the same output as interactive finalization.
Here is a minimal regression test that fails on the commit 701b57f.
use voprf::{PoprfServer, Ristretto255};
#[test]
fn empty_poprf_info_has_a_consistent_output() {
let server = PoprfServer::<Ristretto255>::new_from_seed(&[0x53; 32], b"test").unwrap();
let input = b"example input";
let implicit_empty = server.evaluate(input, None).unwrap();
let explicit_empty = server.evaluate(input, Some(&[])).unwrap();
assert_eq!(implicit_empty, explicit_empty);
}
Expected behavior
RFC 9497 §3.3.3 includes I2OSP(len(info), 2) || info in the final hash input for both Evaluate and Finalize. For empty info, this contributes two zero bytes. Both API representations of empty info should therefore agree with interactive finalization.
Cause and suggested fix
The POPRF server treats None as empty when computing the key tweak, then passes the original Option to server_evaluate_hash_input. That helper appends the length and contents of info only for Some, so the None path omits the two-byte length. Interactive finalization normalizes None to an empty slice and includes the length.
A localized fix would be to pass Some(info.unwrap_or_default()) to the shared hash helper from PoprfServer::evaluate. A regression test comparing both direct calls with interactive finalization would cover all three paths.
- Dominant language
- Rust
- Stars
- 88
- Forks
- 22
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from facebook/voprf
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
claim
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Nixitov/Riptide-Native#946 ·
Maintainers usually reply within 1 day
-
Add Strange QuarkOpen
Difficulty 1/5 Under an hour Newbie friendliness 90/100
-
area: ai-assistants documentation help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
BetaBots-LLC/latticegate#17 ·