lib25519-20230630/0000755000000000000000000000000014447527046011642 5ustar rootrootlib25519-20230630/.reuse/0000755000000000000000000000000014447527040013035 5ustar rootrootlib25519-20230630/.reuse/dep50000644000000000000000000000044114447527040013614 0ustar rootrootFiles: * Copyright: 2022-2023 Kaushik Nath Copyright: 2011-2023 Daniel J. Bernstein Copyright: 2015 Tung Chou Copyright: 2011-2014 Peter Schwabe Copyright: 2011 Niels Duif Copyright: 2011 Tanja Lange Copyright: 2011 Bo-Yin Yang License: LicenseRef-PD-hp OR CC0-1.0 OR 0BSD OR MIT-0 OR MIT lib25519-20230630/LICENSES/0000755000000000000000000000000014447527040013041 5ustar rootrootlib25519-20230630/LICENSES/0BSD.txt0000644000000000000000000000123414447527040014272 0ustar rootrootBSD Zero Clause License Copyright (C) YEAR by AUTHOR EMAIL Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. lib25519-20230630/LICENSES/CC0-1.0.txt0000644000000000000000000001561014447527040014446 0ustar rootrootCreative Commons Legal Code CC0 1.0 Universal CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED HEREUNDER. Statement of Purpose The laws of most jurisdictions throughout the world automatically confer exclusive Copyright and Related Rights (defined below) upon the creator and subsequent owner(s) (each and all, an "owner") of an original work of authorship and/or a database (each, a "Work"). Certain owners wish to permanently relinquish those rights to a Work for the purpose of contributing to a commons of creative, cultural and scientific works ("Commons") that the public can reliably and without fear of later claims of infringement build upon, modify, incorporate in other works, reuse and redistribute as freely as possible in any form whatsoever and for any purposes, including without limitation commercial purposes. These owners may contribute to the Commons to promote the ideal of a free culture and the further production of creative, cultural and scientific works, or to gain reputation or greater distribution for their Work in part through the use and efforts of others. For these and/or other purposes and motivations, and without any expectation of additional consideration or compensation, the person associating CC0 with a Work (the "Affirmer"), to the extent that he or she is an owner of Copyright and Related Rights in the Work, voluntarily elects to apply CC0 to the Work and publicly distribute the Work under its terms, with knowledge of his or her Copyright and Related Rights in the Work and the meaning and intended legal effect of CC0 on those rights. 1. Copyright and Related Rights. A Work made available under CC0 may be protected by copyright and related or neighboring rights ("Copyright and Related Rights"). Copyright and Related Rights include, but are not limited to, the following: i. the right to reproduce, adapt, distribute, perform, display, communicate, and translate a Work; ii. moral rights retained by the original author(s) and/or performer(s); iii. publicity and privacy rights pertaining to a person's image or likeness depicted in a Work; iv. rights protecting against unfair competition in regards to a Work, subject to the limitations in paragraph 4(a), below; v. rights protecting the extraction, dissemination, use and reuse of data in a Work; vi. database rights (such as those arising under Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, and under any national implementation thereof, including any amended or successor version of such directive); and vii. other similar, equivalent or corresponding rights throughout the world based on applicable law or treaty, and any national implementations thereof. 2. Waiver. To the greatest extent permitted by, but not in contravention of, applicable law, Affirmer hereby overtly, fully, permanently, irrevocably and unconditionally waives, abandons, and surrenders all of Affirmer's Copyright and Related Rights and associated claims and causes of action, whether now known or unknown (including existing as well as future claims and causes of action), in the Work (i) in all territories worldwide, (ii) for the maximum duration provided by applicable law or treaty (including future time extensions), (iii) in any current or future medium and for any number of copies, and (iv) for any purpose whatsoever, including without limitation commercial, advertising or promotional purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each member of the public at large and to the detriment of Affirmer's heirs and successors, fully intending that such Waiver shall not be subject to revocation, rescission, cancellation, termination, or any other legal or equitable action to disrupt the quiet enjoyment of the Work by the public as contemplated by Affirmer's express Statement of Purpose. 3. Public License Fallback. Should any part of the Waiver for any reason be judged legally invalid or ineffective under applicable law, then the Waiver shall be preserved to the maximum extent permitted taking into account Affirmer's express Statement of Purpose. In addition, to the extent the Waiver is so judged Affirmer hereby grants to each affected person a royalty-free, non transferable, non sublicensable, non exclusive, irrevocable and unconditional license to exercise Affirmer's Copyright and Related Rights in the Work (i) in all territories worldwide, (ii) for the maximum duration provided by applicable law or treaty (including future time extensions), (iii) in any current or future medium and for any number of copies, and (iv) for any purpose whatsoever, including without limitation commercial, advertising or promotional purposes (the "License"). The License shall be deemed effective as of the date CC0 was applied by Affirmer to the Work. Should any part of the License for any reason be judged legally invalid or ineffective under applicable law, such partial invalidity or ineffectiveness shall not invalidate the remainder of the License, and in such case Affirmer hereby affirms that he or she will not (i) exercise any of his or her remaining Copyright and Related Rights in the Work or (ii) assert any associated claims and causes of action with respect to the Work, in either case contrary to Affirmer's express Statement of Purpose. 4. Limitations and Disclaimers. a. No trademark or patent rights held by Affirmer are waived, abandoned, surrendered, licensed or otherwise affected by this document. b. Affirmer offers the Work as-is and makes no representations or warranties of any kind concerning the Work, express, implied, statutory or otherwise, including without limitation warranties of title, merchantability, fitness for a particular purpose, non infringement, or the absence of latent or other defects, accuracy, or the present or absence of errors, whether or not discoverable, all to the greatest extent permissible under applicable law. c. Affirmer disclaims responsibility for clearing rights of other persons that may apply to the Work or any use thereof, including without limitation any person's Copyright and Related Rights in the Work. Further, Affirmer disclaims responsibility for obtaining any necessary consents, permissions or other rights required for any use of the Work. d. Affirmer understands and acknowledges that Creative Commons is not a party to this document and has no duty or obligation with respect to this CC0 or use of the Work. lib25519-20230630/LICENSES/LicenseRef-PD-hp.txt0000644000000000000000000000006314447527040016526 0ustar rootrootThis work is hereby placed into the public domain. lib25519-20230630/LICENSES/MIT-0.txt0000644000000000000000000000162314447527040014372 0ustar rootrootMIT No Attribution Copyright Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. lib25519-20230630/LICENSES/MIT.txt0000644000000000000000000000212514447527040014233 0ustar rootrootMIT License Copyright (c) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. lib25519-20230630/Makefile0000644000000000000000000000015014447527040013270 0ustar rootrootdefault: cd build && $(MAKE) install: cd build && $(MAKE) install clean: cd build && $(MAKE) clean lib25519-20230630/api0000644000000000000000000001015714447527040012334 0ustar rootrootcrypto_verify/32 #define crypto_verify_32_BYTES 32 int crypto_verify(const unsigned char *,const unsigned char *); crypto_hashblocks/sha512 f0bc623a9033f9f648336540e11e85be21aeb60905c7d8808d10ea20b39d58d1 f1a2c46c9ce7fa4cd22f180907d77b6f7189badef4b9a1b5284d6fb9db859b76 #define crypto_hashblocks_sha512_STATEBYTES 64 #define crypto_hashblocks_sha512_BLOCKBYTES 128 int crypto_hashblocks(unsigned char *,const unsigned char *,long long); crypto_hash/sha512 8220572f58bd4730be165c9739d8d4b0fd2e0229dbe01e25b4aed23f00f23b70 c1e322b7cbfc941260c5508967ba05bce22eeee94d425e708b7c3301ea1d5e2e #define crypto_hash_sha512_BYTES 64 void crypto_hash(unsigned char *,const unsigned char *,long long); crypto_pow/inv25519 ad2062946e82718da820226504991a85c5fe56bdbff959c1313f837ee13b37be 59b3045a01e1fca2a86a0280aee8b985c5e040afdc0d3e85ed87eb97a46a4dd6 #define crypto_pow_inv25519_BYTES 32 void crypto_pow(unsigned char *,const unsigned char *); crypto_powbatch/inv25519 45b0b9dfeb75a7599064cbcd4fb3a5616105fe80f1dc7bf5258de9d1cb48c8e6 9640b3e6b144ed3ef470ab7c8a24c30c18d951f36ca19890224c1ea3d7703317 #define crypto_powbatch_inv25519_BYTES 32 void crypto_powbatch(unsigned char *,const unsigned char *,long long); crypto_nP/montgomery25519 b861d66109b42359e5994ed57ae566827c345b65a9d0671700320b82888397ec 740924011f3448f65299f61b087f74a6eb9651a4203dfbf621d2bec54e149405 #define crypto_nP_montgomery25519_SCALARBYTES 32 #define crypto_nP_montgomery25519_POINTBYTES 32 void crypto_nP(unsigned char *,const unsigned char *,const unsigned char *); crypto_nPbatch/montgomery25519 70ad918d115325afd930af794ffaa7941a917fcda4f80a02079566e6164fa970 a0b24a12c2f75852961141d12324d5ee943e8200fcba97c56ce239362e4cdda3 #define crypto_nPbatch_montgomery25519_SCALARBYTES 32 #define crypto_nPbatch_montgomery25519_POINTBYTES 32 void crypto_nPbatch(unsigned char *,const unsigned char *,const unsigned char *,long long); crypto_nG/merged25519 a4e761839798a07817484e97605bd63215b4938934ed9ce01935bbced48155bc 0a01c09fc8a8c7e8c18f841b2e1b2da9c156868737d194d223b03531cf2db731 #define crypto_nG_merged25519_SCALARBYTES 32 #define crypto_nG_merged25519_POINTBYTES 32 crypto_nG/montgomery25519 5c8a5d8b32e3d26b33071779ce9191095d7bd4ab3bb6a40b68976e41a98cfc3b 2becc8cd065820fcf82e53a03c5b5235582480fc11d072f2bd15153aebd4e057 #define crypto_nG_montgomery25519_SCALARBYTES 32 #define crypto_nG_montgomery25519_POINTBYTES 32 void crypto_nG(unsigned char *,const unsigned char *); crypto_mGnP/ed25519 dc80be44fb0d482c5ae430779e76fe612c53fcd9e5847254bf27ab34e90745f4 9e1a3b7015c8fdb12763fd88494f5bfe9e2565ead4d3407d5ecf7ff6ca24c1d0 #define crypto_mGnP_ed25519_MBYTES 32 #define crypto_mGnP_ed25519_NBYTES 64 #define crypto_mGnP_ed25519_PBYTES 32 #define crypto_mGnP_ed25519_OUTPUTBYTES 33 void crypto_mGnP(unsigned char *,const unsigned char *,const unsigned char *,const unsigned char *); crypto_multiscalar/ed25519 4835e913d35c3c10ad459c2154c0b2041f0621b3f4f837b86f41d7c37917864b b0c5400d6d1550c8f56869e0fdf87a524c523f7fd2c59701a9982f1c90f6d6bc #define crypto_multiscalar_ed25519_SCALARBYTES 32 #define crypto_multiscalar_ed25519_POINTBYTES 32 #define crypto_multiscalar_ed25519_OUTPUTBYTES 33 void crypto_multiscalar(unsigned char *,const unsigned char *,const unsigned char *,long long); crypto_dh/x25519 2c8a73ec86d5d4c4bc838f49cfd78c87b60b534ae6fff59ce3bea0c32cdc1450 b09016b3a1371786b46a183085133338159e623c5eb9cbc5eaa4f8b62d6c5aea #define crypto_dh_x25519_SECRETKEYBYTES 32 #define crypto_dh_x25519_PUBLICKEYBYTES 32 #define crypto_dh_x25519_BYTES 32 void crypto_dh_keypair(unsigned char *,unsigned char *); void crypto_dh(unsigned char *,const unsigned char *,const unsigned char *); crypto_sign/ed25519 ce11fd7c1eac4dd0bc5eec49b26ad1e91aef696fae50ce377dbd806dc394da01 2ed857f17c917a8185e6c296303a11772ae45683a5e7cb5b095489bad65fffde #define crypto_sign_ed25519_SECRETKEYBYTES 64 #define crypto_sign_ed25519_PUBLICKEYBYTES 32 #define crypto_sign_ed25519_BYTES 64 void crypto_sign_keypair(unsigned char *,unsigned char *); void crypto_sign(unsigned char *,long long *,const unsigned char *,long long,const unsigned char *); int crypto_sign_open(unsigned char *,long long *,const unsigned char *,long long,const unsigned char *); lib25519-20230630/autogen/0000755000000000000000000000000014447527046013304 5ustar rootrootlib25519-20230630/autogen/cli0000755000000000000000000001565214447527040014004 0ustar rootroot#!/usr/bin/env python3 import re # ----- keypair = r'''/* WARNING: auto-generated (by autogen/cli); do not edit */ #include #include #include #include #include "lib25519.h" /* -l25519 */ #include "limits.inc" static void die_temp(const char *why,const char *why2) { if (why2) fprintf(stderr,"COMMAND: fatal: %s: %s\n",why,why2); else fprintf(stderr,"COMMAND: fatal: %s\n",why); exit(111); } static unsigned char pk[PRIMITIVE_PUBLICKEYBYTES]; static unsigned char sk[PRIMITIVE_SECRETKEYBYTES]; int main() { FILE *pkfile; FILE *skfile; limits(); pkfile = fdopen(5,"w"); if (!pkfile) { fprintf(stderr,"COMMAND: usage: COMMAND 5>publickey 9>secretkey\n"); die_temp("fdopen 5 failed",strerror(errno)); } skfile = fdopen(9,"w"); if (!skfile) { fprintf(stderr,"COMMAND: usage: COMMAND 5>publickey 9>secretkey\n"); die_temp("fdopen 9 failed",strerror(errno)); } PRIMITIVE_keypair(pk,sk); if (fwrite(pk,1,sizeof pk,pkfile) < sizeof pk) die_temp("write publickey failed",strerror(errno)); if (fflush(pkfile)) die_temp("write publickey failed",strerror(errno)); fclose(pkfile); if (fwrite(sk,1,sizeof sk,skfile) < sizeof sk) die_temp("write secretkey failed",strerror(errno)); if (fflush(skfile)) die_temp("write secretkey failed",strerror(errno)); fclose(skfile); return 0; }''' dh = r'''/* WARNING: auto-generated (by autogen/cli); do not edit */ #include #include #include #include #include "lib25519.h" /* -l25519 */ #include "limits.inc" static void die_temp(const char *why,const char *why2) { if (why2) fprintf(stderr,"COMMAND: fatal: %s: %s\n",why,why2); else fprintf(stderr,"COMMAND: fatal: %s\n",why); exit(111); } static unsigned char sharedsecret[PRIMITIVE_BYTES]; static unsigned char bobpublic[PRIMITIVE_PUBLICKEYBYTES]; static unsigned char alicesecret[PRIMITIVE_SECRETKEYBYTES]; int main() { FILE *bobpublicfile; FILE *alicesecretfile; FILE *sharedsecretfile; limits(); bobpublicfile = fdopen(4,"r"); if (!bobpublicfile) { fprintf(stderr,"COMMAND: usage: COMMAND 8sharedsecret\n"); die_temp("fdopen 4 failed",strerror(errno)); } alicesecretfile = fdopen(8,"r"); if (!alicesecretfile) { fprintf(stderr,"COMMAND: usage: COMMAND 8sharedsecret\n"); die_temp("fdopen 8 failed",strerror(errno)); } sharedsecretfile = fdopen(7,"w"); if (!sharedsecretfile) { fprintf(stderr,"COMMAND: usage: COMMAND 8sharedsecret\n"); die_temp("fdopen 7 failed",strerror(errno)); } if (fread(alicesecret,1,sizeof alicesecret,alicesecretfile) < sizeof alicesecret) { if (ferror(alicesecretfile)) die_temp("read alicesecret failed",strerror(errno)); die_temp("read alicesecret failed","end of file"); } fclose(alicesecretfile); if (fread(bobpublic,1,sizeof bobpublic,bobpublicfile) < sizeof bobpublic) { if (ferror(bobpublicfile)) die_temp("read bobpublic failed",strerror(errno)); die_temp("read bobpublic failed","end of file"); } fclose(bobpublicfile); PRIMITIVE(sharedsecret,bobpublic,alicesecret); if (fwrite(sharedsecret,1,sizeof sharedsecret,sharedsecretfile) < sizeof sharedsecret) die_temp("write sharedsecret failed",strerror(errno)); if (fflush(sharedsecretfile)) die_temp("write sharedsecret failed",strerror(errno)); fclose(sharedsecretfile); return 0; }''' # ----- sign = r'''/* WARNING: auto-generated (by autogen/cli); do not edit */ #include #include #include #include #include "lib25519.h" /* -l25519 */ #include "limits.inc" #include "freadall.inc" static void die_temp(const char *why,const char *why2) { if (why2) fprintf(stderr,"COMMAND: fatal: %s: %s\n",why,why2); else fprintf(stderr,"COMMAND: fatal: %s\n",why); exit(111); } static unsigned char sk[PRIMITIVE_SECRETKEYBYTES]; int main() { FILE *skfile; unsigned char *buf; long long mlen; long long smlen; limits(); skfile = fdopen(8,"r"); if (!skfile) { fprintf(stderr,"COMMAND: usage: COMMAND 8signedmessage\n"); die_temp("fdopen 8 failed",strerror(errno)); } if (fread(sk,1,sizeof sk,skfile) < sizeof sk) { if (ferror(skfile)) die_temp("read secretkey failed",strerror(errno)); die_temp("read secretkey failed","end of file"); } fclose(skfile); buf = freadall(&mlen,PRIMITIVE_BYTES,stdin); if (!buf) die_temp("out of memory",0); if (ferror(stdin)) die_temp("read message failed",strerror(errno)); PRIMITIVE(buf,&smlen,buf,mlen,sk); if (fwrite(buf,1,smlen,stdout) < smlen) die_temp("write signedmessage failed",strerror(errno)); if (fflush(stdout)) die_temp("write signedmessage failed",strerror(errno)); free(buf); return 0; }''' # ----- sign_open = r'''/* WARNING: auto-generated (by autogen/cli); do not edit */ #include #include #include #include #include "lib25519.h" /* -l25519 */ #include "limits.inc" #include "freadall.inc" static void die_temp(const char *why,const char *why2) { if (why2) fprintf(stderr,"COMMAND: fatal: %s: %s\n",why,why2); else fprintf(stderr,"COMMAND: fatal: %s\n",why); exit(111); } static unsigned char pk[PRIMITIVE_PUBLICKEYBYTES]; int main() { FILE *pkfile; unsigned char *buf; long long smlen; long long mlen; limits(); pkfile = fdopen(4,"r"); if (!pkfile) { fprintf(stderr,"COMMAND: usage: COMMAND 4message\n"); die_temp("fdopen 4 failed",strerror(errno)); } if (fread(pk,1,sizeof pk,pkfile) < sizeof pk) { if (ferror(pkfile)) die_temp("read publickey failed",strerror(errno)); die_temp("read publickey failed","end of file"); } fclose(pkfile); buf = freadall(&smlen,0,stdin); if (!buf) die_temp("out of memory",0); if (ferror(stdin)) die_temp("read signedmessage failed",strerror(errno)); if (PRIMITIVE_open(buf,&mlen,buf,smlen,pk)) { fprintf(stderr,"COMMAND: fatal: open failed\n"); exit(100); } if (fwrite(buf,1,mlen,stdout) < mlen) die_temp("write message failed",strerror(errno)); if (fflush(stdout)) die_temp("write message failed",strerror(errno)); free(buf); return 0; }''' # ----- with open('command/x25519-keypair.c','w') as f: f.write(re.sub('COMMAND','x25519-keypair',re.sub('PRIMITIVE','lib25519_dh',keypair))) with open('command/x25519-dh.c','w') as f: f.write(re.sub('COMMAND','x25519-dh',re.sub('PRIMITIVE','lib25519_dh',dh))) with open('command/ed25519-keypair.c','w') as f: f.write(re.sub('COMMAND','ed25519-keypair',re.sub('PRIMITIVE','lib25519_sign',keypair))) with open('command/ed25519-sign.c','w') as f: f.write(re.sub('COMMAND','ed25519-sign',re.sub('PRIMITIVE','lib25519_sign',sign))) with open('command/ed25519-open.c','w') as f: f.write(re.sub('COMMAND','ed25519-open',re.sub('PRIMITIVE','lib25519_sign',sign_open))) lib25519-20230630/autogen/html0000755000000000000000000000376014447527040014176 0ustar rootroot#!/usr/bin/env python3 import os import datetime import markdown def load(fn): with open(fn) as f: return f.read() style = load('autogen/html-style') sitetitle = load('autogen/html-title').strip() files = [] os.makedirs('doc/html',exist_ok=True) with open('autogen/html-files') as f: for line in f: line = line.strip() line = line.split(':') if len(line) != 3: continue files += [line] class superscripts(markdown.extensions.Extension): def extendMarkdown(self,md): md.inlinePatterns.register(markdown.inlinepatterns.SimpleTagInlineProcessor(r'()\^(.*?)\^','sup'),'sup',175) for md,html,pagetitle in files: fnmd = 'doc/%s.md' % md fnhtml = 'doc/html/%s.html' % html output = '' x = load(fnmd) x = markdown.markdown(x,extensions=['markdown.extensions.extra','markdown.extensions.tables',superscripts()]) mtime = datetime.datetime.utcfromtimestamp(os.path.getmtime(fnmd)).strftime('%Y.%m.%d') output += '\n\n' output += style output += '\n' output += sitetitle output += ': ' output += pagetitle output += '\n' output += '\n' output += '\n' output += '
\n' output += sitetitle output += '
\n' output += '