mirror of
https://github.com/QuilibriumNetwork/ceremonyclient.git
synced 2026-02-22 02:47:26 +08:00
36 lines
478 B
Go
36 lines
478 B
Go
// -*- go -*-
|
|
//
|
|
|
|
package main
|
|
|
|
import (
|
|
"crypto/rsa"
|
|
)
|
|
|
|
// d: 0x321af139
|
|
// n: 0xd60b2b09
|
|
// e: 0x10001
|
|
//
|
|
// private: d, e
|
|
// public: n, e
|
|
|
|
// msg: 0x6d7472
|
|
// cipher: 0x61f9ef88
|
|
|
|
type Size = uint32
|
|
|
|
type Garbler struct {
|
|
msg Size
|
|
privShare Size
|
|
pubN Size
|
|
pubE Size
|
|
}
|
|
|
|
// @Test 0x6d7472 0x321af130 0xd60b2b09 0x10001 9 = 0x55a83b79
|
|
func main(g Garbler, privShare Size) uint {
|
|
|
|
priv := g.privShare + privShare
|
|
|
|
return rsa.Decrypt(g.msg, priv, g.pubN)
|
|
}
|