code: def sign(self, h, sig_format=SER_BINARY):
          
          outlen = (self.curve.sig_len_compact if sig_format == SER_COMPACT
                    else self.curve.sig_len_bin)
          sig = self._ECDSA_sign(h)
          return serialize_number(sig, sig_format, outlen)
docs: Signs the message with SHA-512 hash `h' with this private key.