-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #27 from hextrust-0/update-add-example
Update Add example
- Loading branch information
Showing
1 changed file
with
15 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |