pub fn verify<D>(&self, message: &[u8], signature: &Signature) -> bool
            where D: Digest<OutputSize = U64> + Default {

        use curve25519_dalek::edwards::vartime;

        let mut h: D = D::default();
        let mut a: ExtendedPoint;
        let ao:  Option<ExtendedPoint>;
        let r: ExtendedPoint;
        let digest: [u8; 64];
        let digest_reduced: Scalar;

        if signature.s[31] & 224 != 0 {
            return false;
        }
        ao = self.decompress();

        if ao.is_some() {
            a = ao.unwrap();
        } else {
            return false;
        }
        a = -(&a);

        h.input(signature.r.as_bytes());
        h.input(self.as_bytes());
        h.input(&message);

        let digest_bytes = h.fixed_result();
        digest = *array_ref!(digest_bytes, 0, 64);
        digest_reduced = Scalar::reduce(&digest);
        r = vartime::double_scalar_mult_basepoint(&digest_reduced, &a, &signature.s);

        slices_equal(signature.r.as_bytes(), r.compress().as_bytes()) == 1
    }
/// Verify a signature on a message with this keypair's public key.
///
/// # Return
///
/// Returns true if the signature was successfully verified, and
/// false otherwise.
Verify a signature on a message with this keypair's public key.
Verify a signature on a message with this keypair ' s public key .
pub fn verify<D>(&self, message: &[u8], signature: &Signature) -> bool
            where D: Digest<OutputSize = U64> + Default {
        use curve25519_dalek::edwards::vartime;
        let mut h: D = D::default();
        let mut a: ExtendedPoint;
        let ao:  Option<ExtendedPoint>;
        let r: ExtendedPoint;
        let digest: [u8; 64];
        let digest_reduced: Scalar;
        if signature.s[31] & 224 != 0 {
            return false;
        }
        ao = self.decompress();
        if ao.is_some() {
            a = ao.unwrap();
        } else {
            return false;
        }
        a = -(&a);
        h.input(signature.r.as_bytes());
        h.input(self.as_bytes());
        h.input(&message);
        let digest_bytes = h.fixed_result();
        digest = *array_ref!(digest_bytes, 0, 64);
        digest_reduced = Scalar::reduce(&digest);
        r = vartime::double_scalar_mult_basepoint(&digest_reduced, &a, &signature.s);
        slices_equal(signature.r.as_bytes(), r.compress().as_bytes()) == 1
    }
pub fn verify < D > ( & self , message : & [ u8 ] , signature : & Signature ) -> bool where D : Digest < OutputSize = U64 > + Default { use curve25519_dalek :: edwards :: vartime ; let mut h : D = D :: default ( ) ; let mut a : ExtendedPoint ; let ao : Option < ExtendedPoint > ; let r : ExtendedPoint ; let digest : [ u8 ; 64 ] ; let digest_reduced : Scalar ; if signature . s [ 31 ] & 224 != 0 { return false ; } ao = self . decompress ( ) ; if ao . is_some ( ) { a = ao . unwrap ( ) ; } else { return false ; } a = - ( & a ) ; h . input ( signature . r . as_bytes ( ) ) ; h . input ( self . as_bytes ( ) ) ; h . input ( & message ) ; let digest_bytes = h . fixed_result ( ) ; digest = * array_ref ! ( digest_bytes 0 64 ) ; digest_reduced = Scalar :: reduce ( & digest ) ; r = vartime :: double_scalar_mult_basepoint ( & digest_reduced , & a , & signature . s ) ; slices_equal ( signature . r . as_bytes ( ) , r . compress ( ) . as_bytes ( ) ) == 1 }
Verify a signature on a message with this keypair's public key.
Verify a signature on a message with this keypair ' s public key .
&self
message
&[u8]
signature
&Signature
Returns true if the signature was successfully verified, and
false otherwise.
Returns true if the signature was successfully verified and false otherwise .
&self
message
&[u8]
signature
&Signature