MCPcopy Create free account
hub / github.com/encodeous/nylon / SignBundle

Function SignBundle

state/distribution.go:15–22  ·  view source on GitHub ↗
(data []byte, key NyPrivateKey)

Source from the content-addressed store, hash-verified

13)
14
15func SignBundle(data []byte, key NyPrivateKey) ([]byte, error) {
16 privKey := x25519.PrivateKey(key[:])
17 sig, err := privKey.Sign(rand.Reader, data, crypto.Hash(0))
18 if err != nil {
19 return nil, err
20 }
21 return append(sig, data...), nil
22}
23
24func VerifyBundle(data []byte, key NyPublicKey) ([]byte, error) {
25 if len(data) < x25519.SignatureSize {

Callers 3

writeRawBundleFunction · 0.92
BundleConfigFunction · 0.85
TestBundleInvalidData2Function · 0.85

Calls

no outgoing calls

Tested by 2

writeRawBundleFunction · 0.74
TestBundleInvalidData2Function · 0.68