pub(crate) fn diffie_hellman(pk: Key, sk: Key) -> Result<Vec<u8>, InternalPakeError> {
        let pk_data = GenericArray::<u8, G::ElemLen>::from_slice(&pk.0[..]);
        let point = G::from_element_slice(&pk_data)?;
        let secret_data = GenericArray::<u8, G::ScalarLen>::from_slice(&sk.0[..]);
        Ok(G::mult_by_slice(&point, &secret_data).to_arr().to_vec())
    }
/// Computes the diffie hellman function on a public key and private key
Computes the diffie hellman function on a public key and private key
Computes the diffie hellman function on a public key and private key
pub(crate) fn diffie_hellman(pk: Key, sk: Key) -> Result<Vec<u8>, InternalPakeError> {
        let pk_data = GenericArray::<u8, G::ElemLen>::from_slice(&pk.0[..]);
        let point = G::from_element_slice(&pk_data)?;
        let secret_data = GenericArray::<u8, G::ScalarLen>::from_slice(&sk.0[..]);
        Ok(G::mult_by_slice(&point, &secret_data).to_arr().to_vec())
    }
pub ( crate ) fn diffie_hellman ( pk : Key , sk : Key ) -> Result < Vec < u8 > , InternalPakeError > { let pk_data = GenericArray :: < u8 , G :: ElemLen > :: from_slice ( & pk . 0 [ .. ] ) ; let point = G :: from_element_slice ( & pk_data ) ? ; let secret_data = GenericArray :: < u8 , G :: ScalarLen > :: from_slice ( & sk . 0 [ .. ] ) ; Ok ( G :: mult_by_slice ( & point , & secret_data ) . to_arr ( ) . to_vec ( ) ) }
Computes the diffie hellman function on a public key and private key
Computes the diffie hellman function on a public key and private key
pk
Key
sk
Key
pk
Key
sk
Key