Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Add example #27

Merged
merged 1 commit into from
May 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion apps/garbled/examples/add.mpcl
Original file line number Diff line number Diff line change
@@ -1,12 +1,26 @@
// -*- go -*-
//

// Example of how to add two uint256 values. You can use any data type for the input as long as it is divisible by 8,
// such as uint512.
//
// To run the Evaluator:
//
// ./garbled -e -i 0xb33d6a91b4ca8ac31c639c6742cba5a74c661a63311548af191c298a945d4891 examples/add.mpcl
//
// To run the Garbler:
//
// ./garbled -i 0x5bf6db5927d799cf225f165e9508238edc5a1200fcad08c6411648733eb3100f examples/add.mpcl
//
// The expected result should be:
// 6877051328478326342308659403308568813546041258230645271156059935820089415840 (0x0f3445eadca224923ec2b2c5d7d3c93628c02c642dc251755a3271fdd31058a0)

package main

import (
"math"
)

func main(a, b uint64) uint {
func main(a, b uint256) uint {
return a + b
}
Loading