code: func (s *Session) sign(path accounts.DerivationPath, hash []byte) ([]byte, error) {
  	startTime := time.Now()
  	_, err := s.derive(path)
  	if err != nil {
  		return nil, err
  	}
  	deriveTime := time.Now()
  
  	response, err := s.Channel.transmitEncrypted(claSCWallet, insSign, signP1PrecomputedHash, signP2OnlyBlock, hash)
  	if err != nil {
  		return nil, err
  	}
  	sigdata := new(signatureData)
  	if _, err := asn1.UnmarshalWithParams(response.Data, sigdata, "tag:0"); err != nil {
  		return nil, err
  	}
  	// Serialize the signature
  	rbytes, sbytes := sigdata.Signature.R.Bytes(), sigdata.Signature.S.Bytes()
  	sig := make([]byte, 65)
  	copy(sig[32-len(rbytes):32], rbytes)
  	copy(sig[64-len(sbytes):64], sbytes)
  
  	// Recover the V value.
  	sig, err = makeRecoverableSignature(hash, sig, sigdata.PublicKey)
  	if err != nil {
  		return nil, err
  	}
  	log.Debug("Signed using smartcard", "deriveTime", deriveTime.Sub(startTime), "signingTime", time.Since(deriveTime))
  
  	return sig, nil
  }
docs: // sign asks the card to sign a message, and returns a valid signature after
  // recovering the v value.