11 ecdsaverify \- Elliptic Curve Cryptography
19 .B #include <libsec.h>
22 void ecassign(ECdomain *dom, ECpoint *old, ECpoint *new);
25 void ecadd(ECdomain *dom, ECpoint *a, ECpoint *b, ECpoint *s);
28 void ecmul(ECdomain *dom, ECpoint *a, mpint *k, ECpoint *s);
31 ECpoint* strtoec(ECdomain *dom, char *s, char **rptr, ECpoint *p);
34 ECpriv* ecgen(ECdomain *dom, ECpriv *p);
37 int ecverify(ECdomain *dom, ECpoint *p);
40 int ecpubverify(ECdomain *dom, ECpub *p);
43 void ecdsasign(ECdomain *dom, ECpriv *priv, uchar *dig, int dlen, mpint *r, mpint *s);
46 int ecdsaverify(ECdomain *dom, ECpub *pub, uchar *dig, int dlen, mpint *r, mpint *s);
49 These function implement elliptic curve cryptography.
50 An elliptic curve together with cryptographic parameters are specified using a
53 Points on the curve are represented by
57 .BR ecassign ", " ecadd " and " ecmul
58 work analogous to their counterparts in
62 converts a hex string representing an octet string as specified in SEC 1 to a
64 struct. Both uncompressed and compressed formats are supported.
69 it is used to return the position in the string where the parser stopped.
72 space is allocated automatically, else the given struct is used.
77 verify that the given point or public key, resp., is valid.
80 generates a keypair and returns a pointer to it.
83 space is allocated automatically, else the given struct is used.
88 create or verify, resp., a signature using the ECDSA scheme specified in SEC 1.
89 It is absolutely vital that
91 is a cryptographic hash to the message.
93 writes the signature to
95 which are assumed to be allocated properly.
100 for a positive result.
101 Functions returning pointers may return
103 in case of error (e.g. failing
106 .B /sys/src/libsec/ec.c
108 Standards for Efficient Cryptography (SEC) 1: Elliptic Curve Cryptography, Certicom Research, 2009