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 functions implement elliptic curve cryptography.
50 An elliptic curve together with cryptographic parameters are specified using an
53 Points on the curve are represented by
57 .BR ecassign ", " ecadd " and " ecmul
58 are analogous to their counterparts in
62 converts a hex string representing an octet string as specified in
63 .I Standards for Efficient Cryptography (SEC) 1
66 struct. Both uncompressed and compressed formats are supported.
71 it is used to return the position in the string where the parser stopped.
74 space is allocated automatically, else the given struct is used.
79 verify that the given point or public key, respectively, is valid.
82 generates a keypair and returns a pointer to it.
85 space is allocated automatically, else the given struct is used.
90 create or verify, respectively, a signature using the ECDSA scheme specified in
92 It is absolutely vital that
94 is a cryptographic hash to the message.
96 writes the signature to
98 which are assumed to be allocated properly.
103 for a positive result.
104 Functions returning pointers may return
111 .B /sys/src/libsec/port/ecc.c
114 Standards for Efficient Cryptography (SEC) 1: Elliptic Curve Cryptography
115 - Certicom Research, 2009
117 This implementation of elliptic curve cryptography first appeared in 9front (June, 2012).