init: v1.0.0

This commit is contained in:
yaole
2026-05-27 23:03:00 +08:00
commit 8d97f750eb
466 changed files with 80067 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
package x
import (
"crypto/rand"
"testing"
"github.com/stretchr/testify/assert"
"xdx.jelly/xgcl/grand"
)
func TestPaillier(t *testing.T) {
// pk, sk := GenerateKey(1024)
sk, pk, err := GenerateKey(2048)
assert.Nil(t, err)
m, _ := rand.Int(grand.Reader, pk.N)
c, _ := Encrypt(m, pk, grand.Reader)
m1, _ := Decrypt(c, sk)
assert.Zero(t, m.Cmp(m1))
}