From 440f4a06a4fa756221964a9f29f4a3616a847797 Mon Sep 17 00:00:00 2001 From: Orson Peters Date: Tue, 22 Jan 2013 11:31:58 +0100 Subject: [PATCH] docs and changed to void functions --- ed25519.dll | Bin 92160 -> 92160 bytes readme.md | 12 ++++++------ src/ed25519.h | 4 ++-- src/keypair.c | 4 +--- src/sign.c | 4 +--- 5 files changed, 10 insertions(+), 14 deletions(-) diff --git a/ed25519.dll b/ed25519.dll index e3e370ab46017636bde9fda79ef21b241173bfc7..9d9b6fd8910bcde64b6cc2d14a71abce306be300 100644 GIT binary patch delta 959 zcmYjPduUTv7(d_5yhBC1Y`u*@k zr5X9LCs4SFU~425+-7=bAfoePA#I!&>Sp##Qq?9^KS>=j#szui`$(-v*8-Djnxxc( zQnGy&d|(`3>z~@4eSsU&A?UtxGVHyLg;_A8!G_AwSoy%niL zG#V5u>3M%NUli&c!l%JGv1&`8wA53e$}r`)5_{Mkab$Bp85=d?|K6XUr^VGamNO zvUv~TDk$>NBjRdPgk8!c=4Va`%W^-v1L5Z^I6smPPTL-1wv#5(wC@SFICR?`DEQrs zg|oIzLm6j&oYOPWHPB;=5|FWg8S zgt2705ts#v$#fIYQaC}u3wA!naZws-0UPb{!aVqhe&dBzV5NU~!3V$4wLWlxgLeB6 z9HVI;%n)|AF!l%iy#?&_kq?%`V_LTnwH-9F5nO_`m9YbKv=!_^k+6Ffh&%Yc4)~NiY*|sd!f<`eHmaTKmugPUtM}A#b*eT;tI?XZ iy;`@{r(M;CwY%D%+EcBhp4xUmwWYuQHeIs=uKW+IVQ6Il delta 973 zcmYjPZD?Cn7(Vaqy=#=Xwrf_qu;D6q9o7bOb3eMZ$y({=s)ZB-CT%w70{svf_$T{O zw{hr zdEVze=ecKaNf=xblEd8D-mwpZCC3L~Z1oZpQbRDsJ-a+Z$gDsH12KYQmKW`hl{169 zhl8wnhHrpw^D|y`f0aeNB2S2MT6D}F6nQ|Qp@>$$$qO~GVb%&S!Cf;f?0s?aOG4&z z$v2Fj6NPHq@^~O-eT`s9&%}G|+Db$WUbN=T%YvuM+@$Jks$r9Q-&_;qs@ITu9jo@( zRQo0sNGV%-n;~dkI20}OW`^>A;Zcqpd+W_yGI{lt!#yCFZIktNKRicBqTsYE?MvyI zk%MAAc8zbfZa<+MQYMl2=d3SM6O)DQ711+{p=76l1%_X=X3PuO@iGbhk8=O{o6XZo zAa;^5JyWK85Fd?;)piUOj~T;Oj@{VGIEoI4jsG7z{V%4QSEhIE>_cYshDgu=^L!%S zx51d*w%q(>dY3CWfV;TJkDe1-Y!QZaJ>||_6!xur zJ0^QQR#Sa-F>?y6boMZ?5-6s#?LeP~2?}9w^GS|7PX{}|MMuI=1D*8KFf@ac{u+h| z+^2^k&;$w{iXiwC%|@V7IMKn_kMuzYxaoQX_Ct|+I#K&J)jOd{aE2J`r^_L53y=7c zcYu~hpq`d@fdjmBM;E+{ZblcJ!Us&ZM4|Sn-DyG=7YS*jY7{=$UW^mMhX^U$B1Bvu z^X;VORXk>|yD~R*bGm=M=rB|hKDJ`XZGrsS94}F&Jci-Q>QhA%aLk`G6 zIU>I&>vB@QCVwmcDc343$}wd?Ij>w)E-P8(uJXN7RGg|?m0nO=)eiNX`mwsAK2!_p px>~92)nqNK^=pRqxi+ia(H>}P8q;W1AJhp`4GRtTX=@+c{0Ax;aH0SJ diff --git a/readme.md b/readme.md index 8c2cf27..637fe93 100644 --- a/readme.md +++ b/readme.md @@ -1,8 +1,8 @@ Ed25519 ------- -This is a portable implementation of [Ed25519](http://ed25519.cr.yp.to/). All -code is in the public domain. +This is a portable implementation of [Ed25519](http://ed25519.cr.yp.to/) based +on the SUPERCOP "ref10" implementation. All code is in the public domain. All code is pure ANSI C without any dependencies, except for the random seed generation which uses standard OS cryptography APIs. If you wish to be @@ -35,20 +35,20 @@ API Creates a 32 byte random seed in `seed` for key generation. `seed` must be a writable 32 byte buffer. Returns 0 on success, and nonzero on failure. - int ed25519_create_keypair(unsigned char *verify_key, unsigned char *sign_key, const unsigned char *seed); + void ed25519_create_keypair(unsigned char *verify_key, unsigned char *sign_key, const unsigned char *seed); Creates a new key pair from the given seed. `verify_key` must be a writable 32 byte buffer, `sign_key` must be a writable 64 byte buffer and `seed` must be a -32 byte buffer. Returns 0 on success, and nonzero on failure. +32 byte buffer. - int ed25519_sign(unsigned char *signature, + void ed25519_sign(unsigned char *signature, const unsigned char *message, size_t message_len, const unsigned char *sign_key); Creates a signature of the given message with `sign_key`. `signature` must be a writable 64 byte buffer. `message` must have at least `message_len` bytes to be read. `sign_key` must be a 64 byte signing key generated by -`ed25519_create_keypair`. Returns 0 on success, and nonzero on failure. +`ed25519_create_keypair`. int ed25519_verify(const unsigned char *signature, const unsigned char *message, size_t message_len, diff --git a/src/ed25519.h b/src/ed25519.h index f987c6f..e4d5fe0 100644 --- a/src/ed25519.h +++ b/src/ed25519.h @@ -24,8 +24,8 @@ extern "C" { int ED25519_DECLSPEC ed25519_create_seed(unsigned char *seed); #endif -int ED25519_DECLSPEC ed25519_create_keypair(unsigned char *verify_key, unsigned char *sign_key, const unsigned char *seed); -int ED25519_DECLSPEC ed25519_sign(unsigned char *signature, const unsigned char *message, size_t message_len, const unsigned char *sign_key); +void ED25519_DECLSPEC ed25519_create_keypair(unsigned char *verify_key, unsigned char *sign_key, const unsigned char *seed); +void ED25519_DECLSPEC ed25519_sign(unsigned char *signature, const unsigned char *message, size_t message_len, const unsigned char *sign_key); int ED25519_DECLSPEC ed25519_verify(const unsigned char *signature, const unsigned char *message, size_t message_len, const unsigned char *verify_key); diff --git a/src/keypair.c b/src/keypair.c index b3ed843..abf426b 100644 --- a/src/keypair.c +++ b/src/keypair.c @@ -3,7 +3,7 @@ #include "ge.h" -int ed25519_create_keypair(unsigned char *verify_key, unsigned char *sign_key, const unsigned char *seed) { +void ed25519_create_keypair(unsigned char *verify_key, unsigned char *sign_key, const unsigned char *seed) { unsigned char h[64]; ge_p3 A; int i; @@ -23,6 +23,4 @@ int ed25519_create_keypair(unsigned char *verify_key, unsigned char *sign_key, c for (i = 0; i < 32; ++i) { sign_key[32 + i] = verify_key[i]; } - - return 0; } diff --git a/src/sign.c b/src/sign.c index 502e344..ffd1122 100644 --- a/src/sign.c +++ b/src/sign.c @@ -4,7 +4,7 @@ #include "sc.h" -int ed25519_sign(unsigned char *signature, const unsigned char *message, size_t message_len, const unsigned char *sign_key) { +void ed25519_sign(unsigned char *signature, const unsigned char *message, size_t message_len, const unsigned char *sign_key) { unsigned char az[64]; unsigned char r[64]; unsigned char hram[64]; @@ -33,6 +33,4 @@ int ed25519_sign(unsigned char *signature, const unsigned char *message, size_t sc_reduce(hram); sc_muladd(signature + 32, hram, az, r); - - return 0; }