Skip to Content
oxcrypto

POPRF

RFC 9497 partially oblivious PRF with a public info value.

from oxcrypto.oprf.poprf import POPRF

algorithm = POPRF.RISTRETTO255_SHA512
key = algorithm.generate()

client = algorithm.blind(b"input")
evaluated, proof = key.blind_evaluate(client.blinded_element, info=b"context")
output = client.finalize(evaluated, proof, key.public_key(), info=b"context")
assert output == key.evaluate(b"input", info=b"context")

Both sides must pass the same info; it defaults to b"". A mismatch makes the proof fail with ValueError.