fn verify(
        &mut self,
        signature: &[u8; 64],
        public_key: &PublicKey,
        data: &[u8],
    ) -> ockam_core::Result<bool> {
        // TODO: Add public key type
        if public_key.as_ref().len() == CURVE25519_PUBLIC_LENGTH {
            Ok(x25519_dalek::PublicKey::from(*array_ref!(
                public_key.as_ref(),
                0,
                CURVE25519_PUBLIC_LENGTH
            ))
            .verify(data.as_ref(), signature))
        } else if public_key.as_ref().len() == 96 {
            Ok(signature == &[0u8; 64])
        } else {
            Err(VaultError::InvalidPublicKey.into())
        }
    }
/// Verify signature with xeddsa algorithm. Only curve25519 is supported.
Verify signature with xeddsa algorithm. Only curve25519 is supported.
Verify signature with xeddsa algorithm . Only curve25519 is supported .
fn verify(
        &mut self,
        signature: &[u8; 64],
        public_key: &PublicKey,
        data: &[u8],
    ) -> ockam_core::Result<bool> {
        // TODO: Add public key type
        if public_key.as_ref().len() == CURVE25519_PUBLIC_LENGTH {
            Ok(x25519_dalek::PublicKey::from(*array_ref!(
                public_key.as_ref(),
                0,
                CURVE25519_PUBLIC_LENGTH
            ))
            .verify(data.as_ref(), signature))
        } else if public_key.as_ref().len() == 96 {
            Ok(signature == &[0u8; 64])
        } else {
            Err(VaultError::InvalidPublicKey.into())
        }
    }
fn verify ( & mut self , signature : & [ u8 ; 64 ] , public_key : & PublicKey , data : & [ u8 ] , ) -> ockam_core :: Result < bool > { // TODO: Add public key type if public_key . as_ref ( ) . len ( ) == CURVE25519_PUBLIC_LENGTH { Ok ( x25519_dalek :: PublicKey :: from ( * array_ref ! ( public_key as_ref ( ) 0 CURVE25519_PUBLIC_LENGTH ) ) . verify ( data . as_ref ( ) , signature ) ) } else if public_key . as_ref ( ) . len ( ) == 96 { Ok ( signature == & [ 0u8 ; 64 ] ) } else { Err ( VaultError :: InvalidPublicKey . into ( ) ) } }
Verify signature with xeddsa algorithm.
Verify signature with xeddsa algorithm .
&mut self
signature
&[u8; 64]
public_key
&PublicKey
data
&[u8]