ElGamal — Applying Multiple Public Key Operations (ECC)
We hardly ever use discrete logs these days, as Elliptic Curve Cryptography is just so much more efficient and faster. And, so I love converting discrete log proofs with Elliptic Curve methods. Basically, we convert a power into a multiplicative operation for the base point:
and where G is the base point of the curve. Then a multiplication is replaced with a point addition, and a division is replaced with a point subtraction:
Now, here’s an example. On the left hand side we have the discrete log proof, and the right hand side has the equivalent elliptic curve proof:
Coding
The coding is [here]:
package main
import (
"fmt"
"os"
"go.dedis.ch/kyber/v3/group/edwards25519"
"go.dedis.ch/kyber/v3/util/random"
)
func main() {
message:="Testing"
argCount := len(os.Args[1:])
if (argCount>0) {message= string(os.Args[1])}
suite := edwards25519.NewBlakeSHA256Ed25519()
// Alice's key pair (x,Y)
x := suite.Scalar().Pick(suite.RandomStream())
Y := suite.Point().Mul(x, nil)
M := suite.Point().Embed([]byte(message)…