Skip to content

Commit a6d3a55

Browse files
committed
sphinx: remove encode/decode methods from onion obfuscation structs
In this commit we remove the encode/decode methods from the structs use to decrypt/encrypt errors within the network as they’re not longer needed.
1 parent fadc953 commit a6d3a55

File tree

1 file changed

+0
-20
lines changed

1 file changed

+0
-20
lines changed

obfuscation.go

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -71,16 +71,6 @@ func (o *OnionObfuscator) Obfuscate(initial bool, data []byte) []byte {
7171
return onionObfuscation(o.sharedSecret, data)
7272
}
7373

74-
// Decode initializes the obfuscator from the byte stream.
75-
func (o *OnionObfuscator) Decode(r io.Reader) error {
76-
_, err := r.Read(o.sharedSecret[:])
77-
return err
78-
}
79-
80-
// Encode writes converted obfuscator in the byte stream.
81-
func (o *OnionObfuscator) Encode(w io.Writer) error {
82-
_, err := w.Write(o.sharedSecret[:])
83-
return err
8474
}
8575

8676
// Circuit is used encapsulate the data which is needed for data deobfuscation.
@@ -236,13 +226,3 @@ func (o *OnionDeobfuscator) Deobfuscate(obfuscatedData []byte) (*btcec.PublicKey
236226

237227
return sender, msg, nil
238228
}
239-
240-
// Decode writes converted deobfucator in the byte stream.
241-
func (o *OnionDeobfuscator) Decode(r io.Reader) error {
242-
return o.circuit.Decode(r)
243-
}
244-
245-
// Encode writes converted deobfucator in the byte stream.
246-
func (o *OnionDeobfuscator) Encode(w io.Writer) error {
247-
return o.circuit.Encode(w)
248-
}

0 commit comments

Comments
 (0)