p
where a = -1
and d = - 121665/121666
(Bx, By)
where By = 4/5
. Here the /
operator represents the inverse modulo operation wrt p
. Hence By = 4*mod_inverse(5,p) => By = 46316835694926478169428394003475163141307993866256225615783033603165251855960
By
in the curve equation to calculate Bx = 15112221349535400772501151409588531511454012693041857206046113283949847762202
P + Q = R
. R is calculated as follows:-P + Q = R
Q =k*P
where k is a constant under mod p. Scalar multiplication is defined as the repeated addition of pts:- Q
in log(k)
steps. Since max(k) < 2^255-19
, we need to perform a max of log(2^255-19) ~ 255
steps to calculate a scalar multiple.privKey
pubKey = privKey * B
where B
is the base pt as defined abovemsg
+ the signer's ED25519 public key pubKey
+ the ED25519 signature {R, s}
and produces as output a boolean value (valid
or invalid
signature). Here s
is a scalar, and R
is a pt on the curve. ED25519 verification works as follows (with minor simplifications):EdDSA_signature_verify(msg, pubKey, signature { R, s } ) --> valid / invalid
h = SHA512(R + pubKey + msg) mod q
P1 = s * B
P2 = R + h * pubKey
P1 == P2
q
is the curve order. q = 2^252 + 27742317777372353535851937790883648493
pubKey
as an input to SHA512 as pubKey
is a curve point (not a scalar). pubkey
in this step is represented as a "compressed" curve pt i.e only the y-coordinate. In step, 3, pubkey
is used as a curve point.