fix trivial documentation bugs in libsec Reference: /n/sources/patch/maybe/libsecman Date: Mon Jan 24 18:01:49 CET 2011 Signed-off-by: quanstro@quanstro.net --- /sys/src/libsec/port/aes.c Mon Jan 24 16:51:29 2011 +++ /sys/src/libsec/port/aes.c Mon Jan 24 16:51:24 2011 @@ -59,7 +59,7 @@ }, }; -int aes_setupEnc(ulong rk[/*4*(Nr + 1)*/], const uchar cipherKey[], +static int aes_setupEnc(ulong rk[/*4*(Nr + 1)*/], const uchar cipherKey[], int keyBits); static int aes_setupDec(ulong rk[/*4*(Nr + 1)*/], const uchar cipherKey[], int keyBits); @@ -1158,7 +1158,7 @@ * * @return the number of rounds for the given cipher key size. */ -int +static int aes_setupEnc(ulong rk[/*4*(Nr + 1)*/], const uchar cipherKey[], int keyBits) { int i = 0; --- /sys/man/2/aes Mon Jan 24 16:51:36 2011 +++ /sys/man/2/aes Mon Jan 24 16:51:34 2011 @@ -1,6 +1,6 @@ .TH AES 2 .SH NAME -setupAESstate, aesCBCencrypt, aesCBCdecrypt, aesCTRencrypt, aesCTRdecrypt, setupAESXCBCstate, aesXCBCmac - advanced encryption standard (rijndael) +aes_encrypt, aes_decrypt, setupAESstate, aesCBCencrypt, aesCBCdecrypt, aesCTRencrypt, aesCTRdecrypt, setupAESXCBCstate, aesXCBCmac - advanced encryption standard (rijndael) .SH SYNOPSIS .B #include .br @@ -13,10 +13,10 @@ .in +0.5i .ti -0.5i .B -void aes_encrypt(ulong rk[], int Nr, uchar pt[16], uchar ct[16]); +void aes_encrypt(ulong rk[], int Nr, uchar pt[16], uchar ct[16]) .PP .B -void aes_decrypt(ulong rk[], int Nr, uchar ct[16], uchar pt[16]); +void aes_decrypt(ulong rk[], int Nr, uchar ct[16], uchar pt[16]) .PP .B void setupAESstate(AESstate *s, uchar key[], int keybytes, uchar *ivec) --- /sys/man/2/rsa Mon Jan 24 16:51:43 2011 +++ /sys/man/2/rsa Mon Jan 24 16:51:42 2011 @@ -1,18 +1,23 @@ .TH RSA 2 .SH NAME asn1dump, +asn1toDSApriv, asn1toRSApriv, decodePEM, +decodepemchain, rsadecrypt, rsaencrypt, +rsafill rsagen, rsaprivalloc, rsaprivfree, rsaprivtopub, rsapuballoc, rsapubfree, -X509toRSApub, +X509dump, X509gen, +X509req, +X509toRSApub, X509verify \- RSA encryption algorithm .SH SYNOPSIS .B #include @@ -25,6 +30,9 @@ .PP .ta +\w'\fLRSApriv* \fP'u .B +RSApriv* rsafill(mpint *n, mpint *e, mpint *d, mpint *p, mpint *q) +.PP +.B RSApriv* rsagen(int nlen, int elen, int nrep) .PP .B @@ -52,6 +60,9 @@ RSApub* X509toRSApub(uchar *cert, int ncert, char *name, int nname) .PP .B +RSApriv* asn1toDSApriv(uchar *priv, int npriv) +.PP +.B RSApriv* asn1toRSApriv(uchar *priv, int npriv) .PP .B @@ -61,6 +72,12 @@ uchar* decodePEM(char *s, char *type, int *len, char **new_s) .PP .B +PEMChain* decodepemchain(char *s, char *type) +.PP +.B +void X509dump(uchar *cert, int ncert) +.PP +.B uchar* X509gen(RSApriv *priv, char *subj, ulong valid[2], int *certlen); .PP .B @@ -113,6 +130,9 @@ .I Rsagen returns a newly allocated structure containing both public and private keys. +The key's !kp, !kq, and !c2 attributes may be regenerated +with +.IR rsafill. .I Rsaprivtopub returns a newly allocated copy of the public key corresponding to the private key. @@ -171,11 +191,17 @@ .I tokenize in .IR getfields (2). +.I X509dump +prints a human-readble version of the certificate. .PP -.I Asn1toRSApriv +.I Asn1toDSApriv +and +.I asn1toRSApriv converts an ASN1 formatted RSA private key into the corresponding +.B DSApriv +or .B RSApriv -structure. +structure, respectively. .PP .I Asn1dump prints an ASN1 object to standard output. @@ -203,6 +229,11 @@ is set to the first character beyond the .I type section. +.I Pemdecodechain +decodes a full certificate chain. Each +link is +.IR malloc ed +storage. .SH SOURCE .B /sys/src/libsec .SH SEE ALSO