Skip to content

Commit

Permalink
Optimized sender memory usage.
Browse files Browse the repository at this point in the history
  • Loading branch information
markkurossi committed Feb 20, 2023
1 parent df78ac2 commit ccac177
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions ot/co.go
Original file line number Diff line number Diff line change
Expand Up @@ -290,17 +290,22 @@ func (co *CO) Send(wires []Wire) error {
AaInvx := big.NewInt(0).Set(Aax)
AaInvy := big.NewInt(0).Sub(curveParams.P, Aay)

BxRaw := big.NewInt(0)
ByRaw := big.NewInt(0)

for i := 0; i < len(wires); i++ {
Bx, err := ReceiveBigInt(co.io)
data, err := co.io.ReceiveData()
if err != nil {
return err
}
By, err := ReceiveBigInt(co.io)
BxRaw.SetBytes(data)
data, err = co.io.ReceiveData()
if err != nil {
return err
}
ByRaw.SetBytes(data)

Bx, By = co.curve.ScalarMult(Bx, By, aBytes)
Bx, By := co.curve.ScalarMult(BxRaw, ByRaw, aBytes)
Bax, Bay := co.curve.Add(Bx, By, AaInvx, AaInvy)

var labelData LabelData
Expand Down

0 comments on commit ccac177

Please sign in to comment.