Skip to content

Commit

Permalink
Tuned debug outputs.
Browse files Browse the repository at this point in the history
  • Loading branch information
markkurossi committed Jan 11, 2024
1 parent 9496e9d commit 92bbc20
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
7 changes: 4 additions & 3 deletions bmr/player.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"github.com/markkurossi/mpc/circuit"
"github.com/markkurossi/mpc/p2p"
"github.com/markkurossi/text/superscript"
"github.com/markkurossi/text/symbols"
)

const (
Expand Down Expand Up @@ -121,7 +122,7 @@ func (p *Player) offlinePhase() error {
fmt.Printf("W%d:\t%v\n", i, wires[i])
}

fmt.Printf("lambda: %v\n", p.lambda.Text(2))
fmt.Printf("%c%s:\t%v\n", symbols.Lambda, p.IDString(), p.lambda.Text(2))

// Step 3: patch output wires and permutation bits for XOR output
// wires.
Expand All @@ -141,7 +142,7 @@ func (p *Player) offlinePhase() error {
lo := li0 ^ li1
p.lambda.SetBit(p.lambda, ow, lo)

fmt.Printf("l[%d]: %v ^ %v = %v\n", ow, li0, li1, lo)
fmt.Printf("%c[%d]: %v ^ %v = %v\n", symbols.Lambda, ow, li0, li1, lo)

// 3.b: set garbled label on wire 0: k_{w,0} = k_{u,0} ⊕ k_{v,0}
wires[ow].L0 = wires[i0].L0
Expand All @@ -156,7 +157,7 @@ func (p *Player) offlinePhase() error {
fmt.Printf("W%d:\t%v\n", i, wires[i])
}

fmt.Printf("lambda: %v\n", p.lambda.Text(2))
fmt.Printf("%c%s:\t%v\n", symbols.Lambda, p.IDString(), p.lambda.Text(2))

return nil
}
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.21
require (
github.com/markkurossi/crypto v0.0.0-20230320090745-b923f1c5109e
github.com/markkurossi/tabulate v0.0.0-20230223130100-d4965869b123
github.com/markkurossi/text v0.0.0-20240109115043-e7c552ffe802
github.com/markkurossi/text v0.0.0-20240111094439-6ab4a36f087d
)

require golang.org/x/text v0.14.0 // indirect
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ github.com/markkurossi/crypto v0.0.0-20230320090745-b923f1c5109e h1:zz+aZRtU/rGv
github.com/markkurossi/crypto v0.0.0-20230320090745-b923f1c5109e/go.mod h1:+mhV8wp86RN6GgVyETgAd6oY+D3xLNESWKty2fGNg5U=
github.com/markkurossi/tabulate v0.0.0-20230223130100-d4965869b123 h1:aGg9ACNKrIa6lZ18dNT9ZsFcXga3obyOAl5Tiyx2txE=
github.com/markkurossi/tabulate v0.0.0-20230223130100-d4965869b123/go.mod h1:qPNWLW3h4173ZWYHjOgJ1wbvNyLuE1fboZilv97Aq7k=
github.com/markkurossi/text v0.0.0-20240109115043-e7c552ffe802 h1:r/qR89k+NXkE0F6iDCJyxP6lWI/NW9SVG+S9L9QANQY=
github.com/markkurossi/text v0.0.0-20240109115043-e7c552ffe802/go.mod h1:NdoMTINXTG7tKD94hd9UevVM9Jtc4o6giWNaoo+sOQ0=
github.com/markkurossi/text v0.0.0-20240111094439-6ab4a36f087d h1:x9hJWGgElhestm6lVc12GGg7+p3rIdqS29tIRCNI5WQ=
github.com/markkurossi/text v0.0.0-20240111094439-6ab4a36f087d/go.mod h1:NdoMTINXTG7tKD94hd9UevVM9Jtc4o6giWNaoo+sOQ0=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=

0 comments on commit 92bbc20

Please sign in to comment.