MCPcopy Index your code
hub / github.com/CovenantSQL/CovenantSQL / Sign

Method Sign

xenomint/types/common.go:45–59  ·  view source on GitHub ↗

Sign implements hashSignVerifier.Sign.

(
	obj marshalHasher, signer *asymmetric.PrivateKey)

Source from the content-addressed store, hash-verified

43
44// Sign implements hashSignVerifier.Sign.
45func (i *DefaultHashSignVerifierImpl) Sign(
46 obj marshalHasher, signer *asymmetric.PrivateKey) (err error,
47) {
48 var enc []byte
49 if enc, err = obj.MarshalHash(); err != nil {
50 return
51 }
52 var h = hash.THashH(enc)
53 if i.Signature, err = signer.Sign(h[:]); err != nil {
54 return
55 }
56 i.DataHash = h
57 i.Signee = signer.PubKey()
58 return
59}
60
61// Verify implements hashSignVerifier.Verify.
62func (i *DefaultHashSignVerifierImpl) Verify(obj marshalHasher) (err error) {

Callers

nothing calls this directly

Calls 4

THashHFunction · 0.92
PubKeyMethod · 0.80
MarshalHashMethod · 0.65
SignMethod · 0.65

Tested by

no test coverage detected