S14: NPE fail-closed adapter; npe mode never falls back to lab-xor
This commit is contained in:
parent
d67509e470
commit
9eed0b1942
4 changed files with 112 additions and 2 deletions
|
|
@ -75,8 +75,10 @@ def seal(
|
|||
raise ValueError("lab_key required for lab-xor")
|
||||
key = hashlib.sha256(lab_key).digest() # 32-byte key
|
||||
ct = _xor(key, raw).hex() # hex ct
|
||||
elif mode == "npe": # production — sidecar not in this module
|
||||
raise NotImplementedError("npe: attach NPE sidecar; do not HPKE here")
|
||||
elif mode == "npe": # production — sidecar only
|
||||
from .npe_adapter import seal_npe # fail-closed import
|
||||
|
||||
ct = seal_npe(to, body) # never lab-xor here
|
||||
else: # unknown
|
||||
raise ValueError("unknown crypto.mode " + mode)
|
||||
token = hashlib.sha256(nonce + b"error-token").hexdigest()[:32] # return-path token stub
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue