11 ecdsaverify \- elliptic curve cryptography
19 .B #include <libsec.h>
22 void ecdominit(ECdomain *dom, void (*init)(mpint *p, mpint *a, mpint *b, mpint *x, mpint *y, mpint *n, mpint *h));
25 void ecdomfree(ECdomain *dom);
28 void ecassign(ECdomain *dom, ECpoint *old, ECpoint *new);
31 void ecadd(ECdomain *dom, ECpoint *a, ECpoint *b, ECpoint *s);
34 void ecmul(ECdomain *dom, ECpoint *a, mpint *k, ECpoint *s);
37 ECpoint* strtoec(ECdomain *dom, char *s, char **rptr, ECpoint *p);
40 ECpriv* ecgen(ECdomain *dom, ECpriv *p);
43 int ecverify(ECdomain *dom, ECpoint *p);
46 int ecpubverify(ECdomain *dom, ECpub *p);
49 void ecdsasign(ECdomain *dom, ECpriv *priv, uchar *dig, int dlen, mpint *r, mpint *s);
52 int ecdsaverify(ECdomain *dom, ECpub *pub, uchar *dig, int dlen, mpint *r, mpint *s);
55 These functions implement elliptic curve cryptography.
56 An elliptic curve together with cryptographic parameters are specified using an
59 Points on the curve are represented by
70 which fills in the parameters of the curve.
73 frees the parameters of the curve and zeros the struct. It does
74 not free the memory of the struct itself.
76 .BR ecassign ", " ecadd " and " ecmul
77 are analogous to their counterparts in
81 converts a hex string representing an octet string as specified in
82 .I Standards for Efficient Cryptography (SEC) 1
85 struct. Both uncompressed and compressed formats are supported.
90 it is used to return the position in the string where the parser stopped.
93 space is allocated automatically, else the given struct is used.
98 verify that the given point or public key, respectively, is valid.
101 generates a keypair and returns a pointer to it.
104 space is allocated automatically, else the given struct is used.
109 create or verify, respectively, a signature using the ECDSA scheme specified in
111 It is absolutely vital that
113 is a cryptographic hash to the message.
115 writes the signature to
117 which are assumed to be allocated properly.
122 for a positive result.
123 Functions returning pointers may return
130 .B /sys/src/libsec/port/ecc.c
133 Standards for Efficient Cryptography (SEC) 1: Elliptic Curve Cryptography
134 - Certicom Research, 2009
136 This implementation of elliptic curve cryptography first appeared in 9front (June, 2012).