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

        let mut h: D = D::default();
        let mut hash: [u8; 64] = [0u8; 64];
        let mesg_digest: Scalar;
        let hram_digest: Scalar;
        let r: ExtendedPoint;
        let s: Scalar;

        h.input(&self.nonce);
        h.input(&message);
        hash.copy_from_slice(h.fixed_result().as_slice());

        mesg_digest = Scalar::reduce(&hash);

        r = &mesg_digest * &constants::ED25519_BASEPOINT_TABLE;

        h = D::default();
        h.input(r.compress().as_bytes());
        h.input(public_key.as_bytes());
        h.input(&message);
        hash.copy_from_slice(h.fixed_result().as_slice());

        hram_digest = Scalar::reduce(&hash);

        s = Scalar::multiply_add(&hram_digest, &self.key, &mesg_digest);

        Signature{ r: r.compress(), s: s }
    }
/// Sign a message with this `ExpandedSecretKey`.
Sign a message with this `ExpandedSecretKey`.
Sign a message with this ` ExpandedSecretKey ` .
pub fn sign<D>(&self, message: &[u8], public_key: &PublicKey) -> Signature
            where D: Digest<OutputSize = U64> + Default {
        let mut h: D = D::default();
        let mut hash: [u8; 64] = [0u8; 64];
        let mesg_digest: Scalar;
        let hram_digest: Scalar;
        let r: ExtendedPoint;
        let s: Scalar;
        h.input(&self.nonce);
        h.input(&message);
        hash.copy_from_slice(h.fixed_result().as_slice());
        mesg_digest = Scalar::reduce(&hash);
        r = &mesg_digest * &constants::ED25519_BASEPOINT_TABLE;
        h = D::default();
        h.input(r.compress().as_bytes());
        h.input(public_key.as_bytes());
        h.input(&message);
        hash.copy_from_slice(h.fixed_result().as_slice());
        hram_digest = Scalar::reduce(&hash);
        s = Scalar::multiply_add(&hram_digest, &self.key, &mesg_digest);
        Signature{ r: r.compress(), s: s }
    }
pub fn sign < D > ( & self , message : & [ u8 ] , public_key : & PublicKey ) -> Signature where D : Digest < OutputSize = U64 > + Default { let mut h : D = D :: default ( ) ; let mut hash : [ u8 ; 64 ] = [ 0u8 ; 64 ] ; let mesg_digest : Scalar ; let hram_digest : Scalar ; let r : ExtendedPoint ; let s : Scalar ; h . input ( & self . nonce ) ; h . input ( & message ) ; hash . copy_from_slice ( h . fixed_result ( ) . as_slice ( ) ) ; mesg_digest = Scalar :: reduce ( & hash ) ; r = & mesg_digest * & constants :: ED25519_BASEPOINT_TABLE ; h = D :: default ( ) ; h . input ( r . compress ( ) . as_bytes ( ) ) ; h . input ( public_key . as_bytes ( ) ) ; h . input ( & message ) ; hash . copy_from_slice ( h . fixed_result ( ) . as_slice ( ) ) ; hram_digest = Scalar :: reduce ( & hash ) ; s = Scalar :: multiply_add ( & hram_digest , & self . key , & mesg_digest ) ; Signature { r : r . compress ( ) , s : s } }
Sign a message with this `ExpandedSecretKey`.
Sign a message with this ` ExpandedSecretKey ` .
&self
message
&[u8]
public_key
&PublicKey
&self
message
&[u8]
public_key
&PublicKey