INNER CODE UNIT · Go

func

lightningnetwork/lightning-onion · crypto.go:325

func (o *OnionErrorDecrypter) DecryptError(encryptedData []byte) (
	*DecryptedError, error) {

	// Ensure the error message length is as expected.
	if len(encryptedData) < minOnionErrorLength {
		return nil, fmt.Errorf("invalid error length: "+
			"expected at least %v got %v", minOnionErrorLength,
			len(encryptedData))
	}

	sharedSecrets, _, err := generateSharedSecrets(
		o.circuit.PaymentPath,
		o.circuit.SessionKey,
	)
	if err != nil {
		return nil, fmt.Errorf("error generating shared secret: %v",
			err)
	}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…