Module NH.Make

Functor building an implementation of Naive Hashing PSI given a Hash implementation.

Parameters

Signature

type t
type elt = Cstruct.t

Plaintext element

type pset = Stdlib.Set.Make(Cstruct).t

Plaintext set

type hset = Stdlib.Set.Make(Cstruct).t

Hashed set

val init : ?⁠salt:Cstruct.t -> unit -> t

init ?salt ?set () initializes a NH PSI instance.

parameter ?salt

Salt for hashing elements

val add : elt -> t -> t

add elem t adds elt to the set

val add_set : pset -> t -> t

add_set pset t adds pset of elements to the set

val remove : elt -> t -> t

remove elem t removes elt from the set

val inter : t -> hset -> pset

inter t hset computes the intersection of a private, plaintext set and a public, hashed set

val priv : t -> pset

priv t returns the set of private, plaintext set

val pub : t -> hset

pub t returns the set of public, hashed set