Skip to content

Commit 87fe664

Browse files
joostjagerGeorgeTsagk
authored andcommitted
sphinx: export GenerateSharedSecret
1 parent 540d603 commit 87fe664

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

crypto.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -234,18 +234,18 @@ func chacha20polyDecrypt(key, cipherTxt []byte) ([]byte, error) {
234234
//
235235
// TODO(roasbef): rename?
236236
type sharedSecretGenerator interface {
237-
// generateSharedSecret given a public key, generates a shared secret
237+
// GenerateSharedSecret given a public key, generates a shared secret
238238
// using private data of the underlying sharedSecretGenerator.
239-
generateSharedSecret(dhKey *btcec.PublicKey) (Hash256, error)
239+
GenerateSharedSecret(dhKey *btcec.PublicKey) (Hash256, error)
240240
}
241241

242-
// generateSharedSecret generates the shared secret using the given ephemeral
242+
// GenerateSharedSecret generates the shared secret using the given ephemeral
243243
// pub key and the Router's private key. If a blindingPoint is provided then it
244244
// is used to tweak the Router's private key before creating the shared secret
245245
// with the ephemeral pub key. The blinding point is used to determine our
246246
// shared secret with the receiver. From that we can determine our shared
247247
// secret with the sender using the dhKey.
248-
func (r *Router) generateSharedSecret(dhKey,
248+
func (r *Router) GenerateSharedSecret(dhKey,
249249
blindingPoint *btcec.PublicKey) (Hash256, error) {
250250

251251
// If no blinding point is provided, then the un-tweaked dhKey can

sphinx.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ func (r *Router) ProcessOnionPacket(onionPkt *OnionPacket, assocData []byte,
546546
}
547547

548548
// Compute the shared secret for this onion packet.
549-
sharedSecret, err := r.generateSharedSecret(
549+
sharedSecret, err := r.GenerateSharedSecret(
550550
onionPkt.EphemeralKey, cfg.blindingPoint,
551551
)
552552
if err != nil {
@@ -587,7 +587,7 @@ func (r *Router) ReconstructOnionPacket(onionPkt *OnionPacket, assocData []byte,
587587
}
588588

589589
// Compute the shared secret for this onion packet.
590-
sharedSecret, err := r.generateSharedSecret(
590+
sharedSecret, err := r.GenerateSharedSecret(
591591
onionPkt.EphemeralKey, cfg.blindingPoint,
592592
)
593593
if err != nil {
@@ -780,7 +780,7 @@ func (t *Tx) ProcessOnionPacket(seqNum uint16, onionPkt *OnionPacket,
780780
}
781781

782782
// Compute the shared secret for this onion packet.
783-
sharedSecret, err := t.router.generateSharedSecret(
783+
sharedSecret, err := t.router.GenerateSharedSecret(
784784
onionPkt.EphemeralKey, cfg.blindingPoint,
785785
)
786786
if err != nil {

0 commit comments

Comments
 (0)