Skip to content

Commit

Permalink
remove babyjubjub new point references and modify the number of ciphe…
Browse files Browse the repository at this point in the history
…rtext that a ciphertexts struct includes
  • Loading branch information
lucasmenendez committed Jan 7, 2025
1 parent ba1eee8 commit 8d5b0ca
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions elgamal/ciphertext.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
package elgamal

import (
"math/big"

ecc_tweds "github.com/consensys/gnark-crypto/ecc/twistededwards"
"github.com/consensys/gnark/frontend"
"github.com/consensys/gnark/std/algebra/native/twistededwards"
"github.com/iden3/go-iden3-crypto/babyjub"
)

const NumCiphertexts = 2
const NumCiphertexts = 8

type Ciphertexts [NumCiphertexts]Ciphertext

Expand Down Expand Up @@ -63,8 +64,8 @@ type Ciphertext struct {
}

func NewCiphertext() *Ciphertext {
zero := babyjub.NewPoint()
return &Ciphertext{C1: twistededwards.Point{X: zero.X, Y: zero.Y}, C2: twistededwards.Point{X: zero.X, Y: zero.Y}}
zero := twistededwards.Point{X: big.NewInt(0), Y: big.NewInt(1)}
return &Ciphertext{C1: zero, C2: zero}
}

// Add sets z to the sum x+y and returns z.
Expand Down

0 comments on commit 8d5b0ca

Please sign in to comment.