Title: The shortest elliptic curve library! Post by: grondilu on June 08, 2012, 12:35:25 PM I wrote this dc library for elliptic curve arithmetics on secp256k1:
Code: I16iFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2Fsp It does addition and multiplication of any point. Examples: Doubling the subgroup generator (G): Code: $ dc "$THE_ABOVE_CODE lG lDx lm~f" Multiplying G by a large number stored in shell variable n: Code: $ dc "$THE_ABOVE_CODE $n lG lMx lm~f" An so on (the macro for addition is in register 'A'). Title: Re: The shortest elliptic curve library! Post by: grondilu on June 12, 2012, 12:00:20 PM A bit shorter, and with better alignment (64 characters): Code: I16i7sb0sa[[_1*lm1-*lm%q]Std0>tlm%Lts#]s%[Smddl%x-lm/rl%xLms#]s~ Title: Re: The shortest elliptic curve library! Post by: Gavin Andresen on June 12, 2012, 12:48:43 PM You're a crazy-man. Crazy in a good way... ever do any APL programming?
Title: Re: The shortest elliptic curve library! Post by: grondilu on June 12, 2012, 01:00:24 PM You're a crazy-man. Crazy in a good way...ever do any APL programming? :D No, but I'll check it out :) Title: Re: The shortest elliptic curve library! Post by: ribuck on June 12, 2012, 01:54:37 PM Here's my attempt:
elliptic-curve-in-dc-0.2.8 (http://www.midnitetease.com/serendipity/uploads/AlizeeASCIIAnimated.gif) *original source is here (http://www.midnitetease.com/serendipity/index.php?/archives/329-I-dont-like-Mondays....html) Title: Re: The shortest elliptic curve library! Post by: piotr_n on June 15, 2012, 05:26:35 PM it's amazing! :)
Title: Re: The shortest elliptic curve library! Post by: deepceleron on June 16, 2012, 04:00:43 AM Next up: offline Bitcoin transaction generator written in AWK...
Title: Re: The shortest elliptic curve library! Post by: Boussac on June 18, 2012, 05:13:06 PM Here's my attempt: elliptic-curve-in-dc-0.2.8 (http://www.midnitetease.com/serendipity/uploads/AlizeeASCIIAnimated.gif) *original source is here (http://www.midnitetease.com/serendipity/index.php?/archives/329-I-dont-like-Mondays....html) I like those curves too :D but Grondilu is the grand master Title: Re: The shortest elliptic curve library! Post by: 2112 on June 18, 2012, 10:43:40 PM You're a crazy-man. Crazy in a good way... ever do any APL programming? Aaah, APL. The write-only programming language. Here's the link: https://bitcointalk.org/index.php?topic=35518.msg439736#msg439736 It may not be shorter, but it is clearly on par with dc. |