View raw

1 (** The password-hashing port. An adapter supplies a concrete algorithm, so the 2 use case and the {!Trainee} entity never name one. The stored form is an 3 opaque verifier string, wrapped by {!Trainee.credential_of_hash}. *) 4 5 module type S = sig 6 val hash : string -> string 7 (** Salt and hash a new password into a stored verifier. *) 8 9 val verify : hash:string -> string -> bool 10 (** Check a candidate password against a stored verifier. The adapter supplies 11 the comparison, so it decides the timing guarantee. *) 12 end 13