[OCaml] High Intensity Training Online
fix pin the bcrypt work factor and surface corruption
The bcrypt adapter used safepass's default cost of 6, which is 64 iterations and far too cheap for a stored password verifier. Pin the cost at 12, the common baseline: a verification then costs on the order of a quarter second, so an offline attack on a leaked verifier pays that for every guess. A hash records its own cost, so existing verifiers keep verifying and the cost can be raised again later. A stored verifier that is not a bcrypt hash is corrupt storage, not a wrong password. Verification still fails closed, and now says so on stderr instead of reading the corruption as a typo. The test suite runs the service and web functors against a real bcrypt adapter at the minimum cost, so every registration and sign-in in the suite exercises the same code path without paying the production cost hundreds of times. The production adapter keeps its own unit tests, including one that reads the pinned cost back from a fresh hash.