diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2016-02-01 21:34:49 +0100 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2016-02-01 21:34:49 +0100 |
commit | a291bbdeddfd41a2f0907ecbd7b819f0eedffdaf (patch) | |
tree | c5dd22efd770099846596d546dd36ba4b2d7ffc6 /sys/include/libsec.h | |
parent | 0bfac109a491e61d7cd585060b88e1251da1e928 (diff) |
libsec: ecdsa client support for tlshand, cleanups
Diffstat (limited to 'sys/include/libsec.h')
-rw-r--r-- | sys/include/libsec.h | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/sys/include/libsec.h b/sys/include/libsec.h index 204ca4d26..09db4f0f0 100644 --- a/sys/include/libsec.h +++ b/sys/include/libsec.h @@ -339,11 +339,11 @@ RSApriv* asn1toRSApriv(uchar*, int); void asn1dump(uchar *der, int len); uchar* decodePEM(char *s, char *type, int *len, char **new_s); PEMChain* decodepemchain(char *s, char *type); -uchar* X509gen(RSApriv *priv, char *subj, ulong valid[2], int *certlen); -uchar* X509req(RSApriv *priv, char *subj, int *certlen); -char* X509verifydigest(uchar *sig, int siglen, uchar *edigest, int edigestlen, RSApub *pk); -char* X509verifydata(uchar *sig, int siglen, uchar *data, int datalen, RSApub *pk); -char* X509verify(uchar *cert, int ncert, RSApub *pk); +uchar* X509rsagen(RSApriv *priv, char *subj, ulong valid[2], int *certlen); +uchar* X509rsareq(RSApriv *priv, char *subj, int *certlen); +char* X509rsaverifydigest(uchar *sig, int siglen, uchar *edigest, int edigestlen, RSApub *pk); +char* X509rsaverify(uchar *cert, int ncert, RSApub *pk); + void X509dump(uchar *cert, int ncert); /* @@ -487,11 +487,14 @@ typedef struct ECdomain{ mpint *p; mpint *a; mpint *b; - ECpoint *G; + ECpoint G; mpint *n; mpint *h; } ECdomain; +void ecdominit(ECdomain *, void (*init)(mpint *p, mpint *a, mpint *b, mpint *x, mpint *y, mpint *n, mpint *h)); +void ecdomfree(ECdomain *); + void ecassign(ECdomain *, ECpoint *old, ECpoint *new); void ecadd(ECdomain *, ECpoint *a, ECpoint *b, ECpoint *s); void ecmul(ECdomain *, ECpoint *a, mpint *k, ECpoint *s); @@ -504,6 +507,18 @@ int ecdsaverify(ECdomain *, ECpub *, uchar *, int, mpint *, mpint *); void base58enc(uchar *, char *, int); int base58dec(char *, uchar *, int); +ECpub* ecdecodepub(ECdomain *dom, uchar *, int); +int ecencodepub(ECdomain *dom, ECpub *, uchar *, int); +void ecpubfree(ECpub *); + +ECpub* X509toECpub(uchar *cert, int ncert, ECdomain *dom); +char* X509ecdsaverifydigest(uchar *sig, int siglen, uchar *edigest, int edigestlen, ECdomain *dom, ECpub *pub); +char* X509ecdsaverify(uchar *sig, int siglen, ECdomain *dom, ECpub *pub); + +/* curves */ +void secp256r1(mpint *p, mpint *a, mpint *b, mpint *x, mpint *y, mpint *n, mpint *h); +void secp256k1(mpint *p, mpint *a, mpint *b, mpint *x, mpint *y, mpint *n, mpint *h); + DigestState* ripemd160(uchar *, ulong, uchar *, DigestState *); /* |