Updating envelope structure to support two fixed modes (#108)

* Moving id_u and id_s from ClientLoginStartParameters to ClientLoginFinishParameters

* Updating envelope format to support two fixed modes
This commit is contained in:
Kevin Lewi
2021-01-04 14:27:20 -08:00
committed by GitHub
parent f5b5391ee0
commit 9f6b32a5ea
9 changed files with 316 additions and 346 deletions
+2 -2
View File
@@ -19,14 +19,14 @@ use hkdf::Hkdf;
/// A subtrait of Group specifying how to hash a password into a point
pub trait GroupWithMapToCurve: Group {
/// The ciphersuite identifier as dictated by
/// https://www.ietf.org/archive/id/draft-irtf-cfrg-voprf-05.txt
/// <https://www.ietf.org/archive/id/draft-irtf-cfrg-voprf-05.txt>
const SUITE_ID: usize;
/// transforms a password and domain separation tag (DST) into a curve point
fn map_to_curve<H: Hash>(msg: &[u8], dst: &[u8]) -> Result<Self, InternalPakeError>;
/// Generates the contextString parameter as defined in
/// https://www.ietf.org/archive/id/draft-irtf-cfrg-voprf-05.txt
/// <https://www.ietf.org/archive/id/draft-irtf-cfrg-voprf-05.txt>
fn get_context_string(mode: u8) -> Vec<u8> {
[i2osp(mode as usize, 1), i2osp(Self::SUITE_ID, 2)].concat()
}