Skip to main content

select_profile

Function select_profile 

Source
pub fn select_profile(
    cached: &PeerMinima,
    offered: Option<u16>,
) -> Result<u16, CryptoError>
Expand description

Select a profile given cached minima and an offered profile.

Stripped / missing offer → CryptoError::Malformed. Offered classical (PROFILE_CLASSICAL) → CryptoError::Downgrade (no automatic classical retry). Cached revoked → CryptoError::Revoked. Offered profile < cached min_profile → CryptoError::Downgrade. Unknown profile (not 0 or 1) → CryptoError::UnknownProfile. Success only if offered == PROFILE_QPR_PQ_1 and minima.min_profile == PROFILE_QPR_PQ_1 and !revoked.