nx_opaque_envelope.nx
buildroot/runtime/hub/nx_opaque_envelope.nx
about
nx_opaque_envelope.nx -- V-MODAUTH-2a: RFC 9807 §4 client credential Envelope (Store / Recover).
The Envelope is what the server stores INSTEAD of a password hash. It contains
NO encrypted secret at all -- just a nonce + MAC. The client's AKE private key is
RE-DERIVED from the randomized password (OPRF output -> KSF stretch -> Extract)
at every login; the MAC proves the derivation used the right password against
the right server. Server compromise leaks nothing offline-crackable without the
separate oprf_seed, and even then each guess costs a full OPRF + KSF evaluation.
Deterministic-core convention (per the VOPRF KAT precedent): the *_det functions
take ALL randomness (envelope_nonce) as inputs so the RFC C.1.5/C.1.6 vectors can
drive them byte-exact; the non-det wrapper draws CSPRNG. KATs gate the _det core;
production calls the wrapper.
COMPOSES: hub/nx_opaque_core (Expand/DeriveKeyPair/ct_eq), nx_hmac, nx_hkdf, nx_csprng
COMPOSED BY: hub/nx_opaque_pake (FinalizeRegistrationRequest / RecoverCredentials)
SPEC: RFC 9807 §4.1.2 Store, §4.1.3 Recover, §4 CleartextCredentials
license_tier: ORIGINAL
dependencies 5 imports · 1 importers
imports: nx_syscalls.nxnx_csprng.nxnx_hmac.nxnx_hkdf.nxnx_opaque_core.nx
imported by: nx_opaque_pake.nx
structs
| none |
consts
| 26 | const NX_OPQ_ENVELOPE_BYTES: i64 = 64 // nonce(32) || auth_tag(32) |
functions
| 36 | func _opqe_build_mac_input( |
| 79 | func _opqe_derive_from_rwd( called by 2: nx_opq_envelope_store_detnx_opq_envelope_recover calls 3: sys_mmaphkdf_expandnx_opq_derive_keypair |
| 120 | func nx_opq_masking_key(rwd_32: *u8, out_masking_key_32: *u8) -> i64 |
| 130 | func nx_opq_envelope_store_det( |
| 175 | func nx_opq_envelope_store( |
| 199 | func nx_opq_envelope_recover( |