// DeleteSha256Witness attempts to delete a sha256 preimage identified by hash.
1119
func (w *WitnessCache) DeleteSha256Witness(hash lntypes.Hash) error {
	return w.deleteWitness(Sha256HashWitness, hash[:])
}
1237245
func (client *Client) DeleteSnapshot(snapshotId string) error {
	args := DeleteSnapshotArgs{SnapshotId: snapshotId}
	response := DeleteSnapshotResponse{}

	return client.Invoke("DeleteSnapshot", &args, &response)
}
1212823
func (c *awsCloudImplementation) DeleteInstance(i *cloudinstances.CloudInstanceGroupMember) error {
	if c.spotinst != nil {
		return spotinst.DeleteInstance(c.spotinst, i)
	}

	return deleteInstance(c, i)
}
1296842
func (this *serviceImpl) HmacSha256(key, input []byte) (h []byte) {
	mac := hmac.New(sha256.New, key)
	mac.Write(input)
	h = mac.Sum(nil)
	return
}
710552
func (p *Peer) IsWitnessEnabled() bool {
	p.flagsMtx.Lock()
	witnessEnabled := p.witnessEnabled
	p.flagsMtx.Unlock()

	return witnessEnabled
}
801013
func (api *PublicWhisperAPI) DeleteSymKey(ctx context.Context, id string) bool {
	return api.w.DeleteSymKey(id)
}
478852
func CryptEncoderSSHA256(salt string) func(pass []byte, hash interface{}) []byte {
	return func(pass []byte, hash interface{}) []byte {
		s := []byte(salt)
		p := append(pass, s...)
		h := sha256.Sum256(p)
		return h[:]
	}
}
1192917
func (s *xlSets) DeleteObject(ctx context.Context, bucket string, object string) (err error) {
	return s.getHashedSet(object).DeleteObject(ctx, bucket, object)
}
554656
func WitnessScriptHash(witnessScript []byte) ([]byte, error) {
	bldr := txscript.NewScriptBuilder()

	bldr.AddOp(txscript.OP_0)
	scriptHash := sha256.Sum256(witnessScript)
	bldr.AddData(scriptHash[:])
	return bldr.Script()
}
844034
func (h *Hash) Delete(key Value) (*MrbValue, error) {
	keyVal := key.MrbValue(&Mrb{h.state}).value
	result := C.mrb_hash_delete_key(h.state, h.value, keyVal)

	val := newValue(h.state, result)
	if val.Type() == TypeNil {
		val = nil
	}

	return val, nil
}
799566
func computeHMAC256(key, message []byte) []byte {
	mac := hmac.New(sha256.New, key)
	mac.Write(message)
	return mac.Sum(nil)
}
1301016
func (l *ShardedNoTS) DeleteShard(tenantID string) error {
	delete(l.cache, tenantID)
	delete(l.itemCount, tenantID)

	return nil
}
1032151
func (s *AccountsService) DeleteSSHKey(accountID, sshKeyID string) (*Response, error) {
	u := fmt.Sprintf("accounts/%s/sshkeys/%s", accountID, sshKeyID)
	return s.client.DeleteRequest(u, nil)
}
597591
func (s *SnapshotService) DeleteSnapshot(p *DeleteSnapshotParams) (*DeleteSnapshotResponse, error) {
	resp, err := s.cs.newRequest("deleteSnapshot", p.toURLValues())
	if err != nil {
		return nil, err
	}

	var r DeleteSnapshotResponse
	if err := json.Unmarshal(resp, &r); err != nil {
		return nil, err
	}

	// If we have a async client, we need to wait for the async result
	if s.cs.async {
		b, err := s.cs.GetAsyncJobResult(r.JobID, s.cs.timeout)
		if err != nil {
			if err == AsyncTimeoutErr {
				return &r, err
			}
			return nil, err
		}

		if err := json.Unmarshal(b, &r); err != nil {
			return nil, err
		}
	}

	return &r, nil
}
419821
func deleteSnapshotInfo(c context.Context) error {
	c = ds.WithoutTransaction(c)
	return ds.Delete(c, ds.KeyForObj(c, &SnapshotInfo{}))
}
773980
func (a L3n4Addr) SHA256Sum() string {
	// FIXME: Remove Protocol's omission once we care about protocols.
	protoBak := a.Protocol
	a.Protocol = ""
	defer func() {
		a.Protocol = protoBak
	}()

	str := []byte(fmt.Sprintf("%+v", a))
	return fmt.Sprintf("%x", sha512.Sum512_256(str))
}
487531
func isWitnessScriptHash(pops []parsedOpcode) bool {
	return len(pops) == 2 &&
		pops[0].opcode.value == OP_0 &&
		pops[1].opcode.value == OP_DATA_32
}