mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-04-02 00:52:13 +02:00
Update constants at top to reflect new k value
This commit is contained in:
parent
cbfefdf0f4
commit
4efb397ade
16
sphinx.go
16
sphinx.go
@ -37,14 +37,18 @@ const (
|
||||
// Special destination to indicate we're at the end of the path.
|
||||
nullDestination = 0x00
|
||||
|
||||
// (2r + 3)k = (2*5 + 3) * 16 = 208
|
||||
numStreamBytes = 208
|
||||
// (2r + 3)k = (2*5 + 3) * 32 = 416
|
||||
// The number of bytes produced by our CSPRG for the key stream
|
||||
// implementing our stream cipher to encrypt/decrypt the mix header. The
|
||||
// last 2 * securityParameter bytes are only used in order to generate/check
|
||||
// the MAC over the header.
|
||||
numStreamBytes = (2*numMaxHops + 3) * securityParameter
|
||||
|
||||
sharedSecretSize = 32
|
||||
|
||||
// node_id + mac + (2*5-1)*16
|
||||
// 16 + 16 + 144
|
||||
routingInfoSize = 176
|
||||
// node_id + mac + (2*5-1)*32
|
||||
// 32 + 32 + 288
|
||||
routingInfoSize = 352
|
||||
)
|
||||
|
||||
type LnEndpoint string
|
||||
@ -204,8 +208,6 @@ func generateHeaderPadding(numHops int, sharedSecrets [][sharedSecretSize]byte)
|
||||
}
|
||||
|
||||
// CreateForwardingMessage...
|
||||
// TODO(roasbeef): Identifier should also been the same size as the security paramter.
|
||||
// Should probably go with k = 32 then.
|
||||
func CreateForwardingMessage(route []*btcec.PublicKey, dest LnAddr,
|
||||
identifier [securityParameter]byte, message []byte) (*MixHeader, *[messageSize]byte, error) {
|
||||
routeLength := len(route)
|
||||
|
Loading…
x
Reference in New Issue
Block a user