pub fn finish<R: CryptoRng + RngCore>(
        self,
        rng: &mut R,
        registration_response: RegistrationResponse<CS>,
        params: ClientRegistrationFinishParameters<CS>,
    ) -> Result<ClientRegistrationFinishResult<CS>, ProtocolError> {
        // Check for reflected value from server and halt if detected
        if self
            .blinded_element
            .value()
            .ct_eq(&registration_response.evaluation_element.value())
            .into()
        {
            return Err(ProtocolError::ReflectedValueError);
        }

        #[cfg_attr(not(test), allow(unused_variables))]
        let (randomized_pwd, randomized_pwd_hasher) = get_password_derived_key::<CS>(
            self.oprf_client.clone(),
            registration_response.evaluation_element,
            params.slow_hash,
        )?;

        let mut masking_key = vec![0u8; <CS::Hash as Digest>::OutputSize::USIZE];
        randomized_pwd_hasher
            .expand(STR_MASKING_KEY, &mut masking_key)
            .map_err(|_| InternalError::HkdfError)?;

        let result = Envelope::<CS>::seal(
            rng,
            randomized_pwd_hasher,
            &registration_response.server_s_pk,
            params.identifiers,
        )?;

        Ok(ClientRegistrationFinishResult {
            message: RegistrationUpload {
                envelope: result.0,
                masking_key: GenericArray::clone_from_slice(&masking_key[..]),
                client_s_pk: result.1,
            },
            export_key: result.2,
            server_s_pk: registration_response.server_s_pk,
            #[cfg(test)]
            state: self,
            #[cfg(test)]
            auth_key: result.3,
            #[cfg(test)]
            randomized_pwd,
        })
    }
/// "Unblinds" the server's answer and returns a final message containing
/// cryptographic identifiers, to be sent to the server on setup finalization
"Unblinds" the server's answer and returns a final message containing
cryptographic identifiers, to be sent to the server on setup finalization
" Unblinds " the server ' s answer and returns a final message containing cryptographic identifiers to be sent to the server on setup finalization
pub fn finish<R: CryptoRng + RngCore>(
        self,
        rng: &mut R,
        registration_response: RegistrationResponse<CS>,
        params: ClientRegistrationFinishParameters<CS>,
    ) -> Result<ClientRegistrationFinishResult<CS>, ProtocolError> {
        // Check for reflected value from server and halt if detected
        if self
            .blinded_element
            .value()
            .ct_eq(&registration_response.evaluation_element.value())
            .into()
        {
            return Err(ProtocolError::ReflectedValueError);
        }
        #[cfg_attr(not(test), allow(unused_variables))]
        let (randomized_pwd, randomized_pwd_hasher) = get_password_derived_key::<CS>(
            self.oprf_client.clone(),
            registration_response.evaluation_element,
            params.slow_hash,
        )?;
        let mut masking_key = vec![0u8; <CS::Hash as Digest>::OutputSize::USIZE];
        randomized_pwd_hasher
            .expand(STR_MASKING_KEY, &mut masking_key)
            .map_err(|_| InternalError::HkdfError)?;
        let result = Envelope::<CS>::seal(
            rng,
            randomized_pwd_hasher,
            &registration_response.server_s_pk,
            params.identifiers,
        )?;
        Ok(ClientRegistrationFinishResult {
            message: RegistrationUpload {
                envelope: result.0,
                masking_key: GenericArray::clone_from_slice(&masking_key[..]),
                client_s_pk: result.1,
            },
            export_key: result.2,
            server_s_pk: registration_response.server_s_pk,
            #[cfg(test)]
            state: self,
            #[cfg(test)]
            auth_key: result.3,
            #[cfg(test)]
            randomized_pwd,
        })
    }
pub fn finish < R : CryptoRng + RngCore > ( self , rng : & mut R , registration_response : RegistrationResponse < CS > , params : ClientRegistrationFinishParameters < CS > , ) -> Result < ClientRegistrationFinishResult < CS > , ProtocolError > { // Check for reflected value from server and halt if detected if self . blinded_element . value ( ) . ct_eq ( & registration_response . evaluation_element . value ( ) ) . into ( ) { return Err ( ProtocolError :: ReflectedValueError ) ; } # [ cfg_attr ( not ( test ) allow ( unused_variables ) ) ] let ( randomized_pwd , randomized_pwd_hasher ) = get_password_derived_key :: < CS > ( self . oprf_client . clone ( ) , registration_response . evaluation_element , params . slow_hash , ) ? ; let mut masking_key = vec ! [ 0u8 CS Hash as Digest OutputSize USIZE ] ; randomized_pwd_hasher . expand ( STR_MASKING_KEY , & mut masking_key ) . map_err ( | _ | InternalError :: HkdfError ) ? ; let result = Envelope :: < CS > :: seal ( rng , randomized_pwd_hasher , & registration_response . server_s_pk , params . identifiers , ) ? ; Ok ( ClientRegistrationFinishResult { message : RegistrationUpload { envelope : result . 0 , masking_key : GenericArray :: clone_from_slice ( & masking_key [ .. ] ) , client_s_pk : result . 1 , } , export_key : result . 2 , server_s_pk : registration_response . server_s_pk , # [ cfg ( test ) ] state : self , # [ cfg ( test ) ] auth_key : result . 3 , # [ cfg ( test ) ] randomized_pwd , } ) }
"Unblinds" the server's answer and returns a final message containing
cryptographic identifiers, to be sent to the server on setup finalization
" Unblinds " the server ' s answer and returns a final message containing cryptographic identifiers to be sent to the server on setup finalization
self
rng
&mut R
registration_response
RegistrationResponse<CS>
params
ClientRegistrationFinishParameters<CS>
self
rng
&mut R
registration_response
RegistrationResponse<CS>
params
ClientRegistrationFinishParameters<CS>