1
0
Fork 0
mirror of synced 2025-09-23 12:18:44 +00:00

format, add changelog

This commit is contained in:
dark64 2023-10-04 18:33:09 +02:00
parent 2108ad4e51
commit e84ff7ac69
5 changed files with 8 additions and 11 deletions

View file

@ -0,0 +1 @@
Add jubjub to stdlib (collab with @alvaro-alonso)

View file

@ -4,7 +4,6 @@ import "./proofOfOwnership" as edwardsProofOfOwnership;
import "./verifyEddsa" as edwardsSignature;
import "utils/pack/bool/nonStrictUnpack256" as unpack256;
// The `a` coefficient of the twisted Edwards curve
const field EDWARDS_A = 168700;
@ -19,19 +18,14 @@ const field[2] G = [
const u32 bit_size = 254;
def proofOfOwnership(field[2] pk, field sk) -> bool {
return edwardsProofOfOwnership(pk, sk, G, EDWARDS_A, EDWARDS_D, bit_size);
}
def verifyEddsa(field[2] R, field S, field[2] A, u32[8] M0, u32[8] M1) -> bool {
return edwardsSignature(R, S, A, M0, M1, G, EDWARDS_A, EDWARDS_D, bit_size);
}
def compress(field[2] pt) -> bool[256] {
field x = pt[0];
field y = pt[1];

View file

@ -3,7 +3,6 @@
import "./proofOfOwnership" as edwardsProofOfOwnership;
import "./verifyEddsa" as edwardsSignature;
// The `a` coefficient of the twisted Edwards curve
const field EDWARDS_A = -1;
@ -18,14 +17,10 @@ const field[2] G = [
const u32 bit_size = 255;
def proofOfOwnership(field[2] pk, field sk) -> bool {
return edwardsProofOfOwnership(pk, sk, G, EDWARDS_A, EDWARDS_D, bit_size);
}
def verifyEddsa(field[2] R, field S, field[2] A, u32[8] M0, u32[8] M1) -> bool {
return edwardsSignature(R, S, A, M0, M1, G, EDWARDS_A, EDWARDS_D, bit_size);
}

View file

@ -11,6 +11,10 @@ from "ecc/edwards" import scalarMul;
/// Arguments:
/// pk: Curve point (public key)
/// sk: Private key
/// G: Generator point
/// EDWARDS_A: Coefficient `a` of the twisted Edwards curve
/// EDWARDS_D: Coefficient `d` of the twisted Edwards curve
/// bit_size: Bit size of the twisted Edwards curve
///
/// Returns true for pk/sk being a valid keypair, false otherwise.
def main(field[2] pk, field sk, field[2] G, field EDWARDS_A, field EDWARDS_D, u32 bit_size) -> bool {

View file

@ -21,6 +21,9 @@ from "ecc/edwards" import add, scalarMul, onCurve, orderCheck;
/// A: Curve point. Public part of the key used to create S.
/// M0: 256bit array. First 256bits of the message used to create S.
/// M1: 256bit array. Trailing 256bits of the message used to create S.
/// EDWARDS_A: Coefficient `a` of the twisted Edwards curve
/// EDWARDS_D: Coefficient `d` of the twisted Edwards curve
/// bit_size: Bit size of the twisted Edwards curve
///
/// Returns:
/// Return true for S being a valid EdDSA Signature, false otherwise.