pub struct Spake2pVerifierData {
pub w0: [u8; 32],
pub l: [u8; 65],
}rustcrypto only.Expand description
What a commissionee stores instead of the passcode: (w0, L) (§3.10).
“When the computation of Crypto_PAKEValues_Responder is done, fields w0 and L
SHALL be stored in the Responder and w1 SHALL NOT be stored in the Responder.”
This is what goes into a device’s factory data. It is 87 octets and it is not secret in the way a private key is — but it is not public either: anyone holding it can impersonate the device to a commissioner, so it is protected like a credential.
Fields§
§w0: [u8; 32]w0 — a scalar, big-endian.
l: [u8; 65]L = w1 · P — an uncompressed point.
Implementations§
Source§impl Spake2pVerifierData
impl Spake2pVerifierData
Sourcepub fn from_passcode(
passcode: u32,
salt: &[u8],
iterations: u32,
) -> Result<Self>
pub fn from_passcode( passcode: u32, salt: &[u8], iterations: u32, ) -> Result<Self>
Computes (w0, L) from a passcode, as a factory-provisioning step would.
passcode is the §5.1.1.6 passcode; the PBKDF input is its little-endian
4-octet encoding — “passcode 18924017 would be encoded as the octet string
f1:c1:20:01”.
Sourcepub fn from_bytes(bytes: &[u8]) -> Result<Self>
pub fn from_bytes(bytes: &[u8]) -> Result<Self>
Reads w0 || L, checking that both halves are what they claim to be.
The validation is not decoration. §11.19.8.1’s OpenCommissioningWindow accepts a
verifier from an administrator over the wire and must answer PAKEParameterError
for one that is “incorrectly formatted or otherwise invalid” — and a verifier that was
only length-checked would be accepted here and fail much later, inside PASE, as an
inexplicable handshake failure that no commissioner could diagnose.
L goes through the same point decoding every peer-supplied point does: it must be on
the curve and must not be the identity. The first is what stops an invalid-curve
attack; the second is what stops a verifier that would make every Z the identity and
every session key a constant. w0 must be a canonical scalar below the group order —
a reduced-mod-n copy of an out-of-range value would be a different verifier that
re-encodes to different bytes.