diff --git a/.gitignore b/.gitignore index 4dd752db..054ca57d 100644 --- a/.gitignore +++ b/.gitignore @@ -4,10 +4,10 @@ *.lo *.log *.o -*.s *.scan *.status *.tar.* +*.trs *~ .DS_Store .deps @@ -17,6 +17,7 @@ INSTALL Makefile Makefile.in aclocal.m4 +android-toolchain autom4te.cache build compile @@ -43,11 +44,37 @@ probes_dnscrypt_proxy.h src/*.o src/.deps src/Makefile.in -src/proxy/Makefile.in -src/proxy/dnscrypt-proxy src/hostip/hostip -src/include/dnscrypt/version.h src/include/Doxyfile +src/include/dnscrypt/version.h +src/include/html/ +src/include/latex/ +src/libevent-modified/include/event2/event-config.h +src/libevent-modified/libevent.pc +src/libevent-modified/libevent_openssl.pc +src/libevent-modified/libevent_pthreads.pc +src/libevent-modified/m4/libtool.m4 +src/libevent-modified/m4/ltoptions.m4 +src/libevent-modified/m4/ltversion.m4 +src/libevent-modified/sample/dns-example +src/libevent-modified/sample/event-test +src/libevent-modified/sample/hello-world +src/libevent-modified/sample/http-server +src/libevent-modified/sample/signal-test +src/libevent-modified/sample/time-test +src/libevent-modified/test/bench +src/libevent-modified/test/bench_cascade +src/libevent-modified/test/bench_http +src/libevent-modified/test/bench_httpclient +src/libevent-modified/test/regress +src/libevent-modified/test/rpcgen-attempted +src/libevent-modified/test/test-changelist +src/libevent-modified/test/test-eof +src/libevent-modified/test/test-init +src/libevent-modified/test/test-ratelim +src/libevent-modified/test/test-script.sh +src/libevent-modified/test/test-time +src/libevent-modified/test/test-weof src/libevent/*.la src/libevent/*.lo src/libevent/*.pc @@ -74,7 +101,22 @@ src/libevent/test/test-init src/libevent/test/test-ratelim src/libevent/test/test-time src/libevent/test/test-weof -src/libnacl/okcompilers/c -src/libnacl/okcompilers/do +src/libnacl/ +src/libsodium/m4/argz.m4 +src/libsodium/m4/libtool.m4 +src/libsodium/m4/ltdl.m4 +src/libsodium/m4/ltoptions.m4 +src/libsodium/m4/ltsugar.m4 +src/libsodium/m4/ltversion.m4 +src/libsodium/m4/lt~obsolete.m4 +src/libsodium/src/libsodium/include/sodium/version.h +src/plugins/.tmp +src/plugins/example-ldns-blocking/example-ldns-blocking.plist/ +src/plugins/example-ldns-opendns-deviceid/example-ldns-opendns-deviceid.plist/ +src/proxy/Makefile.in +src/proxy/dnscrypt-proxy +src/proxy/registry.txt stamp-* +test-driver testing +update-changelog.sh diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..bcffd67c --- /dev/null +++ b/.travis.yml @@ -0,0 +1,17 @@ +language: c +compiler: + - gcc +before_script: + - sudo apt-get install libldns-dev + - git clone git://github.com/jedisct1/libsodium.git + - cd libsodium + - git checkout 1.0.1 + - ./autogen.sh + - ./configure --disable-dependency-tracking + - sudo make install + - sudo ldconfig + - cd .. + - ./autogen.sh + - ./configure --disable-dependency-tracking --enable-plugins +script: + - make diff --git a/COPYING b/COPYING index 9a5c735c..bf52a9bc 100644 --- a/COPYING +++ b/COPYING @@ -2,9 +2,9 @@ dnscrypt-proxy is covered by the following license : /* - * Copyright (c) 2011-2013 Frank Denis + * Copyright (c) 2011-2015 Frank Denis * - * Permission to use, copy, modify, and distribute this software for any + * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * @@ -24,10 +24,9 @@ maintained libraries. The externally maintained libraries used by dnscrypt-proxy are: - - NaCl (http://nacl.cr.yp.to/). Public domain. + - libsodium (https://github.com/jedisct1/libsodium). 2-clause BSD + license. Based on NaCl (http://nacl.cr.yp.to), public domain. See + src/libsodium/{COPYING,AUTHORS}. - libevent (http://libevent.org/). 3-clause BSD license. See src/libevent/LICENSE. - - - salsa20_random.c reuses code from OpenBSD written by Damien Miller. - BSD license. diff --git a/ChangeLog b/ChangeLog index 19dffacd..0fcbc613 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,37 +1,2425 @@ -Date: 2013-01-20 +* Mon Jan 5 17:55:36 2015 +0100 + + +dnscrypt.org-fr + +* Mon Jan 5 17:16:31 2015 +0100 + + NEWS update + +* Mon Jan 5 17:10:50 2015 +0100 + + Get ready for a new release + +* Mon Jan 5 17:07:25 2015 +0100 + + libevent 2.0.22 + +* Mon Jan 5 17:04:17 2015 +0100 + + libevent: fix CVE-2014-6272 + +* Mon Jan 5 17:03:44 2015 +0100 + + libevent: Fix evbuffer_peek() with len==-1 and start_at non-NULL. + +* Wed Dec 31 19:09:00 2014 +0100 + + 2015 + +* Mon Dec 29 18:29:18 2014 +0100 + + Check if -D_FORTIFY_SOURCE=2 works + +* Mon Dec 29 18:22:22 2014 +0100 + + Add IPv6 IP for ns1-wa-us + +Merge: 14d2932 783edbf +* Mon Dec 29 18:19:23 2014 +0100 + + Merge branch 'master' of https://github.com/jedisct1/dnscrypt-proxy + + * 'master' of https://github.com/jedisct1/dnscrypt-proxy: + Check if -Wl,-pie should be used instead of -pie in LDFLAGS + Reflecting 'd0wn-fr-ns1' server IP address change. + +* Mon Dec 29 18:19:05 2014 +0100 + + Add a new OpenNIC server in Washington + +* Mon Dec 29 01:29:11 2014 +0100 + + Check if -Wl,-pie should be used instead of -pie in LDFLAGS + +Merge: 8bb1599 579c596 +* Fri Dec 26 14:10:13 2014 +0100 + + Merge pull request #171 from DistantThunder/master + + Updating d0wn french servers. + +* Fri Dec 26 02:32:29 2014 +0100 + + Reflecting 'd0wn-fr-ns1' server IP address change. + + Changing 'd0wn-fr-ns2' listening port to a working one. + +Merge: 3f7dbf5 32794a0 +* Sun Dec 21 14:08:23 2014 +0100 + + Merge pull request #169 from pataquets/patch-1 + + Fix typos + +* Sun Dec 21 12:05:07 2014 +0100 + + Fix typo + +* Sun Dec 21 12:03:01 2014 +0100 + + Fix typo + +Merge: 57d3072 562ddd4 +* Thu Dec 4 17:40:14 2014 -0800 + + Merge pull request #166 from xuzhen/master + + fixed issue #104 + +* Thu Dec 4 21:31:28 2014 +0800 + + fixed issue #104 + +* Wed Dec 3 15:02:27 2014 -0800 + + Update ChangeLog + +* Wed Dec 3 15:01:09 2014 -0800 + + Remove OpenNIC UK resolvers + +* Tue Dec 2 23:23:29 2014 -0800 + + Bump fpm package version up + +* Tue Dec 2 23:22:49 2014 -0800 + + Use resolver-name + +* Tue Dec 2 23:07:55 2014 -0800 + + dnscrypt-wrapper doesn't support socket activation (yet?) + +* Tue Dec 2 23:07:03 2014 -0800 + + Document how to run dnscrypt-proxy with systemd + +* Tue Dec 2 19:15:44 2014 -0800 + + Remove offline d0wn servers + +* Tue Dec 2 19:00:11 2014 -0800 + + open dns supports https now + +* Tue Dec 2 18:57:21 2014 -0800 + + Update d0wn IPs, add new d0wn servers, update open dns catchline + +* Tue Dec 2 17:51:11 2014 -0800 + + Bump version number + +* Tue Dec 2 17:27:05 2014 -0800 + + When using a systemd socket, retrieve its local address. + +* Tue Dec 2 17:13:02 2014 -0800 + + The systemd service needs NonBlocking=true + +* Tue Dec 2 17:08:58 2014 -0800 + + Socket inherited from systemd must be set to nonblocking. + +* Tue Dec 2 16:46:27 2014 -0800 + + When using systemd, the local address may not reflect the reality. + +* Tue Dec 2 16:39:50 2014 -0800 + + UDP sockets sent by systemd are not listening + +* Tue Dec 2 15:52:58 2014 -0800 + + Fix error message + +* Tue Dec 2 15:40:42 2014 -0800 + + Add a simple sample systemd service file. + +* Tue Dec 2 15:15:06 2014 -0800 + + Add SYSTEMD_DAEMON_ flags + +* Tue Dec 2 14:54:05 2014 -0800 + + The TCP socket is of type SOCK_STREAM. + +* Tue Dec 2 14:53:47 2014 -0800 + + Outline systemd descriptors initialization + +* Tue Dec 2 14:51:35 2014 -0800 + + Check for libsystemd-daemon in addition to libsystemd. + Do not pick systemd unless --with-systemd is explicitly used. + +* Tue Dec 2 14:18:15 2014 -0800 + + A file descriptor doesn't have to be >= 0 + +* Tue Dec 2 14:16:52 2014 -0800 + + Indent + +* Tue Dec 2 16:42:19 2014 -0800 + + logger() -> logger_noformat() + +* Tue Dec 2 15:43:22 2014 -0800 + + Use sodium 1.0.1 + +* Tue Dec 2 14:56:50 2014 -0800 + + libevent2: Fix race caused by event_active + There is a race between manual event_active and natural event activation. + + If both happen at the same time on the same FD, they would both be protected by the same event base lock except for 1 LoC where the fields of struct event are read without any kind of lock. + + + In 2.0-stable, none of this is inside the lock; in HEAD, only the callback is read inside the lock. This gets the callback and all 3 arguments inside the lock before calling it outside the lock. + +* Tue Dec 2 14:55:57 2014 -0800 + + Sodium 0.5.0 is the bare minimum. + +Merge: 6d3a902 7a8b8e8 +* Tue Dec 2 14:12:37 2014 -0800 + + Merge pull request #165 from zedinosaur/systemd + + Add socket activation to dnscrypt-proxy. + +* Sat Nov 29 22:56:40 2014 -0500 + + Add documentation about systemd integration. + +* Sat Nov 29 22:27:23 2014 -0500 + + Move READY notify to when listeners start. + +* Sat Nov 29 14:47:26 2014 -0500 + + Add socket activation to dnscrypt-proxy. + + Conditional systemd support for socket activation and startup and shutdown + notification. + +Merge: 3c605e7 24efbde +* Tue Nov 25 16:41:48 2014 -0800 + + Merge branch 'master' of github.com:jedisct1/dnscrypt-proxy + + * 'master' of github.com:jedisct1/dnscrypt-proxy: + iOS: add -miphoneos-version-min + Add the cypherpunk.lu server + Update dnscrypt-resolvers.csv.sig + Sort resolvers list + Added a DNSCrypt server in Luxembourg + Indent + High-level functions are enough + Not Poly1305-AES. + +* Tue Nov 25 16:41:29 2014 -0800 + + Don't use -fwrapv if it's redundant. + +* Thu Nov 20 14:01:46 2014 -0800 + + iOS: add -miphoneos-version-min + +* Fri Oct 31 13:02:14 2014 -0700 + + Add the cypherpunk.lu server + +* Fri Oct 31 09:01:55 2014 -0700 + + Update dnscrypt-resolvers.csv.sig + +* Fri Oct 31 09:01:35 2014 -0700 + + Sort resolvers list + +Merge: 4ab8308 1f3d58e +* Fri Oct 31 08:58:52 2014 -0700 + + Merge pull request #157 from virii/master + + Added a DNSCrypt server in Luxembourg + +* Fri Oct 31 16:51:27 2014 +0100 + + Added a DNSCrypt server in Luxembourg + +* Wed Oct 29 02:13:20 2014 -0700 + + Indent + +* Wed Oct 29 02:12:30 2014 -0700 + + High-level functions are enough + +* Wed Oct 29 02:09:37 2014 -0700 + + Not Poly1305-AES. + +Merge: 41c667e ca47395 +* Mon Oct 13 10:17:52 2014 -0700 + + Merge pull request #150 from rob/patch-1 + + Update dnscrypt-resolvers.csv + +* Mon Oct 13 09:33:50 2014 -0400 + + Update dnscrypt-resolvers.csv + + According to the OpenNIC wiki [1], the correct IPv6 address for PhilipSoutham's server is ns18.ca.us, not ns17.ca.us. The provider key was also wrong. + + [1] http://wiki.opennicproject.org/Tier2 + +* Fri Oct 10 19:17:23 2014 -0700 + + Libevent2 - Fix a typo in a doxygen comment. Reported by äå. + +* Tue Sep 30 16:05:35 2014 -0700 + + d0wn servers support Namecoin - Prodded by @bugreport0 + +Merge: 9ec8509 5a9a96d +* Mon Sep 29 15:42:05 2014 -0700 + + Merge remote-tracking branch 'teknocrat/master' + + * teknocrat/master: + * New ebuild for 1.4.0 * New ebuild for 1.4.1 * Configuration change to support providers * Drop libsodium from overlay (is not in portage tree) * Dnscrypt-Proxy 1.4.x requires libsodium 1.0.0 or newer + + Conflicts: + packages/gentoo/net-dns/dnscrypt-proxy/Manifest + packages/gentoo/net-dns/dnscrypt-proxy/dnscrypt-proxy-1.4.0.ebuild + packages/gentoo/net-dns/dnscrypt-proxy/dnscrypt-proxy-1.4.1.ebuild + +* Wed Sep 24 11:17:38 2014 -0400 + + * New ebuild for 1.4.0 + * New ebuild for 1.4.1 + * Configuration change to support providers + * Drop libsodium from overlay (is not in portage tree) + * Dnscrypt-Proxy 1.4.x requires libsodium 1.0.0 or newer + +* Sun Sep 28 01:42:11 2014 -0700 + + and -> and/or + +Merge: 1578efb 4cd37f7 +* Sat Sep 27 12:13:32 2014 -0700 + + Merge branch 'master' of github.com:jedisct1/dnscrypt-proxy + + * 'master' of github.com:jedisct1/dnscrypt-proxy: + * New ebuild for 1.4.0 * New ebuild for 1.4.1 * Configuration change to support providers + +* Sat Sep 27 12:13:10 2014 -0700 + + Fix the tests, update Gemfile by the way + +Merge: 4991aa3 c21c3c1 +* Wed Sep 24 08:56:40 2014 -0700 + + Merge pull request #145 from Teknocrat/master + + New Gentoo ebuilds for 1.4.0 and 1.4.1 + +* Wed Sep 24 11:17:38 2014 -0400 + + * New ebuild for 1.4.0 + * New ebuild for 1.4.1 + * Configuration change to support providers + +* Sat Sep 20 23:05:44 2014 -0700 + + Mention that a minimal build of libsodium is fine. + +* Fri Sep 19 00:02:26 2014 -0700 + + Update ChangeLog + +Merge: 3c960ad 1e2eb46 +* Thu Sep 18 23:23:45 2014 -0700 + + Merge branch 'master' of github.com:jedisct1/dnscrypt-proxy + + * 'master' of github.com:jedisct1/dnscrypt-proxy: + Do not use the same description for 2 different configurations + Update ChangeLog + libevent - [Bugfix] fix bufferevent setwatermark suspend_read + libevent - regress_buffer: fix 'memcmp' compare size + +* Thu Sep 18 23:18:23 2014 -0700 + + 1.4.0 -> 1.4.1 + +* Thu Sep 18 22:55:23 2014 -0700 + + timing -> timing out + +* Thu Sep 18 18:56:25 2014 -0700 + + Do not use the same description for 2 different configurations + +* Thu Sep 18 17:25:37 2014 -0700 + + Update ChangeLog + +* Thu Sep 18 17:24:03 2014 -0700 + + libevent - [Bugfix] fix bufferevent setwatermark suspend_read + +* Thu Sep 18 17:23:22 2014 -0700 + + libevent - regress_buffer: fix 'memcmp' compare size + +Merge: 5d55fee 4a3a23c +* Thu Sep 11 20:22:14 2014 -0700 + + Merge remote-tracking branch 'Shnatsel/master' + + * Shnatsel/master: + Bump compat to 9, standards version to 3.9.5 + Drop AppArmor installation from Debian/Ubuntu package + Since we could not resolve the AppArmor shutdown issue so far, at least add a warning about it + +* Sun Sep 7 17:49:19 2014 -0700 + + Target iOS 7.1 since iOS 8 hasn't been jailbroken yet + +* Sat Sep 6 13:58:09 2014 -0700 + + Use Sodium 0.7.0 + +* Thu Sep 4 15:05:58 2014 -0700 + + ChangeLog update + +* Thu Sep 4 15:00:35 2014 -0700 + + Add a few comments to the .plist file + +* Thu Sep 4 14:57:28 2014 -0700 + + Mention that the path to the CSV file is also required + +* Tue Sep 2 20:09:22 2014 -0700 + + ChangeLog update + +* Tue Sep 2 14:53:24 2014 -0700 + + libevent: Consistently check for failure from evbuffer_pullup() + +* Wed Aug 27 22:50:37 2014 -0700 + + Ship libgcc_s_dw2-1.dll in the Windows package + +* Tue Aug 26 19:14:37 2014 -0700 + + Bump libsodium DLL version + +* Tue Aug 26 11:45:14 2014 -0700 + + Mention Docker images + +* Sun Aug 24 19:03:35 2014 +0400 + + Bump compat to 9, standards version to 3.9.5 + +* Sun Aug 24 18:48:36 2014 +0400 + + Drop AppArmor installation from Debian/Ubuntu package + +* Sun Aug 24 18:40:29 2014 +0400 + + Since we could not resolve the AppArmor shutdown issue so far, at least add a warning about it + +* Fri Aug 22 11:48:53 2014 -0700 + + libevent2 + +* Fri Aug 22 11:48:19 2014 -0700 + + DTrace -> dtrace + +* Fri Aug 22 11:47:32 2014 -0700 + + Update documentation + +* Fri Aug 22 11:43:17 2014 -0700 + + I am not running Mountain Lion any more. + +* Fri Aug 22 11:43:02 2014 -0700 + + Doc update + +* Thu Aug 21 23:05:59 2014 -0700 + + More permanent issues URL + +* Thu Aug 21 22:58:04 2014 -0700 + + -encrypted + +* Thu Aug 21 22:55:33 2014 -0700 + + Clarify what the Resolver Name is + +* Thu Aug 21 22:54:05 2014 -0700 + + Regen documentation + +* Thu Aug 21 22:47:22 2014 -0700 + + Make it clear that most people just need to run dnscrypt-proxy -R + +* Tue Aug 19 10:18:04 2014 -0700 + + Add a few files created by "make verify" to .gitignore. + +* Tue Aug 19 08:28:49 2014 -0700 + + Note about dnscrypt.org being blocked + +* Sat Aug 16 22:31:53 2014 -0700 + + Revert "No more resolvers in Japan :(" + + +* Thu Aug 14 12:13:23 2014 -0700 + + Remove unused function. + +* Tue Aug 12 22:43:43 2014 -0700 + + Revert "Bring back clang on Travis" + + +Merge: ef06bdb 1eb7a00 +* Tue Aug 12 22:43:32 2014 -0700 + + Merge branch 'master' of github.com:jedisct1/dnscrypt-proxy + + * 'master' of github.com:jedisct1/dnscrypt-proxy: + Bring back clang on Travis + +* Tue Aug 12 22:41:55 2014 -0700 + + No more resolvers in Japan :( + +* Mon Aug 11 16:47:26 2014 -0700 + + Bring back clang on Travis + +* Thu Aug 7 20:14:01 2014 -0700 + + clang seems to be broken on Travis + +* Thu Aug 7 19:45:22 2014 -0700 + + Document that some plugins need additional DLLs on Windows + +* Mon Jul 28 13:02:56 2014 -0700 + + Don't even try to parse an empty file. + +* Sat Jul 26 12:12:17 2014 -0700 + + Bump version to 1.4.1 + +* Sat Jul 26 12:07:19 2014 -0700 + + mlock() the proxy context + +* Sat Jul 26 11:59:43 2014 -0700 + + Replace the custom fingerprint parse with sodium_hextobin() + +Merge: 5ddc648 3f85a31 +* Sat Jul 26 11:21:41 2014 -0700 + + Merge branch 'master' of github.com:jedisct1/dnscrypt-proxy + + * 'master' of github.com:jedisct1/dnscrypt-proxy: + Add alternative port to dnscrypt.eu servers + +* Sat Jul 26 11:21:26 2014 -0700 + + "sodium.h" -> + +Merge: aab1871 025ac7f +* Fri Jul 18 13:15:52 2014 -0700 + + Merge pull request #125 from trrbl/master + + Add alternative port to dnscrypt.eu servers + +* Fri Jul 18 23:38:25 2014 +0400 + + Add alternative port to dnscrypt.eu servers + + Some ISP are filtering outgoing port 443. + +Merge: 3592248 ad407a0 +* Sat Jul 5 10:23:26 2014 -0700 + + Merge branch 'master' of github.com:jedisct1/dnscrypt-proxy + + * 'master' of github.com:jedisct1/dnscrypt-proxy: + Package new Android build scripts + +* Sat Jul 5 10:22:42 2014 -0700 + + Do not retry to send UDP packets, let the stub resolver do it. + +* Wed Jul 2 16:47:15 2014 -0700 + + Package new Android build scripts + +Merge: b8e8055 8a5cd0f +* Mon Jun 30 10:40:06 2014 -0700 + + Merge pull request #122 from Teknocrat/patch-1 + + Update dnscrypt-proxy-1.3.3-r1.ebuild + +* Mon Jun 30 10:33:08 2014 -0700 + + Update dnscrypt-proxy-1.3.3-r1.ebuild + + You need this additional line or else Gentoo will not actually create the local user and group accounts.. + +* Sun Jun 29 10:54:52 2014 -0700 + + Target iOS 8.0 + +* Mon Jun 16 21:19:32 2014 -0700 + + Add OpenDNS on port 53 for some unusual setups + +* Mon Jun 2 20:36:59 2014 -0700 + + Tweak OSX compile flags + +* Sun Jun 1 22:49:41 2014 -0700 + + Travis: install libldns-dev + +* Sun Jun 1 23:00:44 2014 -0700 + + Use libsodium 0.5.0 + +* Mon Jun 2 20:29:04 2014 -0700 + + On OSX, compile for Mountain Lion. + +Merge: 5bd6577 1cbcb8f +* Fri May 23 09:09:36 2014 -0700 + + Merge branch 'master' of github.com:jedisct1/dnscrypt-proxy + + * 'master' of github.com:jedisct1/dnscrypt-proxy: + Default to OpenDNS resolvers explicitly in the old-style config file because DNSCrypt no longer defaults to them internally + +* Fri May 23 09:09:22 2014 -0700 + + Log the signal number in the signal handler + +Merge: c4d8ffc 66a97df +* Fri May 16 09:03:58 2014 -0700 + + Merge pull request #107 from Shnatsel/fix-config + + Default to OpenDNS resolvers explicitly in the old-style config file... + +* Fri May 16 13:39:56 2014 +0400 + + Default to OpenDNS resolvers explicitly in the old-style config file because DNSCrypt no longer defaults to them internally + +* Tue May 13 11:05:41 2014 -0700 + + Revert ""[debian revision] should be zero, because this package is not in Debian yet and thus has no Debian revisions"" + + +* Tue May 13 06:28:28 2014 -0700 + + "[debian revision] should be zero, because this package is not in Debian yet and thus has no Debian revisions" + +Merge: 786180e 8782c8e +* Mon May 12 07:20:21 2014 -0700 + + Merge branch 'master' of github.com:jedisct1/dnscrypt-proxy + + * 'master' of github.com:jedisct1/dnscrypt-proxy: + Link http://dominustemporis.com/2014/05/dnscrypt-on-windows-update/ + +* Mon May 12 07:19:54 2014 -0700 + + OpenDNS FamilyShield IP address is 208.67.220.123 + +* Mon May 12 07:19:26 2014 -0700 + + is confusing to Windows users, so use quotes. + +Merge: c0fb5fe 536abb6 +* Sat May 10 22:33:53 2014 -0700 + + Merge branch 'master' of github.com:jedisct1/dnscrypt-proxy + + * 'master' of github.com:jedisct1/dnscrypt-proxy: + Ship libwinpthread-1.dll on Windows + Tell Windows users to open the 'bin' directory. + Windows: copy the CSV file to $bindir + Update signature + Make sure that 'plugins' and 'bin' are directories. + Add CPPFLAGS/LDFLAGS for libsodium + Update Win32 build scripts + Add two new d0wn servers. Via Martin A. + Just discovered Windows + X ... + +* Sat May 10 22:33:44 2014 -0700 + + Link http://dominustemporis.com/2014/05/dnscrypt-on-windows-update/ + +* Mon May 5 17:00:20 2014 -0700 + + Ship libwinpthread-1.dll on Windows + +* Mon May 5 16:48:10 2014 -0700 + + Tell Windows users to open the 'bin' directory. + +* Mon May 5 16:47:03 2014 -0700 + + Windows: copy the CSV file to $bindir + +* Mon May 5 16:28:31 2014 -0700 + + Update signature + +* Mon May 5 16:26:45 2014 -0700 + + Make sure that 'plugins' and 'bin' are directories. + +* Mon May 5 16:13:11 2014 -0700 + + Add CPPFLAGS/LDFLAGS for libsodium + +* Mon May 5 16:08:37 2014 -0700 + + Update Win32 build scripts + +* Mon May 5 15:44:29 2014 -0700 + + Add two new d0wn servers. Via Martin A. + +* Sun May 4 22:59:09 2014 -0700 + + Just discovered Windows + X ... + +* Wed Apr 30 18:03:35 2014 -0700 + + Sync the Android build scripts with libsodium's + +* Mon Apr 28 10:01:17 2014 -0700 + + Remove opennic-proxy.sh-dns2 until what is wrong with it gets sorted out + +* Sat Apr 26 10:14:32 2014 -0700 + + Update .csv sig + +* Sat Apr 26 10:14:10 2014 -0700 + + Nits + +* Sat Apr 26 10:12:16 2014 -0700 + + proxy.sh: use names closer to the convention used by other entries + +* Sat Apr 26 10:06:32 2014 -0700 + + Update .csv signature + +Merge: 5bb89b5 6630fd1 +* Sat Apr 26 10:05:22 2014 -0700 + + Merge pull request #94 from boianmihailov/patch-1 + + Add couple of servers to dnscrypt-resolvers.csv + +* Sat Apr 26 16:39:40 2014 +0300 + + Add couple of servers to dnscrypt-resolvers.csv + + Append two DNS server provided by proxy.sh + +* Fri Apr 25 00:12:48 2014 -0700 + + --daemonize is not the only option one may want to use + +* Thu Apr 24 23:31:23 2014 -0700 + + Regen dnscrypt-resolvers.csv.sig + +* Thu Apr 24 23:20:35 2014 -0700 + + Add final stop + +* Thu Apr 24 23:19:56 2014 -0700 + + Update documentation example + +* Thu Apr 24 23:18:34 2014 -0700 + + Link README-WINDOWS.markdown instead of out-of-date instructions. + +* Thu Apr 24 23:15:49 2014 -0700 + + Quote args, remove spaces + +* Thu Apr 24 22:57:01 2014 -0700 + + Version 1.1.0 is dead old, no need to mention it. + +* Thu Apr 24 22:56:17 2014 -0700 + + Update .plist + +* Thu Apr 24 22:49:18 2014 -0700 + + Update NEWS + +* Thu Apr 24 22:26:30 2014 -0700 + + Update ChangeLog + +* Thu Apr 24 22:25:06 2014 -0700 + + Do not document --reinstall + +* Thu Apr 24 22:24:41 2014 -0700 + + Document how to open an elevated command prompt + +* Thu Apr 24 17:44:37 2014 -0700 + + Make dnscrypt-proxy half-decent on Windows + +* Thu Apr 24 23:23:49 2014 +0000 + + Add windows_service_registry_write_string(() + +* Wed Apr 23 23:10:14 2014 -0700 + + Quote dnscrypt-proxy + +* Wed Apr 23 21:38:21 2014 -0700 + + No need to check for inet_pton after all + +* Wed Apr 23 21:37:49 2014 -0700 + + Fu fu fu Windows, fu fu fuuuuu + +* Wed Apr 23 21:24:49 2014 -0700 + + Define a replacement inet_pton() function for Windows + +* Wed Apr 23 21:10:17 2014 -0700 + + Use inet_pton() instead of inet_aton() + +* Wed Apr 23 12:56:00 2014 -0700 + + Revert cf5a85b255f86db8b2c5ec4fe45aa383903a69bb + +* Wed Apr 23 08:20:26 2014 -0700 + + Update d0wn entries, requested by d0wn + +* Tue Apr 22 22:17:05 2014 -0700 + + Update dnscrypt-resolvers.csv signature + +* Tue Apr 22 22:12:54 2014 -0700 + + Update ns4.ca.dns.opennic.glue signature, via Nova King + +* Tue Apr 22 20:08:48 2014 -0700 + + Sign .csv file + +* Tue Apr 22 20:06:13 2014 -0700 + + Add CloudNS Tor addresses + +* Tue Apr 22 08:12:15 2014 -0700 + + Mention DNSCrypt-OSXClient, a new universal client for OSX. + +* Mon Apr 21 21:12:31 2014 -0700 + + Do not skip the last row of the CSV file. + +* Mon Apr 21 14:04:08 2014 -0700 + + Mention extra plugins + +* Mon Apr 21 14:00:26 2014 -0700 + + Markdown fixups + +* Mon Apr 21 13:58:36 2014 -0700 + + Update documentation + +* Mon Apr 21 13:58:17 2014 -0700 + + Do not recommend logging to /tmp + +* Mon Apr 21 13:01:01 2014 -0700 + + opennic-ca-ns17 is actually in Fremont, CA, US. + +* Mon Apr 21 12:53:23 2014 -0700 + + Full country names + +* Mon Apr 21 12:50:16 2014 -0700 + + for d0wn and OpenNIC servers, place the country code first to improve sorting + +* Mon Apr 21 12:46:06 2014 -0700 + + OK Turtles is okTurtles + +* Mon Apr 21 12:44:53 2014 -0700 + + opendns-ipv6 description should be unique + +* Mon Apr 21 12:44:03 2014 -0700 + + Sort, and add OpenDNS IPv6 and OpenDNS Familyshield + +* Mon Apr 21 12:35:00 2014 -0700 + + Complete d0wn servers + +* Mon Apr 21 12:33:18 2014 -0700 + + CSV is hard + +* Mon Apr 21 12:32:21 2014 -0700 + + Add missing version # + +* Mon Apr 21 12:31:13 2014 -0700 + + Missing , + +* Mon Apr 21 12:30:18 2014 -0700 + + Fix CSV + +* Mon Apr 21 12:28:38 2014 -0700 + + More d0wn servers + +* Mon Apr 21 12:17:31 2014 -0700 + + Phew, NovaKing has so many resolvers... + +* Mon Apr 21 12:10:01 2014 -0700 + + Slowly complete the list of resolvers... + +* Mon Apr 21 11:48:13 2014 -0700 + + Add dnscrypt.eu IPv6 addresses + +* Mon Apr 21 11:24:47 2014 -0700 + + Remove unneeded quotes from CSV file + +* Mon Apr 21 11:23:24 2014 -0700 + + Remove empty records from CSV file + +* Mon Apr 21 11:23:01 2014 -0700 + + Cleanup CSV file + +* Fri Apr 18 04:56:18 2014 -0700 + + Plugins shouldn't be considered experimental any more + +Merge: cadf94b d005fa4 +* Thu Apr 17 08:18:14 2014 -0700 + + Merge pull request #91 from pysiak/master + + Update GEO coordinates and pubkey for Soltysiak + +* Thu Apr 17 13:31:21 2014 +0200 + + Update GEO coordinates and pubkey for Soltysiak + +* Thu Apr 17 00:21:22 2014 -0700 + + Better usage() + +* Thu Apr 17 00:06:43 2014 -0700 + + Add ResolverName and ResolversList to the Windows registry keys + +* Wed Apr 16 23:58:19 2014 -0700 + + Install dnscrypt-resolvers.csv + +* Wed Apr 16 23:48:43 2014 -0700 + + Move the list of resolvers to $pkgdatadir + +* Wed Apr 16 23:22:11 2014 -0700 + + New option -R to automatically pick resolver config from a name + +* Wed Apr 16 23:21:41 2014 -0700 + + Initialize the default resolver name to NULL + +* Wed Apr 16 21:30:20 2014 -0700 + + Open the CSV file in binary mode. + +* Wed Apr 16 21:27:50 2014 -0700 + + Portably computing the size of a file in C is not a solved problem. + https://www.securecoding.cert.org/confluence/display/seccode/FIO19-C.+Do+not+use+fseek()+and+ftell()+to+compute+the+size+of+a+regular+file + +* Wed Apr 16 20:45:09 2014 -0700 + + Define the path to dnscrypt-resolvers.csv + +* Wed Apr 16 20:12:59 2014 -0700 + + Use sodium_mlock() if available. + +* Wed Apr 16 19:51:22 2014 -0700 + + Check for sodium_mlock existence + +* Wed Apr 16 00:28:33 2014 -0700 + + MiniCSV: move macros to minicsv.h + +* Wed Apr 16 00:23:27 2014 -0700 + + Import MiniCSV + +* Wed Apr 16 06:08:11 2014 -0700 + + Downgrade "Received a resolver reply from a different resolver" to LOG_DEBUG + +* Wed Apr 16 06:02:07 2014 -0700 + + Next release will be 1.4.0 + +* Wed Apr 16 06:02:07 2014 -0700 + + Fix buggy retry code. Issue #71 + +* Sat Apr 12 13:33:20 2014 -0700 + + Fragmentation is allowed only if the packet size > the outgoing interface MTU. + +* Wed Apr 9 19:44:42 2014 -0700 + + Require provider information. + +* Wed Apr 9 12:15:28 2014 -0700 + + libevent: disable regress by default, as it requires network communications. + +* Tue Apr 8 14:43:27 2014 -0700 + + + DNSCrypt Tools + +Merge: 72a9e48 4fac7f8 +* Tue Apr 8 11:01:21 2014 -0700 + + Merge pull request #81 from aureq/master + + package compliance with debian distribution + +Merge: 6e646ad 9ee793f +* Mon Apr 7 09:37:11 2014 -0700 + + Merge pull request #87 from Teknocrat/master + + New initd File for Gentoo allows configuration of different DNS servers + +* Mon Apr 7 12:29:21 2014 -0400 + + New initd File for Gentoo allows configuration of different DNS + resolvers vid conf.d config file variables + +* Sat Mar 29 21:34:48 2014 -0700 + + Fix a crash in evdns related to shutting down evdns + (Improved version to deal correctly with probe requests) + Patch from YASUOKA Masahiko; fix for libevent github issue #113. + +* Tue Mar 25 15:23:56 2014 -0700 + + Fix documentation: --resolver-address not --server-address + +* Tue Mar 25 08:06:03 2014 -0700 + + Fix a crash in evdns related to shutting down evdns + Patch from YASUOKA Masahiko; fix for libevent github issue #113. + +* Sun Mar 23 19:15:19 2014 +1100 + + return a fail if stop is request and the process wasn't running + +* Sun Mar 23 19:10:47 2014 +1100 + + pass the configuration to the argument parser + added --brackground to start-stop-daemon so the process is started correctly in the background + only retrieve the most recent pid for the daemon + cosmetic changes with "echo" + if process can't be killed, then return a fail (log_end_msg 1) + +* Sun Mar 23 18:34:24 2014 +1100 + + exclude 'resolvconf' from the upstart script when processing options + +* Sun Mar 23 18:03:45 2014 +1100 + + fixed syntax error in init script + +* Sun Mar 23 17:56:12 2014 +1100 + + debian init script as debian doesn't use upstart + +* Sun Mar 23 17:28:01 2014 +1100 + + removed --user=dnscrypt as moved to dnscrypt-proxy.default instead + +* Sun Mar 23 17:27:24 2014 +1100 + + added 'user=' to the default configuration file + +* Sun Mar 23 16:59:05 2014 +1100 + + added 'resolvconf' package dependency (Suggests only) for the init script to update /etc/resolv.connf + +* Sun Mar 23 16:52:09 2014 +1100 + + added 'resolvconf' variablee for the init script + +* Sun Mar 23 11:56:48 2014 +1100 + + (lintian) description-synopsis-starts-with-article + +* Sun Mar 23 11:54:49 2014 +1100 + + (lintian) dnscrypt-proxy: debian-revision-should-not-be-zero + +* Fri Mar 21 13:43:45 2014 -0700 + + OKTurtles does not support DNSSEC + +* Fri Mar 21 13:28:21 2014 -0700 + + Add OkTurtles to the list of providers. + +* Fri Mar 21 13:20:43 2014 -0700 + + DNSCrypt Winclient does more than OpenDNS and CloudNS now. + +* Fri Mar 21 13:16:34 2014 -0700 + + Prepare for removal of default settings. + +* Wed Mar 5 17:14:11 2014 -0800 + + libevent sync + * Wed Feb 19 06:49:31 2014 +0100 + + Add -Qunused-arguments for clang on macos + + The clang compiler provided with macosx emits warnings like: + + CC bufferevent.lo + clang: warning: argument unused during compilation: '-I .' + clang: warning: argument unused during compilation: '-I ./compat' + clang: warning: argument unused during compilation: '-I ./include' + clang: warning: argument unused during compilation: '-I ./include' + + for each file being compiled. This generates a lot of noise during + compilation making it hard to see "real" errors. This patch mute + those warnings. + +* Sun Feb 9 12:10:05 2014 -0800 + + Simplify hostip example + +* Sun Feb 9 12:04:33 2014 -0800 + + dnscrypt-proxy has been available in Homebrew for a while + +* Sun Feb 9 12:04:04 2014 -0800 + + Update repository. + +* Sun Feb 9 11:58:32 2014 -0800 + + Display something as LOG_NOTICE when the service starts + +* Sun Feb 9 11:58:22 2014 -0800 + + Regen hostip + +* Sun Feb 9 11:45:14 2014 -0800 + + 213.154.224.3 now only accepts connections over TLS. + +* Sun Feb 9 11:36:26 2014 -0800 + + One line for the version is enough. + +* Sun Feb 9 11:33:51 2014 -0800 + + Use LOG_NOTICE level for startup/shutdown messages + +* Sun Feb 9 11:26:08 2014 -0800 + + bufferevent_pair: don't call downcast(NULL) + +* Thu Jan 30 13:06:04 2014 -0800 + + Add dnscrypt.eu IPv6 address for resolver #2 + +* Thu Jan 30 10:07:50 2014 -0800 + + Refer to Noxwizard's repository again. + +Merge: e47ef88 627e26a +* Fri Jan 24 08:33:56 2014 -0800 + + Merge pull request #62 from Shnatsel/master + + Fix applying AppArmor profile on startupp + +Merge: f4c73e9 e3085a8 +* Fri Jan 24 08:33:16 2014 -0800 + + Merge pull request #63 from Shnatsel/fix-etc-defaults + + Fix /etc/default in Ubuntu package + +* Fri Jan 24 19:34:02 2014 +0400 + + Link to resolver lists in /etc/default and note that specifying multiple resolvers is not yet supported + +* Fri Jan 24 19:29:33 2014 +0400 + + Revert "Add OpenNIC alternative root servers to /etc/default/dnscrypt-proxy." + + +* Fri Jan 24 14:44:33 2014 +0400 + + don't fail if loading of AppArmor profile from Upstart script failed for whatever reason + +* Fri Jan 24 14:21:15 2014 +0400 + + Fix a common bug with DNSCrypt having the AppArmor profile defined but not being confined by it + +* Wed Jan 22 16:17:03 2014 -0800 + + libevent: Check if arch has the epoll_create and __NR_epoll_wait syscalls. + Some architectures (like AArch64) do not have deprecated syscalls. + +* Wed Jan 15 11:34:02 2014 -0800 + + New OpenNIC servers in Fremont, CA + +* Mon Jan 13 14:53:54 2014 -0800 + + Typo + +* Mon Jan 13 14:52:13 2014 -0800 + + Link DNSCrypt Windows Service Manager + +* Mon Jan 13 14:47:29 2014 -0800 + + Update dnscrypt.eu resolvers + +Merge: 99ca5c8 57520bc +* Mon Jan 13 14:08:55 2014 -0800 + + Merge pull request #56 from Kami/fix_readme_typo + + Fix typo in the README + +* Mon Jan 13 22:50:53 2014 +0100 + + Fix a typo, argument is called pidfile and not pid-file. + +* Wed Jan 1 17:09:12 2014 +0100 + + Year++ + +* Tue Dec 31 16:36:16 2013 +0100 + + Remove the need for droid-gcc to compile for android + +* Fri Dec 27 20:00:58 2013 +0100 + + libevent typo fixes + +Merge: a4cd640 5cdf433 +* Wed Dec 18 13:14:44 2013 -0800 + + Merge branch 'master' of github.com:jedisct1/dnscrypt-proxy + + * 'master' of github.com:jedisct1/dnscrypt-proxy: + Add OpenNIC alternative root servers to /etc/default/dnscrypt-proxy. + +* Wed Dec 18 13:13:15 2013 -0800 + + Remove references to encryption. + Make it clear that dnscrypt is about authentication, not privacy. + +Merge: d243c7a 52d2c7c +* Fri Dec 13 09:20:46 2013 -0800 + + Merge pull request #48 from pataquets/master + + Add OpenNIC alternative root servers to /etc/default/dnscrypt-proxy. + +* Fri Dec 13 10:54:42 2013 +0100 + + Add OpenNIC alternative root servers to /etc/default/dnscrypt-proxy. + +Merge: c3942f2 e607279 +* Thu Dec 12 20:58:13 2013 -0800 + + Merge pull request #47 from pataquets/patch-2 + + Add OpenNIC alternative DNS servers + +* Fri Dec 13 03:12:40 2013 +0100 + + Add OpenNIC alternative DNS servers + +* Wed Dec 11 22:45:32 2013 -0800 + + Fix hostip default -r arg + +* Sat Dec 7 21:56:29 2013 -0800 + + Update libevent ChangeLog + +* Mon Nov 18 15:00:10 2013 -0800 + + Target iOS 7.1 + +* Sun Nov 17 21:10:31 2013 -0800 + + Remove unmaintained packages + +Merge: 2b48929 f0a155d +* Tue Nov 5 23:24:36 2013 -0800 + + Merge pull request #39 from Shnatsel/master + + Add Debian/Ubuntu packaging + +Merge: 5535ff7 567c700 +* Mon Nov 4 22:15:23 2013 -0800 + + Merge branch 'master' of github.com:jedisct1/dnscrypt-proxy + + * 'master' of github.com:jedisct1/dnscrypt-proxy: + Gentoo ebuild: Backport patch to fix always compiling plugins + Bump libsodium Gentoo ebuild to version 0.4.5 + Update Gentoo ebuilds to use autotools-utils + Add masters attribute to Gentoo overlay layout.conf + +* Mon Nov 4 22:15:06 2013 -0800 + + libevent: Avoid redundant invocations of init_extension_functions for IOCP + +* Sun Nov 3 19:14:58 2013 +0400 + + Added Debian/Ubuntu packaging + +Merge: 34034ca c71e1e4 +* Fri Nov 1 09:16:05 2013 -0700 + + Merge pull request #38 from Strayer/gentoo-ebuild-fixes + + Gentoo ebuild fixes + +* Thu Oct 31 21:31:04 2013 +0100 + + Gentoo ebuild: Backport patch to fix always compiling plugins + +* Wed Oct 30 21:26:01 2013 +0100 + + Bump libsodium Gentoo ebuild to version 0.4.5 + +* Tue Oct 29 23:24:56 2013 +0100 + + Update Gentoo ebuilds to use autotools-utils + +* Tue Oct 29 23:20:59 2013 +0100 + + Add masters attribute to Gentoo overlay layout.conf + +Merge: 659f6cf 3bc5106 +* Fri Nov 1 00:57:34 2013 -0700 + + Merge pull request #37 from Strayer/fix-autotools-configure-arguments + + Handle --disable-plugins* correctly in configure.ac + +* Thu Oct 31 21:06:11 2013 +0100 + + Handle --disable-plugins* correctly in configure.ac + +* Sun Oct 27 12:56:52 2013 -0700 + + port 2053 for the new Polish server + +* Sun Oct 27 12:50:16 2013 -0700 + + Add the new DNSCrypt service in Poland + +Merge: cfd5184 13e171f +* Fri Oct 25 19:35:00 2013 -0700 + + Merge remote-tracking branch 'Shnatsel/master' + + * Shnatsel/master: + bump AppArmor profile modification date + Improve AppArmor profile: - Use @{multiarch} tunable instead of *-linux-gnu* - they are the same on my system, but using the global tunable is more robust/portable - Drop block_suspend capability because it requires Linux >= 3.5 and does not seem to be needed (as of my testing) - Allow access to libpthread and librt, extensive testing indicates it is sometimes needed (libsodium multithreading?) - Allow access to libsodium if it's installed in the system default path with multiarch support instead of just /usr/lib/ and /usr/local/lib + +* Fri Oct 25 19:34:14 2013 +0400 + + bump AppArmor profile modification date + +* Fri Oct 25 19:30:18 2013 +0400 + + Improve AppArmor profile: + - Use @{multiarch} tunable instead of *-linux-gnu* - they are the same on my system, but using the global tunable is more robust/portable + - Drop block_suspend capability because it requires Linux >= 3.5 and does not seem to be needed (as of my testing) + - Allow access to libpthread and librt, extensive testing indicates it is sometimes needed (libsodium multithreading?) + - Allow access to libsodium if it's installed in the system default path with multiarch support instead of just /usr/lib/ and /usr/local/lib + +* Tue Oct 22 13:06:06 2013 -0700 + + Update ChangeLog + +* Tue Oct 22 13:05:32 2013 -0700 + + Check for arc4random_addrandom() presence - Needed for OpenBSD-current. + +* Tue Oct 22 13:05:11 2013 -0700 + + Update man page date + +* Mon Oct 14 15:29:13 2013 -0700 + + Update hostip man page + +* Mon Oct 14 15:22:25 2013 -0700 + + Use 8.8.8.8 by default in hostip. + +* Fri Oct 11 09:11:36 2013 -0700 + + Ditch ldns-forward-after-nxdomain plugin. + +* Fri Oct 11 09:22:21 2013 -0700 + + Security: Never expose a private key in the process command-line args + This was here as an alternative to using an environment variable only because + the closed-source opendns user interface was (and probably still is) using + that. + +* Wed Oct 9 21:47:43 2013 -0700 + + Disable dns test cases in regress_main + +* Wed Oct 9 21:07:06 2013 -0700 + + libevent: regress_dns needs a very specific DNS setup to pass. Disable it. + +* Sun Oct 6 18:27:39 2013 -0700 + + Fix provider name for OpenDNS + +* Tue Sep 24 13:41:52 2013 -0700 + + Check for inline vs __inline + +* Mon Sep 23 15:50:00 2013 -0700 + + Add DNSCrypt.eu + +* Wed Sep 18 00:50:48 2013 -0700 + + No logs + +* Wed Sep 18 00:48:43 2013 -0700 + + New public resolver in Japan, part of OpenNIC + +* Tue Sep 17 20:02:34 2013 -0700 + + Version bump + +* Tue Sep 17 19:46:50 2013 -0700 + + set-client-ip.c plugin: accept non-hex IP strings + +* Tue Sep 17 18:35:56 2013 -0700 + + Update winclient description + +* Sun Sep 15 14:27:47 2013 -0700 + + Update README-WINDOWS to mention .DLL files. + +* Sun Sep 15 14:13:38 2013 -0700 + + Don't compress executables by default, because of stupid antiviruses. + +* Sun Sep 15 14:12:48 2013 -0700 + + Change the package structure for Windows users + +* Sun Sep 15 13:55:29 2013 -0700 + + Put sbin and bin in the same basket on win32 + +* Sun Sep 15 13:46:13 2013 -0700 + + msys: actually honor prefix + +* Sun Sep 15 13:45:00 2013 -0700 + + msys: remove --disable-ssp + +* Sun Sep 15 13:43:51 2013 -0700 + + msys.sh: install in $(pwd)/dnscrypt-proxy-win32 + +* Sun Sep 15 13:39:49 2013 -0700 + + Update Win32 instructions. libsodium DLL is now shipped separately. + +* Sun Sep 15 12:58:36 2013 -0700 + + Move autoconf sync with libsodium + +* Sun Sep 15 12:52:08 2013 -0700 + + Move PROBES_SOURCE substitution + +* Sun Sep 15 12:50:55 2013 -0700 + + Sync some autoconf switches with libsodium's + +* Sun Sep 15 12:44:18 2013 -0700 + + Remove unused blocking-random autoconf switch + +* Sun Sep 15 12:43:30 2013 -0700 + + PIE is on by default, so document --disable-pie, not --enable-pie + +* Sun Sep 15 12:17:20 2013 -0700 + + Remove links to the OSX and Cydia packages. + The OSX GUI ships with an old proxy, the Cydia package is dead old as well. + +* Fri Sep 13 22:08:25 2013 -0700 + + Ping timeout from Noxwizard, temporarily change dnscrypt-winclient URL + +* Tue Sep 10 21:59:13 2013 -0700 + + libevent: Avoid racy bufferevent activation + + The evhttp_send_reply method invokes evhttp_write_buffer with a + callback that may release the underlying request object and + bufferevent upon completion. This cleanup callback is invoked by the + underlying bufferevent's write callback. Improperly enabling write + events before referencing the bufferevent could lead to use after free + and memory corruption. + + diff --git a/http.c b/http.c + index 9b96ffb..377597e 100644 + --- a/http.c + +++ b/http.c + @@ -383,8 +383,6 @@ evhttp_write_buffer(struct evhttp_connection *evcon, + evcon->cb = cb; + evcon->cb_arg = arg; + + - bufferevent_enable(evcon->bufev, EV_WRITE); + - + /* Disable the read callback: we don't actually care about data; + * we only care about close detection. (We don't disable reading, + * since we *do* want to learn about any close events.) */ + @@ -393,6 +391,8 @@ evhttp_write_buffer(struct evhttp_connection *evcon, + evhttp_write_cb, + evhttp_error_cb, + evcon); + + + + bufferevent_enable(evcon->bufev, EV_WRITE); + } + + static void + +* Mon Sep 9 22:51:42 2013 -0700 + + Disable PIE on MingW + +* Wed Sep 4 00:17:30 2013 -0700 + + Bump Android SDK version + +* Mon Aug 26 23:37:36 2013 -0700 + + Require at least autoconf 2.65 + +* Mon Aug 26 23:31:19 2013 -0700 + + Explain that on CentOS/Fedora, ld.so.conf doesn't include /usr/local/lib + +* Sun Aug 18 14:31:58 2013 -0600 + + Update the version number in the file checking example + +* Sun Aug 18 14:20:33 2013 -0600 + + Update CloudNS resolvers + +Merge: 48726db d071cfb +* Wed Aug 14 08:10:27 2013 -0700 + + Merge pull request #17 from Strayer/gentoo-fix-ebuilds + + Fix Gentoo ebuilds + +* Wed Aug 14 16:25:08 2013 +0200 + + Added dnscrypt-proxy-1.3.3.ebuild + + - bumped dnscrypt-proxy to 1.3.3 + - fixed wrong digests in Manifest + - removed old ebuilds which don't have official packages anymore + +* Wed Aug 14 16:20:29 2013 +0200 + + Fixed libsodium-0.4.2.ebuild + + - src_configure() missed econf + - path of ChangeLog was wrong + +* Tue Aug 13 20:39:50 2013 -0700 + + Regen man pages + +* Tue Aug 13 20:38:03 2013 -0700 + + update ChangeLog + +* Tue Aug 13 20:24:25 2013 -0700 + + Get back to 512 bytes for DNS_MAX_PACKET_SIZE_UDP_NO_EDNS_SEND + +* Tue Aug 13 20:22:42 2013 -0700 + + Fix tests: apprently, www.opendns.com IPv6 address changed. + +* Tue Aug 13 07:30:20 2013 -0700 + + Update ChangeLog + +* Mon Aug 12 22:38:54 2013 -0700 + + Gradually increase the supported payload size. + +* Mon Aug 12 20:55:07 2013 -0700 + + Rename DNS_MAX_PACKET_SIZE_UDP_SEND to DNS_MAX_PACKET_SIZE_UDP_NO_EDNS_SEND + +* Mon Aug 12 19:47:25 2013 -0700 + + Update ChangeLog + +* Mon Aug 12 19:44:06 2013 -0700 + + Version bump + +* Mon Aug 12 19:43:18 2013 -0700 + + Explain that upgrading to 1.3.3 is highly recommended, and why. + +* Mon Aug 12 19:29:47 2013 -0700 + + Update NEWS + +* Mon Aug 12 19:23:35 2013 -0700 + + Force questions to be as big as the response can be. + +* Wed Aug 7 00:31:21 2013 -0700 + + Link to dnscrypt. + Not to old GUIs. + +Merge: 7aba22f 9a1e8ba +* Wed Aug 7 00:29:19 2013 -0700 + + Merge pull request #15 from Teknocrat/master + + Add Gentoo Ebuilds for Libsodium dependency and new dnscrypt-proxy + +* Mon Jul 29 23:14:47 2013 -0500 + + 1. Remove random blocking + 2. make default daemon use correct port number (53) + +* Mon Jul 29 19:24:57 2013 -0500 + + As per comments, removed ldflags autoconf should do this.. added use + flag for plugins, left random.. need to check with @strayer on that + one.. + +* Mon Jul 29 03:31:30 2013 -0500 + + Oops, new files needed for dnscrypt-proxy ebuild and new libsodium + ebuild + +* Mon Jul 29 03:28:13 2013 -0500 + + Added new ebuilds for dnscrypt-proxy 1.3.2 bump + as well as libsodium dependency + +* Sun Jul 21 11:55:36 2013 -0700 + + Merge important fixes to levent + + * Sat Jul 20 14:02:49 2013 -0700 + + libevent/win32_dealloc() : fix sizeof(pointer) vs sizeof(*pointer) + + * Mon Jun 10 10:38:12 2013 -0400 + + Document that arc4random is not a great cryptographic PRNG. + + * Mon Jun 10 10:33:56 2013 -0400 + + When we seed from /proc/sys/kernel/random/uuid, count it as success + + Found by Joseph Spadavecchia + + * Sat May 11 03:53:11 2013 +0400 + + Fix SEGFAULT after evdns_base_resume if no nameservers installed. + + If there is no nameservers installed, using + evdns_base_nameserver_ip_add(), than evdns_base_resume() will SEGFAULT, + because of NULL dereference in evdns_requests_pump_waiting_queue() + + Conflicts: + evdns.c + + * Wed May 29 13:30:56 2013 -0400 + + Use windows vsnprintf fixup logic on all windows environments + + Previously I'd relied on mingw to provide a vsnprintf with a + conformant return value. But it appears that some mingw + environments don't do that. + + * Mon May 6 18:15:03 2013 +0400 + + Checking request nameserver for NULL, before using it. + +* Sun Jul 21 09:56:37 2013 -0700 + + + CloudNS + +* Sat Jul 20 18:14:12 2013 -0700 + + Enable subdir-objects + +* Sat Jul 20 15:45:12 2013 -0700 + + Update ChangeLog + +* Sat Jul 20 13:58:58 2013 -0700 + + ldns.h requires ws2tcpip.h on Windows + +* Sat Jul 20 12:39:03 2013 -0700 + + libevent/win32_dealloc() : fix sizeof(pointer) vs sizeof(*pointer) + +* Fri Jul 19 12:58:11 2013 -0700 + + Unfuck Windows build: MingW doesn't even seem to provide _gmtime_s() + +* Fri Jul 19 12:56:00 2013 -0700 + + Target iOS 7 + +* Fri Jul 19 12:17:58 2013 -0700 + + Parallel compilation is unreliable on msys + +* Fri Jul 19 09:59:41 2013 -0700 + + Bump version + +* Fri Jul 19 09:52:25 2013 -0700 + + Update NEWS + +* Fri Jul 19 09:41:15 2013 -0700 + + Update ChangeLog + +* Fri Jul 19 09:37:02 2013 -0700 + + rules->profile + +* Fri Jul 19 09:36:41 2013 -0700 + + Ship the AppArmor profile + +Merge: e70029a aa5411d +* Sat Jul 6 19:07:57 2013 -0700 + + Merge pull request #11 from insanitybit/master + + xApparmor profile for DNSCrypt + +* Sat Jul 6 20:08:10 2013 -0400 + + Apparmor profile for DNSCrypt + + On systems that support apparmor this file can be dropped into /etc/apparmor.d/apparmor.profile.dnscrypt-proxy + + On reboot it should be active. aa-status to confirm, + aa-enforce /etc/apparmor.d/apparmor.profile.dnscrypt-proxy + if it doesn't enforce after reboot. + +* Tue Jun 25 14:25:16 2013 -0700 + + reword + +* Tue Jun 25 14:24:30 2013 -0700 + + Fix --test= + +* Tue Jun 25 14:24:00 2013 -0700 + + -t can now be used to specify a safety margin + +* Mon Jun 24 16:29:00 2013 -0700 + + Don't bind anything in test mode. + +* Mon Jun 24 16:16:39 2013 -0700 + + Add --test + +* Mon Jun 24 14:54:27 2013 -0700 + + Print the chosen cert validity period. + +* Mon Jun 24 13:48:36 2013 -0700 + + Update TECHNOTES + +* Sun Jun 23 23:33:33 2013 -0700 + + Explain how to check file integrity. + +* Sat Jun 22 21:38:21 2013 -0700 + + Fix typo + +* Sat Jun 22 21:36:46 2013 -0700 + + Sync Homebrew formula + +* Sun Jun 9 22:42:09 2013 -0700 + + Check that the list of supported protocol versions the client + advertises is actually supported. + The current proxy only supports version 2. + +* Sun Jun 9 19:10:01 2013 -0700 + + Use only portable implementations on iOS. + +* Sun Jun 9 12:45:06 2013 -0700 + + Update ChangeLog + +* Sun Jun 9 12:27:56 2013 -0700 + + Don't print "initializing for optimal performance" if we don't. + +* Sun Jun 9 12:19:27 2013 -0700 + + Add USE_ONLY_PORTABLE_IMPLEMENTATIONS + +* Sun Jun 9 12:19:06 2013 -0700 + + Disable PIE for Android builds. + +* Sun Jun 9 10:50:54 2013 -0700 + + Add mipsel-linux-static.sh to the distributed build scripts + +* Sat Jun 8 22:55:51 2013 -0700 + + Rename iPhone target to iOS, because it works fine on iPad and iPod, too. + +* Sat Jun 8 22:54:33 2013 -0700 + + Update iOS build script + +* Fri Jun 7 23:25:16 2013 -0700 + + Update Android build script to pick libsodium + +Merge: 64c8ed6 96e8e19 +* Thu Jun 6 23:07:21 2013 -0700 + + Merge pull request #9 from Cofyc/master + + Clean libsodium submodule entry. + +* Fri Jun 7 13:46:01 2013 +0800 + + Remove .gitmodules (libsodium is not a submodule now). + +* Wed Jun 5 20:56:13 2013 -0700 + + Unfortunately, dtrace for Linux is still experimental to say the least. + +* Wed Jun 5 16:45:49 2013 -0700 + + Check for dtrace in /usr/local/sbin and /usr/sbin just in case these are + not in $PATH, and enable dtrace on Linux, too. + +* Mon Jun 3 12:41:53 2013 -0700 + + `make -j2 check` in the `src/libsodium` is not required any more. + Thanks to binaryparadox for spotting this. + +* Fri May 31 09:41:01 2013 -0700 + + Optimized implementations are available. + +* Fri May 31 01:05:24 2013 -0700 + + dist-build/osx.sh now produces an universal binary + +* Fri May 31 00:04:47 2013 -0700 + + Pass compilation environment variables to libevent's autoconf script + through ac_configure_args in order to unfuck compilation on FreeBSD + when CFLAGS have been set prior to compilation. + +* Thu May 30 16:48:51 2013 -0700 + + Statically linking libsodium with -static -Bdynamic is not portable. Screw it. + +Merge: f654fc3 13c082d +* Thu May 30 14:01:03 2013 -0700 + + Merge branch 'ext-sodium' + + * ext-sodium: + Statically link libsodium for now + Update .travis.yml to compile and install libsodium + +* Thu May 30 14:00:42 2013 -0700 + + Statically link libsodium for now + +* Thu May 30 12:15:35 2013 -0700 + + The Windows GUI by OpenDNS looks even more abandoned than other GUIs. + +* Thu May 30 12:15:02 2013 -0700 + + All the currently available GUIs only work with OpenDNS :( + +* Thu May 30 09:38:39 2013 -0700 + + Update .travis.yml to compile and install libsodium + +* Sun May 26 00:17:52 2013 -0700 + + Mention that libsodium is now required + +* Sun May 26 00:15:33 2013 -0700 + + Remove built-in libsodium + +* Thu May 23 00:42:00 2013 -0700 + + Sync libsodium + +Merge: 41c52ff faa5cf7 +* Thu May 16 14:03:07 2013 -0700 + + Merge pull request #4 from Strayer/gentoo_ebuild_v1.3.0 + + Gentoo ebuild v1.3.0 + +* Thu May 16 11:16:54 2013 -0700 + + Check for ldns presence using ldns_wire2pkt(), not something that requires SSL. + +* Thu May 16 19:19:26 2013 +0200 + + Bumped Gentoo ebuild to 1.3.0 + +* Thu May 16 19:18:13 2013 +0200 + + Fixed gentoo ebuild package links + +* Sat May 11 21:32:11 2013 -0700 + + Display an info message before calling crypto_init(). + +* Sat May 11 11:23:52 2013 -0700 + + Export CC, LD, etc. for linux/mips/uclibc. + +* Sat May 11 11:20:12 2013 -0700 + + Add a compilation script to build a static Linux/Mips binary + Which means no plugins, though. And this is sad. + +* Sat May 11 11:04:41 2013 -0700 + + Move sodium_init() call after reading the options. + +* Sat May 11 09:59:43 2013 -0700 + + No need to define CROSS_COMPILING any more. Twas for the libuv/nacl days. + +* Sat May 4 13:48:39 2013 -0700 + + Link external libsodium if installed. + +* Thu May 2 00:17:41 2013 -0700 + + Sodium doc update + +* Sun Apr 28 09:57:55 2013 -0700 + + Sync libsodium, for fenv.h checks + +* Sat Apr 27 17:15:11 2013 -0700 + + Sodium 0.4.1 final + +* Sat Apr 27 13:16:55 2013 -0700 + + Wipe OPENDNS_DEVICE_ID environment variable. + +* Sat Apr 27 13:10:45 2013 -0700 + + Do not recommend supplying the secret on the command-line ever. + At least, use OPENDNS_DEVICE_ID for that. + +* Sat Apr 27 11:47:16 2013 -0700 + + Sodium up + +* Sat Apr 27 11:15:45 2013 -0700 + + Bump Android API to Gingerbread (because... seriously...) + But downgrade the toolchain to 4.3.3 (or else it blows up, at least on OSX) + +* Sat Apr 27 10:33:35 2013 -0700 + + Sodium update + +* Sat Apr 27 09:26:06 2013 -0700 + + Don't ignore *.s + +* Thu Apr 25 23:39:12 2013 -0700 + + Move build status up + +* Thu Apr 25 23:38:14 2013 -0700 + + Add build status + +* Thu Apr 25 23:32:59 2013 -0700 + + Let Travis build dnscrypt with plugins support + +* Thu Apr 25 23:26:25 2013 -0700 + + -Wbounded is nice, but clang reports the same thing nowadays. + +* Thu Apr 25 23:07:21 2013 -0700 + + Add before_script for Travis + +* Thu Apr 25 22:57:29 2013 -0700 + + Bump Android NDK version + +* Thu Apr 25 22:53:40 2013 -0700 + + Sodium update + +* Thu Apr 25 14:45:52 2013 -0700 + + Switch to the read-only reference to libsodium + +* Wed Apr 24 20:45:45 2013 -0700 + + Sync + +* Wed Apr 24 20:41:25 2013 -0700 + + Import .travis.yml + +* Wed Apr 24 13:52:57 2013 -0700 + + Ship Sodium 0.4 + +* Wed Apr 24 08:49:20 2013 -0700 + + Sodium update + +* Tue Apr 23 20:51:27 2013 -0700 + + Use sodium_memcmp() instead of a private version. + +* Mon Apr 22 13:24:54 2013 -0700 + + Sync libsodium + +* Mon Apr 22 13:24:43 2013 -0700 + + Disable ssp by default on MingW + +* Mon Apr 22 13:01:58 2013 -0700 + + Update NEWS & ChangeLog + +* Mon Apr 22 11:25:15 2013 -0700 + + Sync sodium + +* Mon Apr 22 10:37:18 2013 -0700 + + Sodium update + +* Fri Apr 19 16:09:46 2013 +0200 + + Sync libsodium. Now with curve25519_donna_c64 + +* Fri Apr 19 14:26:17 2013 +0200 + + sodium_shutdown() is gone + +* Fri Apr 19 11:24:21 2013 +0200 + + Add missing #include for SIZE_MAX + +* Thu Apr 18 19:16:23 2013 +0200 + + sodium_init() doesn't accept options any more. + +* Thu Apr 18 15:39:02 2013 +0200 + + Sync libsodium + +* Thu Apr 18 14:32:03 2013 +0200 + + Remove a useless function call + +* Thu Apr 18 14:30:02 2013 +0200 + + Call sodium_init() / sodium_shutdown() + +* Thu Apr 18 13:58:31 2013 +0200 + + Just use randombytes_salsa20_implementation + +* Thu Apr 18 11:07:20 2013 +0200 + + Pass the entire ac_config_args content to other autoconf scripts + +* Wed Apr 17 21:46:12 2013 +0200 + + Use Android toolchain 4.6 + +* Wed Apr 17 09:00:08 2013 +0200 + + Save a line + +* Wed Apr 17 08:57:51 2013 +0200 + + Add a new --loglevel option to change the log verbosity. + +* Wed Apr 17 08:44:16 2013 +0200 + + Update libsodium + +* Wed Apr 17 08:33:10 2013 +0200 + + Redefine log levels for Win32 + +* Fri Apr 12 08:24:29 2013 +0200 + + github.com -> github.io + +* Tue Apr 2 20:20:09 2013 -0700 + + Sync libsodium + +* Tue Apr 2 20:19:11 2013 -0700 + + Pass a few extra autoconf options form the main autoconf script to libsodium's + +* Sun Mar 31 13:40:25 2013 -0700 + + Typo + +* Mon Mar 25 11:59:11 2013 -0700 + + Update ChangeLog + +* Mon Mar 25 11:58:36 2013 -0700 + + Yay for better performance + +* Mon Mar 25 11:51:07 2013 -0700 + + Sync libsodium, with the ref10 implementation of ed25519 + +* Mon Mar 18 23:32:44 2013 -0700 + + sync libsodium + +* Mon Mar 18 21:52:08 2013 -0700 + + Farewell, dnscrypt_memzero(). Sodium provides sodium_memzero() to do that. + +* Sun Mar 17 16:08:33 2013 -0700 + + Add libsodium as a submodule + +* Sun Mar 17 16:08:01 2013 -0700 + + Remove libsodium copy + +* Sun Mar 17 16:00:40 2013 -0700 + + Sync libsodium + +* Sun Mar 17 15:55:27 2013 -0700 + + Add test-script.sh + +* Sun Mar 17 13:11:42 2013 -0700 + + Resurrect example-ldns-opendns-set-client-ip, it's very useful for support + +* Mon Mar 11 22:27:37 2013 -0700 + + Remove -fcatch-undefined-c99-behavior, will be replaced by -fsanitize=integer + +* Fri Mar 8 09:07:36 2013 -0800 + + Define HAVE_* and CROSS_COMPILING to 1 instead of just defining them. + +* Fri Mar 1 15:47:57 2013 -0800 + + Fix include path to libsodium + +* Fri Mar 1 14:11:39 2013 -0800 + + Bump fpm package version + +* Tue Feb 19 13:38:37 2013 -0800 + + libevent update to b618204216235d5998080c659c8ad53185fdf206 + +* Fri Feb 8 01:26:47 2013 -0800 + + Back to a stable Xcode version + +* Fri Feb 8 01:24:15 2013 -0800 + + Update Android NDK to r8d + +* Fri Feb 8 01:12:38 2013 -0800 + + Update NEWS + +* Fri Feb 8 01:09:08 2013 -0800 + + Update .gitignore + +* Fri Feb 8 01:07:07 2013 -0800 + + Update ChangeLog + +* Fri Feb 8 01:06:07 2013 -0800 + + Rename libevent to libevent-modified to avoid confusion. + Our version of libevent ships with some changes required for dnscrypt-proxy to + work. These will eventually be submitted upstream after libevent 2.1 gets + released. + +* Mon Feb 4 23:50:00 2013 -0800 + + libsodium already provides crypto_box_MACBYTES + +* Mon Feb 4 23:46:17 2013 -0800 + + Next will be 1.3.0. + +* Mon Feb 4 23:41:49 2013 -0800 + + Switch to libsodium. + +* Mon Feb 4 14:42:17 2013 -0800 + + Paranoia + +* Mon Jan 28 14:14:46 2013 -0800 + + Update ChangeLog + +* Mon Jan 28 14:10:26 2013 -0800 + + autoconf 2.68 broke $(top_srcdir) for tests + +* Mon Jan 28 14:03:46 2013 -0800 + + AM_CONFIG_HEADER -> AC_CONFIG_HEADER + +* Mon Jan 28 13:58:42 2013 -0800 + + Update ChangeLog + +* Mon Jan 28 13:57:35 2013 -0800 + + Update iphone.sh + +* Mon Jan 28 13:57:21 2013 -0800 + + libevent c322c2077e2d16f64ed3a90f74ad714842600624 + +* Mon Jan 21 20:50:20 2013 -0800 + + Add -Wsometimes-uninitialized + +* Mon Jan 21 19:23:40 2013 -0800 + + Check for HAVE_SECUREZEROMEMORY at compile-time. + +* Mon Jan 21 11:54:19 2013 -0800 + + Use SecureZeroMemory() on Windows + +* Sun Jan 20 10:05:27 2013 -0800 + + Update ChangeLog + +* Sun Jan 20 09:51:46 2013 -0800 Update URL. Github downloads are no more. -Date: 2013-01-19 +* Sat Jan 19 16:45:49 2013 -0800 Remove cpp wrappers -Date: 2013-01-19 +* Sat Jan 19 16:41:39 2013 -0800 Drop PROTOTYPES.cpp -Date: 2013-01-06 +* Sun Jan 6 21:49:09 2013 -0800 Fix markdown link -Date: 2013-01-06 +* Sun Jan 6 21:47:35 2013 -0800 Add a link to the home page -Date: 2013-01-06 +* Sun Jan 6 21:43:49 2013 -0800 Mention dnscrypt-wrapper -Date: 2013-01-06 +* Sun Jan 6 21:40:52 2013 -0800 Next version will be 1.2.1, I suppose. -Date: 2013-01-06 +* Sun Jan 6 21:38:39 2013 -0800 Use size_t for TXT total size, remove extra parenthesis. Merge: 0b31df8 3dc4690 -Date: 2013-01-06 +* Sun Jan 6 21:29:40 2013 -0800 Support merging txt strings into one. Some dns managers split long binary data into more than one strings @@ -39,46 +2427,46 @@ Date: 2013-01-06 Merge remote-tracking branch 'cofyc/merge_txts' By Yecheng Fu -Date: 2013-01-06 +* Sun Jan 6 20:47:51 2013 -0800 Update OSX client link. -Date: 2013-01-02 +* Wed Jan 2 08:56:29 2013 -0800 levent: configure.in files have been deprecated for a while. Rename. -Date: 2013-01-02 +* Wed Jan 2 08:50:03 2013 -0800 A global COPYING file is enough -Date: 2013-01-01 +* Tue Jan 1 00:37:41 2013 -0800 2013 -Date: 2012-12-22 +* Sat Dec 22 17:14:04 2012 -0800 levent: Avoid double-close on getsockname error in evutil_ersatz_socketpair Avoid leaking fds on evconnlistener with no callback set -Date: 2012-12-07 +* Fri Dec 7 08:31:02 2012 -0800 levent - Fix compilation with WIN32_HAVE_CONDITION_VARIABLES enabled. -Date: 2012-11-22 +* Thu Nov 22 02:34:32 2012 +0800 improve: support merging txt strings into one some dns manager split long binary data into more than one strings (e.g. linode.com) -Date: 2012-11-19 +* Mon Nov 19 09:10:24 2012 -0800 Update libevent to 2.0.21-stable-dev. -Date: 2012-11-15 +* Thu Nov 15 22:15:32 2012 -0800 Sync libevent2 - fix OpenSSL renegotiation test with old OpenSSL version. Merge: c128bd9 ce9b890 -Date: 2012-11-13 +* Tue Nov 13 14:17:21 2012 -0800 Merge remote-tracking branch 'origin/master' @@ -87,604 +2475,604 @@ Date: 2012-11-13 Updated Gentoo ebuild for v1.2.0 Merge: 20e9dd1 57e0296 -Date: 2012-11-13 +* Tue Nov 13 14:12:12 2012 -0800 Merge pull request #38 from Strayer/gentoo_ebuild_v1.2.0 Bumped Gentoo ebuild to v1.2.0 -Date: 2012-11-13 +* Tue Nov 13 22:31:20 2012 +0100 Added profile/repo_name so the packages/gentoo folder can be used as a portage overlay -Date: 2012-11-13 +* Tue Nov 13 21:33:10 2012 +0100 Updated Gentoo ebuild for v1.2.0 - updated conf and init script according to parameter changes in v1.1.0 -Date: 2012-11-03 +* Sat Nov 3 12:46:52 2012 -0700 Add a build script for 32-bit versions of OSX binaries. -Date: 2012-11-03 +* Sat Nov 3 10:34:07 2012 -0700 levent updates, so that 64-bit versions for Windows can be built. Merge: 23eaeeb 9f7c132 -Date: 2012-10-28 +* Sun Oct 28 10:11:45 2012 -0700 Merge remote-tracking branch 'marguerite/master' * marguerite/master: fix a hang-on-boot bug in systemd. update opensuse license -Date: 2012-10-28 +* Sun Oct 28 09:56:20 2012 -0700 libevent2 updates. -Date: 2012-10-24 +* Wed Oct 24 01:01:15 2012 +0800 fix a hang-on-boot bug in systemd. update opensuse license -Date: 2012-10-21 +* Sun Oct 21 22:21:21 2012 -0700 Add Marguerite Su to the THANKS file. -Date: 2012-10-21 +* Sun Oct 21 22:17:20 2012 -0700 Take the systemd service definition off the root directory. -Date: 2012-10-21 +* Sun Oct 21 22:16:56 2012 -0700 Minor tweaks to the OpenSuSE description. Merge: f0b3120 857f0cc -Date: 2012-10-21 +* Sun Oct 21 22:05:41 2012 -0700 Merge pull request #36 from marguerite/master add opensuse package, and systemd service for dnscrypt -Date: 2012-10-22 +* Mon Oct 22 12:59:47 2012 +0800 add opensuse pacages, systemd servce -Date: 2012-10-19 +* Fri Oct 19 16:35:07 2012 -0700 The OSX GUI is mainly a collection of shell scripts, nowadays. -Date: 2012-10-17 +* Wed Oct 17 22:54:28 2012 -0700 Insame => insane -Date: 2012-10-13 +* Sat Oct 13 22:13:25 2012 -0700 Remove OpenBSD port, since it is now in the official ports tree. -Date: 2012-10-12 +* Fri Oct 12 08:29:42 2012 -0700 Change the blurb to something closer to the awesome summary by sthen@ -Date: 2012-10-11 +* Thu Oct 11 18:39:41 2012 -0700 Update the Homebrew formula to 1.2.0 -Date: 2012-10-11 +* Thu Oct 11 18:31:12 2012 -0700 Update the OpenBSD package to 1.2.0 -Date: 2012-10-11 +* Thu Oct 11 10:12:04 2012 -0700 Mention that DCP_SYNC_FILTER_RESULT_DIRECT is only for a pre-filter. -Date: 2012-10-11 +* Thu Oct 11 08:23:37 2012 -0700 Update ChangeLog -Date: 2012-10-10 +* Wed Oct 10 22:33:49 2012 -0700 Set the RA flag in direct responses. -Date: 2012-10-10 +* Wed Oct 10 21:53:00 2012 -0700 Set the QR bit when sending an empty AAAA reply. -Date: 2012-10-10 +* Wed Oct 10 21:49:25 2012 -0700 Log short UDP replies -Date: 2012-10-10 +* Wed Oct 10 13:28:26 2012 -0700 Group Windows changes together. -Date: 2012-10-10 +* Wed Oct 10 13:27:37 2012 -0700 Whitespace. -Date: 2012-10-10 +* Wed Oct 10 13:26:55 2012 -0700 Update link -Date: 2012-10-10 +* Wed Oct 10 13:25:55 2012 -0700 1.2.0 -Date: 2012-10-10 +* Wed Oct 10 13:22:28 2012 -0700 Document that gcc 3.4.6 with a Mips target produces broken code with -Os -Date: 2012-10-10 +* Wed Oct 10 13:14:03 2012 -0700 Add missing return statement in the ldns-blocking example. -Date: 2012-10-10 +* Wed Oct 10 12:19:19 2012 -0700 Update NEWS/ChangeLog -Date: 2012-10-10 +* Wed Oct 10 12:15:13 2012 -0700 The plugin API has changed, 1.1.1 sounds weird, so let's go 1.2.0. -Date: 2012-10-10 +* Wed Oct 10 11:51:24 2012 -0700 Add a new plugin to return an empty response to AAAA queries. -Date: 2012-10-09 +* Tue Oct 9 23:12:41 2012 -0700 Update ChangeLog -Date: 2012-10-09 +* Tue Oct 9 23:12:06 2012 -0700 Document the new DIRECT return code for pre-filters. -Date: 2012-10-09 +* Tue Oct 9 23:06:08 2012 -0700 Well, not all plugins have been removed. -Date: 2012-10-09 +* Tue Oct 9 22:58:09 2012 -0700 Document the direct mode. -Date: 2012-10-09 +* Tue Oct 9 22:55:11 2012 -0700 Implement direct mode for TCP. -Date: 2012-10-09 +* Tue Oct 9 22:42:07 2012 -0700 Start sending direct replies. -Date: 2012-10-09 +* Tue Oct 9 17:54:35 2012 -0700 Prepare proxy code for DCP_SYNC_FILTER_RESULT_DIRECT -Date: 2012-10-09 +* Tue Oct 9 17:37:25 2012 -0700 Bump API version minor. -Date: 2012-10-09 +* Tue Oct 9 17:36:39 2012 -0700 Prepare for DCP_SYNC_FILTER_RESULT_DIRECT. -Date: 2012-10-09 +* Tue Oct 9 17:11:26 2012 -0700 Indent -Date: 2012-10-09 +* Tue Oct 9 16:51:56 2012 -0700 Include Windows quirks in NaCl test, too. -Date: 2012-10-09 +* Tue Oct 9 13:47:59 2012 -0700 Spaces, blah. Merge: de7bb89 854e2c9 -Date: 2012-10-09 +* Tue Oct 9 13:45:48 2012 -0700 Merge branch 'master' of https://github.com/jedisct1/dnscrypt-proxy * 'master' of https://github.com/jedisct1/dnscrypt-proxy: Detect things like C:/x/y and C:\x\y as absolute paths to Windows plugins. -Date: 2012-10-09 +* Tue Oct 9 10:28:18 2012 -0700 Resurect the deviceid plugin, as OpenDNS folks really need it. -Date: 2012-10-09 +* Tue Oct 9 10:28:18 2012 -0700 Detect things like C:/x/y and C:\x\y as absolute paths to Windows plugins. -Date: 2012-10-09 +* Tue Oct 9 07:54:48 2012 -0700 Revert "ldns requires socklen_t but Win32 doesn't have it." This has been fixed in ldns 1.6.14. -Date: 2012-10-08 +* Mon Oct 8 23:53:19 2012 -0700 Update URL -Date: 2012-10-08 +* Mon Oct 8 23:51:40 2012 -0700 Missing "the". -Date: 2012-10-08 +* Mon Oct 8 23:43:28 2012 -0700 Check ldns_resolver_new_frm_file() return code. -Date: 2012-10-08 +* Mon Oct 8 23:42:54 2012 -0700 If a new release ever sees the light, it will be 1.1.1. -Date: 2012-10-08 +* Mon Oct 8 23:29:45 2012 -0700 Update ChangeLog -Date: 2012-10-08 +* Mon Oct 8 23:29:28 2012 -0700 Update NEWS -Date: 2012-10-08 +* Mon Oct 8 23:28:56 2012 -0700 Update URL. -Date: 2012-10-08 +* Mon Oct 8 23:18:47 2012 -0700 Off-topic, but document how to compile ldns on Windows. -Date: 2012-10-08 +* Mon Oct 8 21:41:49 2012 -0700 ldns requires socklen_t but Win32 doesn't have it. So, define it on Win32. -Date: 2012-10-06 +* Sat Oct 6 09:54:22 2012 -0700 Remove OpenDNS-related plugins. -Date: 2012-10-06 +* Sat Oct 6 09:36:02 2012 -0700 Remove some sample plugins. -Date: 2012-10-05 +* Fri Oct 5 10:34:35 2012 -0700 Remove UDP_REQUEST_NO_RETRIES. Always support retries. -Date: 2012-10-03 +* Wed Oct 3 21:27:23 2012 -0700 Enforce a 2 second timeout. -Date: 2012-10-03 +* Wed Oct 3 16:50:20 2012 -0700 forward-after-nxdomain: allow 1 extra byte for the response if needed. -Date: 2012-10-03 +* Wed Oct 3 16:05:45 2012 -0700 Initial forward-after-nxdomain plugin implementation. -Date: 2012-10-02 +* Tue Oct 2 20:24:38 2012 -0700 Update ChangeLog -Date: 2012-09-29 +* Sat Sep 29 22:38:06 2012 +0200 Thanks, RotBlitz -Date: 2012-09-29 +* Sat Sep 29 22:25:01 2012 +0200 People are still running dnscrypt on old CPUs. Compile for Pentium 2 on Windows. -Date: 2012-09-29 +* Sat Sep 29 17:05:05 2012 +0200 Trim down optimization flags for Windows -Date: 2012-09-26 +* Wed Sep 26 11:26:07 2012 +0200 ChangeLog updates -Date: 2012-09-25 +* Tue Sep 25 21:00:12 2012 +0200 Stick to PACKAGE_STRING for the version, it's easier to parse. -Date: 2012-09-25 +* Tue Sep 25 19:44:44 2012 +0200 Remove the FreeBSD package. -Date: 2012-09-25 +* Tue Sep 25 19:35:06 2012 +0200 Unfuck pkgsrc packages on Dragonfly BSD. -Date: 2012-09-25 +* Tue Sep 25 19:19:44 2012 +0200 Update the NetBSD / Dragonfly BSD port. Plugin-less for now. -Date: 2012-09-25 +* Tue Sep 25 19:01:15 2012 +0200 Factorize dependencies -Date: 2012-09-25 +* Tue Sep 25 17:51:25 2012 +0200 PERMIT_PACKAGES => Yes -Date: 2012-09-25 +* Tue Sep 25 17:48:19 2012 +0200 Major update to the OpenBSD package. Build plugins as a subpackage. -Date: 2012-09-25 +* Tue Sep 25 16:03:23 2012 +0200 Improve the Homebrew formula after adamv@ review -Date: 2012-09-25 +* Tue Sep 25 15:35:27 2012 +0200 Enable plugins in the Linux packages -Date: 2012-09-25 +* Tue Sep 25 15:31:26 2012 +0200 Update fpm port -Date: 2012-09-25 +* Tue Sep 25 15:17:24 2012 +0200 Switch from tar-pax to tar-ustar because OpenBSD's tar(1) is confused with POSIX archives. -Date: 2012-09-25 +* Tue Sep 25 15:07:55 2012 +0200 Update the OpenBSD port to 1.1.0 -Date: 2012-09-25 +* Tue Sep 25 13:55:34 2012 +0200 Lion -> Mountain Lion -Date: 2012-09-24 +* Mon Sep 24 23:48:57 2012 +0200 Allow reading an OpenDNS device id from an environment variable named OPENDNS_DEVICE_ID as an alternative to giving it as an argument to the opendns_deviceid plugin. This information shouldn't be visible in the process name. -Date: 2012-09-24 +* Mon Sep 24 23:03:18 2012 +0200 Update the Homebrew package. -Date: 2012-09-24 +* Mon Sep 24 22:48:52 2012 +0200 Use tar-pax because some plugins files names are > 99 chars long. -Date: 2012-09-24 +* Mon Sep 24 19:55:01 2012 +0200 Don't use brackets in doxygen doc except for headers. -Date: 2012-09-24 +* Mon Sep 24 17:25:18 2012 +0200 ChangeLog -Date: 2012-09-24 +* Mon Sep 24 17:24:40 2012 +0200 Enable support for plugins in Windows builds. -Date: 2012-09-24 +* Mon Sep 24 17:20:08 2012 +0200 Require plugins to mention DCPLUGIN_MAIN(__FILE__); -Date: 2012-09-24 +* Mon Sep 24 15:58:58 2012 +0200 Update the ChangeLog, again. -Date: 2012-09-24 +* Mon Sep 24 15:56:18 2012 +0200 Android and iPhone build scripts have been moved. -Date: 2012-09-24 +* Mon Sep 24 15:53:57 2012 +0200 Update ChangeLog -Date: 2012-09-24 +* Mon Sep 24 15:53:38 2012 +0200 Mention the example plugins. -Date: 2012-09-24 +* Mon Sep 24 15:28:25 2012 +0200 Can you seriously expect Windows to implement putc_unlocked()? LOL. -Date: 2012-09-24 +* Mon Sep 24 15:04:32 2012 +0200 Ensure that assertions are always turned on. -Date: 2012-09-24 +* Mon Sep 24 14:06:55 2012 +0200 Add missing return statement. -Date: 2012-09-24 +* Mon Sep 24 13:55:07 2012 +0200 Update the ChangeLog -Date: 2012-09-24 +* Mon Sep 24 13:54:24 2012 +0200 Spaces vs tabs. Fu fu fu fu fuuuuuuuu -Date: 2012-09-24 +* Mon Sep 24 13:52:31 2012 +0200 libevent: arc4random_buf() doesn't return a value. Fix ev_arc4random_buf(). -Date: 2012-09-23 +* Sun Sep 23 21:49:27 2012 +0200 logging plugin: display a dot for a query for dot (duh!). -Date: 2012-09-23 +* Sun Sep 23 21:45:48 2012 +0200 Zap the final dot in a name before doing pattern matching on it. -Date: 2012-09-23 +* Sun Sep 23 21:31:56 2012 +0200 Don't use ldns wildcard matching, match * everywhere instead. People want to filter things like *xxx*, so let them do that. -Date: 2012-09-23 +* Sun Sep 23 18:23:50 2012 +0200 Init the locale. -Date: 2012-09-22 +* Sat Sep 22 23:14:05 2012 +0200 example-logging: bump the minimal required length up. -Date: 2012-09-22 +* Sat Sep 22 23:11:46 2012 +0200 Update the ChangeLog -Date: 2012-09-22 +* Sat Sep 22 23:05:53 2012 +0200 Add a new plugin that logs queries. -Date: 2012-09-22 +* Sat Sep 22 21:56:09 2012 +0200 Add WARNING for plugins. -Date: 2012-09-22 +* Sat Sep 22 21:46:56 2012 +0200 Don't include the full path to a plugin in examples. -Date: 2012-09-22 +* Sat Sep 22 21:43:18 2012 +0200 Use strcasecmp() in order to caselessly compare IPv6 addresses. -Date: 2012-09-22 +* Sat Sep 22 21:39:09 2012 +0200 Rewrite the ldns-blocking plugin, so that it can block any name and IP address. This plugin can be very useful in order to block ads and buggy replies. -Date: 2012-09-19 +* Wed Sep 19 17:35:51 2012 +0200 Move build scripts to a dist-build directory, add one for osx. -Date: 2012-09-19 +* Wed Sep 19 15:40:57 2012 +0200 Update ChangeLog -Date: 2012-09-19 +* Wed Sep 19 15:38:55 2012 +0200 Plugins can now be loaded from a default directory ($pkglibdir). In addition, a new configure flag, --enable-plugins-root, disallows loading plugins outside this directory. -Date: 2012-09-18 +* Tue Sep 18 04:05:18 2012 +0200 README-WINDOWS: ...\dnscrypt-proxy\Parameters is confusing, as "parameters" can be understood as a variable. So, add an example. Explain how plugins should be specified by the way. -Date: 2012-09-18 +* Tue Sep 18 04:04:58 2012 +0200 Indentatino :) -Date: 2012-09-16 +* Sun Sep 16 21:16:08 2012 +0200 A new configure flag, --disable-pie, can disable position-independent executables. A bad idea, but required by some OS. -Date: 2012-09-13 +* Thu Sep 13 16:10:41 2012 -0700 Merge 1.1.0 changelog, since there will probably be no more RC. -Date: 2012-09-13 +* Thu Sep 13 15:53:05 2012 -0700 Import example-ldns-blocking.c -Date: 2012-09-13 +* Thu Sep 13 13:41:33 2012 -0700 Update ChangeLog -Date: 2012-09-13 +* Thu Sep 13 13:30:16 2012 -0700 -fdata-sections -ffunction-sections doesn't seem very useful on Windows -Date: 2012-09-13 +* Thu Sep 13 13:16:22 2012 -0700 Having new lines in flags is a bad idea. -Date: 2012-09-13 +* Thu Sep 13 13:13:16 2012 -0700 Import a script to build the proxy on Win32 -Date: 2012-09-13 +* Thu Sep 13 12:42:32 2012 -0700 Silent MingW. -Date: 2012-09-13 +* Thu Sep 13 11:59:51 2012 -0700 Update ChangeLog -Date: 2012-09-13 +* Thu Sep 13 11:59:28 2012 -0700 Introduce --enable-relaxed-plugins-permissions -Date: 2012-09-13 +* Thu Sep 13 11:42:07 2012 -0700 If the proxy is run as root, refuse to load a plugin not owned by root. Yes, it's still totally racy, and not super useful, but better than nothing. -Date: 2012-09-13 +* Thu Sep 13 11:31:55 2012 -0700 Xcode 4.5-GM is just called Xcode -Date: 2012-09-13 +* Thu Sep 13 11:25:34 2012 -0700 Update ChangeLog -Date: 2012-09-13 +* Thu Sep 13 11:09:11 2012 -0700 Use Xcode 4.5 -Date: 2012-09-13 +* Thu Sep 13 10:52:20 2012 -0700 Pick up the new name for the blocking plugin -Date: 2012-09-13 +* Thu Sep 13 10:51:33 2012 -0700 Rename example-ldns example-ldns-blocking -Date: 2012-09-13 +* Thu Sep 13 08:59:19 2012 -0700 1.1.0-RC1 also fixed lookups of multiple TXT records, and thus handling of multiple certificates. -Date: 2012-09-13 +* Thu Sep 13 08:55:41 2012 -0700 Finally, the plugin API has been kinda documented. -Date: 2012-09-13 +* Thu Sep 13 08:40:25 2012 -0700 Add a link to the API documentation. -Date: 2012-09-13 +* Thu Sep 13 08:34:46 2012 -0700 Quote -Date: 2012-09-13 +* Thu Sep 13 08:28:09 2012 -0700 More doc on plugins -Date: 2012-09-13 +* Thu Sep 13 01:05:31 2012 -0700 Return REFUSED instead of NXDOMAIN when we get a blacklisted IP in a record of a response. It makes more sense, and OpenDNS can return the same IP for different reasons, not only NXDOMAIN. -Date: 2012-09-12 +* Wed Sep 12 22:54:35 2012 -0700 Start documenting plugins -Date: 2012-09-12 +* Wed Sep 12 22:54:20 2012 -0700 Untab README-WINDOWS -Date: 2012-09-12 +* Wed Sep 12 22:17:42 2012 -0700 Update NEWS -Date: 2012-09-12 +* Wed Sep 12 21:12:58 2012 -0700 Update ChangeLog Merge: f568bce beac641 -Date: 2012-09-12 +* Wed Sep 12 20:39:23 2012 -0700 Merge branch 'master' of https://github.com/jedisct1/dnscrypt-proxy @@ -694,31 +3082,31 @@ Date: 2012-09-12 The sendto_retry timer should be free()d before the callback, or else we end up with a big bad use after free and an even bigger and badder double free. Initialize dcps before using it, duh. It used to make virtually any plugin crash before it even had a chance to load on Linux, and on platforms it used to work on, it worked by accident. Reported by @transitorykris, confirmed by Valgrind. -Date: 2012-09-12 +* Wed Sep 12 20:32:07 2012 -0700 Update ChangeLog -Date: 2012-09-12 +* Wed Sep 12 20:31:35 2012 -0700 Sync libevent, fix two memory leaks in evdns. -Date: 2012-09-12 +* Wed Sep 12 22:19:42 2012 +0200 In sendto_with_retry(), free()ing the timer beforehand is a good idea but turning that in a different use-after-free is not. -Date: 2012-09-12 +* Wed Sep 12 21:00:32 2012 +0200 Initialize dcps at the right place. I'm just totally unable to write a single line of code when I am at the office. -Date: 2012-09-12 +* Wed Sep 12 20:55:05 2012 +0200 The sendto_retry timer should be free()d before the callback, or else we end up with a big bad use after free and an even bigger and badder double free. -Date: 2012-09-12 +* Wed Sep 12 20:29:40 2012 +0200 Initialize dcps before using it, duh. It used to make virtually any plugin crash before it even had a chance @@ -726,204 +3114,204 @@ Date: 2012-09-12 accident. Reported by @transitorykris, confirmed by Valgrind. -Date: 2012-09-11 +* Tue Sep 11 21:36:26 2012 -0700 The set-client-ip plugin also allows applying network settings when using IPv6 -Date: 2012-09-11 +* Tue Sep 11 21:06:51 2012 -0700 set-client-ip: randomize the fodder -Date: 2012-09-11 +* Tue Sep 11 20:50:58 2012 -0700 More data set-client-ip needs. -Date: 2012-09-11 +* Tue Sep 11 19:13:34 2012 -0700 The set-client-ip plugin needs more data in order to properly apply the network settings. -Date: 2012-09-10 +* Mon Sep 10 13:12:47 2012 -0700 Improve documentation for the set-client-ip plugin. -Date: 2012-09-10 +* Mon Sep 10 12:57:29 2012 -0700 Update ChangeLog. -Date: 2012-09-10 +* Mon Sep 10 12:51:46 2012 -0700 More descriptions -Date: 2012-09-10 +* Mon Sep 10 12:47:46 2012 -0700 More descriptions -Date: 2012-09-10 +* Mon Sep 10 12:33:10 2012 -0700 Document example-ldns-opendns-deviceid -Date: 2012-09-10 +* Mon Sep 10 10:51:45 2012 -0700 Add a simple example plugin to change the client IP when talking to OpenDNS resolvers. -Date: 2012-09-09 +* Sun Sep 9 22:40:07 2012 -0700 Thank you, Black Roland! -Date: 2012-09-09 +* Sun Sep 9 11:06:55 2012 -0700 Move the GUIs section up -Date: 2012-09-09 +* Sun Sep 9 09:58:05 2012 -0700 Reorder the Android build script so that TARGET_TOOLCHAIN_VERSION is defined before it is used :) -Date: 2012-09-09 +* Sun Sep 9 09:49:20 2012 -0700 Add Android -Date: 2012-09-09 +* Sun Sep 9 09:42:23 2012 -0700 That was --resolver-port -Date: 2012-09-09 +* Sun Sep 9 09:41:35 2012 -0700 Mention that --local-port and --remote-port are gone for good. -Date: 2012-09-09 +* Sun Sep 9 00:12:12 2012 -0700 Don't lie about why TCP is slow. -Date: 2012-09-06 +* Thu Sep 6 17:42:15 2012 -0700 Dash -Date: 2012-09-06 +* Thu Sep 6 17:41:57 2012 -0700 Update ChangeLog. It's 1.1.0-rc1 for now. -Date: 2012-09-06 +* Thu Sep 6 17:35:35 2012 -0700 Bump revision to 1.1.0rc1 -Date: 2012-09-06 +* Thu Sep 6 13:20:04 2012 -0700 Don't cast uint32_t values to print them. That's retarded. -Date: 2012-09-06 +* Thu Sep 6 13:16:40 2012 -0700 Grammar -Date: 2012-09-06 +* Thu Sep 6 10:55:18 2012 -0700 Update ChangeLog/NEWS. -Date: 2012-09-06 +* Thu Sep 6 10:47:52 2012 -0700 Rename the .plist file. -Date: 2012-09-06 +* Thu Sep 6 10:35:03 2012 -0700 Use plugin_long_description() in the null plugin, too. -Date: 2012-09-06 +* Thu Sep 6 10:30:18 2012 -0700 Add dcplugin_long_description() -Date: 2012-09-06 +* Thu Sep 6 10:16:01 2012 -0700 Add basic probes for filters. -Date: 2012-09-06 +* Thu Sep 6 00:35:35 2012 -0700 Retabify, try to match the initial code style. -Date: 2012-09-06 +* Thu Sep 6 00:17:32 2012 -0700 Update ChangeLog -Date: 2012-09-06 +* Thu Sep 6 00:16:19 2012 -0700 Check the RR length before any parsing, even if it's redundant. -Date: 2012-09-05 +* Wed Sep 5 23:59:08 2012 -0700 evdns: store more than 1 TXT record. -Date: 2012-09-05 +* Wed Sep 5 23:58:46 2012 -0700 Don't assume that only one TXT record will be received. -Date: 2012-09-04 +* Tue Sep 4 00:30:14 2012 -0700 Add libltdl to SUBDIRS, if plugins are enabled. -Date: 2012-09-03 +* Mon Sep 3 23:35:24 2012 -0700 80 cols -Date: 2012-09-03 +* Mon Sep 3 23:13:02 2012 -0700 Windows nits -Date: 2012-09-03 +* Mon Sep 3 22:42:13 2012 -0700 Add Plugins to the list of Windows registry keys, before I forget. -Date: 2012-09-03 +* Mon Sep 3 22:36:24 2012 -0700 Parse the "Plugins" key if there is one in the Windows registry. -Date: 2012-09-03 +* Mon Sep 3 22:09:15 2012 -0700 Windows: implement windows_service_registry_read_multi_sz() -Date: 2012-09-03 +* Mon Sep 3 19:14:15 2012 -0700 Return NXDOMAIN for an IP that actually needs it. -Date: 2012-09-03 +* Mon Sep 3 17:21:24 2012 -0700 Display the actual error when a plugin can't be loaded. -Date: 2012-09-03 +* Mon Sep 3 17:12:14 2012 -0700 Remove example-ldns-opendns-bypass -Date: 2012-09-03 +* Mon Sep 3 17:08:37 2012 -0700 Display the plugin description if we have one. -Date: 2012-09-03 +* Mon Sep 3 16:49:46 2012 -0700 Check that a plugin either belongs to root, or would be writeable by whoever runs the current process (or at least, by whoever can write to the fs). It's not very useful, it's racy, but it's better than nothing. -Date: 2012-09-03 +* Mon Sep 3 13:04:17 2012 -0700 Wipe the client nonce after uncurving a reply. Useful for debugging. -Date: 2012-09-03 +* Mon Sep 3 12:58:23 2012 -0700 Add tcp post-filters. -Date: 2012-09-02 +* Sun Sep 2 22:13:27 2012 -0700 No more dns_packet_len, stay consistent between udp_ & tcp_request.c -Date: 2012-09-02 +* Sun Sep 2 22:13:01 2012 -0700 Regen man pages. -Date: 2012-09-02 +* Sun Sep 2 21:15:18 2012 -0700 Add prefilters for TCP. -Date: 2012-09-02 +* Sun Sep 2 15:32:55 2012 -0700 Don't use max_packet_size. When using TCP, the packet size is not the data size, so, use the 'packet' terminology to actually mean a packet size, and @@ -931,84 +3319,84 @@ Date: 2012-09-02 No change to the compiled code, but it will help to make things more consistent between udp_request.c and tcp_request.c. -Date: 2012-09-02 +* Sun Sep 2 15:23:06 2012 -0700 Don't use dns_packet*, use dns_(query|reply)* in udp_request.c just like in tcp_request.c -Date: 2012-09-02 +* Sun Sep 2 14:21:52 2012 -0700 The default resolver is 208.67.220.220, not .222.222 -Date: 2012-09-02 +* Sun Sep 2 14:18:56 2012 -0700 The OSX GUI probably works on 32-bit systems now, and the OpenDNS GUI for Windows is apparently labeled "OpenDNSCrypt". -Date: 2012-09-02 +* Sun Sep 2 14:18:45 2012 -0700 Upcase -Date: 2012-08-29 +* Wed Aug 29 21:36:54 2012 -0700 Add an optional function for describing a plugin. -Date: 2012-08-29 +* Wed Aug 29 21:36:43 2012 -0700 Rename sample plugins -Date: 2012-08-27 +* Mon Aug 27 15:42:17 2012 -0700 Rename example-ldns-2 to example-ldns-opendns-deviceid and add the ability to provide a device id on the command line. -Date: 2012-08-27 +* Mon Aug 27 11:04:07 2012 -0700 Add two new OpenDNS-specific example plugins -Date: 2012-08-26 +* Sun Aug 26 09:55:42 2012 -0700 Regen dnscrypt-proxy man page. -Date: 2012-08-26 +* Sun Aug 26 09:55:30 2012 -0700 Update ChangeLog -Date: 2012-08-24 +* Fri Aug 24 19:55:48 2012 -0700 Shrink the default max payload size to 1252 bytes. -Date: 2012-08-24 +* Fri Aug 24 08:47:52 2012 -0700 Update libevent to 2.0.20 -Date: 2012-08-20 +* Mon Aug 20 20:31:54 2012 -0700 Include the port number in default IPs. Restore support for specifying IP addresses without ports. -Date: 2012-08-21 +* Tue Aug 21 10:48:36 2012 -0700 Update email. -Date: 2012-08-17 +* Fri Aug 17 22:52:24 2012 -0700 Don't use backtrace on Bitrig -Date: 2012-08-16 +* Thu Aug 16 15:37:58 2012 -0700 -P and -t are gone for good. -Date: 2012-08-07 +* Tue Aug 7 09:06:03 2012 -0700 Typo -Date: 2012-08-06 +* Mon Aug 6 10:57:49 2012 -0700 DP4 Merge: 1128c06 357d1be -Date: 2012-08-03 +* Fri Aug 3 15:10:00 2012 -0700 Merge branch '1.0.x' @@ -1017,26 +3405,26 @@ Date: 2012-08-03 When running the proxy as a Windows service, options have to be specified using the registry. Bump dnscrypt-proxy homebrew formula -Date: 2012-08-03 +* Fri Aug 3 15:07:56 2012 -0700 livevent: Add explicit AC_PROG_SED to configure.in so all autoconfs will expose $(SED) + avoid unused variable declaration. -Date: 2012-08-01 +* Wed Aug 1 23:21:01 2012 -0700 When running the proxy as a Windows service, options have to be specified using the registry. -Date: 2012-07-31 +* Tue Jul 31 12:41:21 2012 -0700 Actually install LTDL -Date: 2012-07-31 +* Tue Jul 31 12:08:44 2012 -0700 Bump dnscrypt-proxy homebrew formula Merge: 0016faf 18e9180 -Date: 2012-07-31 +* Tue Jul 31 11:46:28 2012 -0700 Merge branch '1.0.x' @@ -1046,42 +3434,42 @@ Date: 2012-07-31 Update ChangeLog If an evdns_getaddrinfo timeout happens while pending_cb is set, and a callback is about to run, but we get a call to evdns_getaddrinfo_gotresolve before it finishes. libevent dc3207767d4f06b31 -Date: 2012-07-31 +* Tue Jul 31 11:30:42 2012 -0700 Export droid-gcc variables -Date: 2012-07-31 +* Tue Jul 31 11:07:24 2012 -0700 fpm -> 1.0.1 -Date: 2012-07-31 +* Tue Jul 31 11:05:11 2012 -0700 Update ChangeLog -Date: 2012-07-31 +* Tue Jul 31 10:55:50 2012 -0700 If an evdns_getaddrinfo timeout happens while pending_cb is set, and a callback is about to run, but we get a call to evdns_getaddrinfo_gotresolve before it finishes. libevent dc3207767d4f06b31 -Date: 2012-07-31 +* Tue Jul 31 10:55:50 2012 -0700 If an evdns_getaddrinfo timeout happens while pending_cb is set, and a callback is about to run, but we get a call to evdns_getaddrinfo_gotresolve before it finishes. libevent dc3207767d4f06b31 -Date: 2012-07-30 +* Mon Jul 30 19:14:56 2012 -0700 Always install ltdl -Date: 2012-07-30 +* Mon Jul 30 19:04:18 2012 -0700 Merge 1.1 to master. Merge: 0d07695 24e697c -Date: 2012-07-30 +* Mon Jul 30 19:02:01 2012 -0700 Merge branch 'master' into 1.1 @@ -1089,17 +3477,17 @@ Date: 2012-07-30 Cut the crap. DNS using TCP can actually be faster than UDP. Provided that the resolver supports pipelining. Bump NDK to r8b -Date: 2012-07-29 +* Sun Jul 29 13:26:32 2012 -0700 Cut the crap. DNS using TCP can actually be faster than UDP. Provided that the resolver supports pipelining. -Date: 2012-07-29 +* Sun Jul 29 13:16:35 2012 -0700 Bump NDK to r8b Merge: c260e87 b12196d -Date: 2012-07-29 +* Sun Jul 29 13:12:24 2012 -0700 Merge branch 'master' into 1.1 @@ -1109,31 +3497,31 @@ Date: 2012-07-29 sort The --resolver-ip command-line switch is gone. Pointed out by awfulhak@ -Date: 2012-07-29 +* Sun Jul 29 13:12:08 2012 -0700 Regen man pages -Date: 2012-07-29 +* Sun Jul 29 13:01:00 2012 -0700 Mention that in hostip, --resolver-address can include a port number. -Date: 2012-07-29 +* Sun Jul 29 12:40:45 2012 -0700 sort -Date: 2012-07-29 +* Sun Jul 29 12:23:43 2012 -0700 The --resolver-ip command-line switch is gone. Pointed out by awfulhak@ Merge: 51a5d57 2ac78d9 -Date: 2012-07-26 +* Thu Jul 26 21:36:31 2012 -0700 Merge branch 'master' into 1.1 * master: Bring libevent patches up to a0912e32068621eb776d678224e4108511d281e3 -Date: 2012-07-26 +* Thu Jul 26 21:29:10 2012 -0700 Bring libevent patches up to a0912e32068621eb776d678224e4108511d281e3 @@ -1164,7 +3552,7 @@ Date: 2012-07-26 Remove deadcode in http regression tests. Found by coverity. Merge: 5e7e8a5 82cd026 -Date: 2012-07-26 +* Thu Jul 26 14:30:08 2012 -0700 Merge branch 'master' into 1.1 @@ -1175,25 +3563,25 @@ Date: 2012-07-26 use --enable-nonblocking-random as suggested by Frank DENIS. dnscrypt-proxy 0.9.4. -Date: 2012-07-26 +* Thu Jul 26 13:27:04 2012 -0700 Update ChangeLog -Date: 2012-07-26 +* Thu Jul 26 16:08:59 2012 -0400 Gentoo ebuild for dnscrypt-proxy 1.0. Merge: f3f8357 86d764e -Date: 2012-07-26 +* Thu Jul 26 16:02:19 2012 -0400 Merge remote-tracking branch 'upstream/master' into lebel -Date: 2012-07-26 +* Thu Jul 26 12:28:58 2012 -0700 Grammar Merge: 682ea2d fe1cc6a -Date: 2012-07-26 +* Thu Jul 26 12:27:29 2012 -0700 Merge branch 'master' into 1.1 @@ -1218,39 +3606,39 @@ Date: 2012-07-26 WINDOWS_SERVICE_NAME Add --install, --reinstall and --uninstall switches to install as a service. -Date: 2012-07-26 +* Thu Jul 26 12:22:32 2012 -0700 More links and docs. -Date: 2012-07-26 +* Thu Jul 26 12:17:02 2012 -0700 / => \ -Date: 2012-07-26 +* Thu Jul 26 12:15:22 2012 -0700 Add a README file for Windows. -Date: 2012-07-26 +* Thu Jul 26 11:59:50 2012 -0700 Actually start the service. -Date: 2012-07-26 +* Thu Jul 26 11:53:26 2012 -0700 Don't parse the command-line if the service is run as a... service. -Date: 2012-07-26 +* Thu Jul 26 11:52:58 2012 -0700 Remove Logfile from the registry. -Date: 2012-07-26 +* Thu Jul 26 11:33:45 2012 -0700 Support settings pretty much everything through the registry -Date: 2012-07-26 +* Thu Jul 26 00:44:04 2012 -0700 Reorder variables -Date: 2012-07-25 +* Wed Jul 25 23:32:14 2012 -0700 xor what we get from the system PRG with a HMAC of it. If the system PRG is truly random, it's a no-op. @@ -1258,52 +3646,52 @@ Date: 2012-07-25 found, leaked dnscrypt keys will still require breaking SHA2 in order take advantage of this. -Date: 2012-07-25 +* Wed Jul 25 18:23:38 2012 -0700 Start reading the configuration from the registry -Date: 2012-07-25 +* Wed Jul 25 18:09:09 2012 -0700 Don't bother registering the command-line, since we will use the registry. -Date: 2012-07-25 +* Wed Jul 25 18:06:49 2012 -0700 Auto-start the service, and add what it takes to read the registry. -Date: 2012-07-25 +* Wed Jul 25 20:57:42 2012 -0700 Read 952 bits (a full SHA256 block + a final one) from the system RNG -Date: 2012-07-25 +* Wed Jul 25 08:54:25 2012 -0700 Allow empty options. -Date: 2012-07-25 +* Wed Jul 25 08:52:20 2012 -0700 Add code for having a dynamic argv, so that we can use the registry to update it -Date: 2012-07-25 +* Wed Jul 25 00:09:13 2012 -0700 Keep the command line switches -Date: 2012-07-24 +* Tue Jul 24 22:42:24 2012 -0700 CreateService() dependencies should be an actual NULL string. -Date: 2012-07-24 +* Tue Jul 24 22:29:39 2012 -0700 Document the new command-line switches for running the proxy as a service. -Date: 2012-07-24 +* Tue Jul 24 22:19:19 2012 -0700 WINDOWS_SERVICE_NAME -Date: 2012-07-24 +* Tue Jul 24 22:17:37 2012 -0700 Add --install, --reinstall and --uninstall switches to install as a service. Merge: 1966e98 f3dd2c4 -Date: 2012-07-23 +* Mon Jul 23 16:54:36 2012 -0700 Merge branch 'master' into 1.1 @@ -1317,40 +3705,40 @@ Date: 2012-07-23 Make dnscrypt-proxy work as a Windows service. Add dnscrypt_proxy_loop_break() -Date: 2012-07-23 +* Mon Jul 23 16:53:37 2012 -0700 Head towards 1.0.1 -Date: 2012-07-23 +* Mon Jul 23 16:51:34 2012 -0700 gitignore libltdl -Date: 2012-07-23 +* Mon Jul 23 16:51:06 2012 -0700 Update ChangeLog -Date: 2012-07-23 +* Mon Jul 23 16:49:38 2012 -0700 Update NEWS -Date: 2012-07-23 +* Mon Jul 23 16:36:59 2012 -0700 WINAPI -Date: 2012-07-23 +* Mon Jul 23 16:27:02 2012 -0700 Make the service name overridable -Date: 2012-07-23 +* Mon Jul 23 15:58:51 2012 -0700 Make dnscrypt-proxy work as a Windows service. -Date: 2012-07-23 +* Mon Jul 23 15:32:29 2012 -0700 Add dnscrypt_proxy_loop_break() Merge: b675340 4d62957 -Date: 2012-07-22 +* Sun Jul 22 12:56:10 2012 -0700 Merge branch 'master' into 1.1 @@ -1358,16 +3746,16 @@ Date: 2012-07-22 Add Solaris support. Don't define _XPG4_2 -Date: 2012-07-22 +* Sun Jul 22 12:37:05 2012 -0700 Add Solaris support. -Date: 2012-07-22 +* Sun Jul 22 12:31:25 2012 -0700 Don't define _XPG4_2 Merge: ffa0fa2 d443b5d -Date: 2012-07-21 +* Sat Jul 21 18:14:48 2012 -0700 Merge branch 'master' into 1.1 @@ -1383,48 +3771,48 @@ Date: 2012-07-21 Don't use a hardcoded "ranlib" command. It doesn't play well with cross-compilation. arpa/inet.h is required for htonl() in cert.c -Date: 2012-07-21 +* Sat Jul 21 18:14:19 2012 -0700 Update NEWS / ChangeLog -Date: 2012-07-21 +* Sat Jul 21 18:09:57 2012 -0700 Target Gingerbread. -Date: 2012-07-21 +* Sat Jul 21 18:06:10 2012 -0700 Threads? We don't need threads any more. -Date: 2012-07-21 +* Sat Jul 21 17:57:48 2012 -0700 Add a compilation script for Android -Date: 2012-07-21 +* Sat Jul 21 17:56:09 2012 -0700 Bump to -j3 :) -Date: 2012-07-21 +* Sat Jul 21 17:47:33 2012 -0700 Don't use dtrace when cross-compiling. -Date: 2012-07-21 +* Sat Jul 21 17:45:01 2012 -0700 nacl: always include when rand*() is needed. -Date: 2012-07-21 +* Sat Jul 21 17:44:50 2012 -0700 ensure that libnacl/do is always executable -Date: 2012-07-21 +* Sat Jul 21 17:43:20 2012 -0700 Don't use a hardcoded "ranlib" command. It doesn't play well with cross-compilation. -Date: 2012-07-21 +* Sat Jul 21 17:26:06 2012 -0700 arpa/inet.h is required for htonl() in cert.c Merge: f1fa600 be57332 -Date: 2012-07-20 +* Fri Jul 20 14:21:42 2012 -0700 Merge branch 'master' into 1.1 @@ -1436,293 +3824,293 @@ Date: 2012-07-20 Bump fpm package to 1.0 Version 1.0 -Date: 2012-07-20 +* Fri Jul 20 14:21:10 2012 -0700 Update FreeBSD port -Date: 2012-07-20 +* Fri Jul 20 14:19:56 2012 -0700 Update Dragonfly BSD / NetBSD pkg -Date: 2012-07-20 +* Fri Jul 20 14:15:22 2012 -0700 Update Homebrew formula -Date: 2012-07-20 +* Fri Jul 20 14:12:37 2012 -0700 Update OpenBSD package -Date: 2012-07-20 +* Fri Jul 20 13:47:35 2012 -0700 Bump fpm package to 1.0 -Date: 2012-07-20 +* Fri Jul 20 13:01:23 2012 -0700 Version 1.0 -Date: 2012-07-20 +* Fri Jul 20 12:12:15 2012 -0700 Add a second sample plugin Merge: 0a6a1d6 4747092 -Date: 2012-07-20 +* Fri Jul 20 10:58:53 2012 -0700 Merge branch 'master' into 1.1 * master: Update .gitignore to reflect the dnscrypt-proxy->proxy changes -Date: 2012-07-20 +* Fri Jul 20 10:58:43 2012 -0700 Ignore Doxyfile for now -Date: 2012-07-20 +* Fri Jul 20 10:57:42 2012 -0700 Update .gitignore to reflect the dnscrypt-proxy->proxy changes -Date: 2012-07-20 +* Fri Jul 20 10:57:12 2012 -0700 Move plugin code in proxy/ as well. Merge: 124c97b 4a87920 -Date: 2012-07-20 +* Fri Jul 20 10:49:18 2012 -0700 Merge branch 'master' into 1.1 * master: Update autoconf again :) -Date: 2012-07-20 +* Fri Jul 20 10:48:35 2012 -0700 Update autoconf again :) Merge: 486243a 165facb -Date: 2012-07-20 +* Fri Jul 20 10:45:54 2012 -0700 Merge branch 'master' into 1.1 * master: Update autoconf -Date: 2012-07-20 +* Fri Jul 20 10:42:45 2012 -0700 Update autoconf -Date: 2012-07-20 +* Fri Jul 20 10:42:25 2012 -0700 Prepare another plugin Merge: b9d22cd 5761595 -Date: 2012-07-20 +* Fri Jul 20 09:17:25 2012 -0700 Merge branch 'master' into 1.1 * master: The "dnscrypt-proxy" dir just becomes "proxy" to reduce diff w/ dns-proxy. -Date: 2012-07-20 +* Fri Jul 20 09:16:47 2012 -0700 The "dnscrypt-proxy" dir just becomes "proxy" to reduce diff w/ dns-proxy. Merge: d7be569 649fa34 -Date: 2012-07-20 +* Fri Jul 20 08:43:14 2012 -0700 Merge branch 'master' into 1.1 * master: Remove uv_alloc_buffer_size leftover from the libuv days. -Date: 2012-07-20 +* Fri Jul 20 08:42:46 2012 -0700 Remove uv_alloc_buffer_size leftover from the libuv days. -Date: 2012-07-20 +* Fri Jul 20 00:43:52 2012 -0700 Grammar -Date: 2012-07-20 +* Fri Jul 20 00:02:37 2012 -0700 Add an example that uses ldns. -Date: 2012-07-19 +* Thu Jul 19 23:54:38 2012 -0700 Make headers C++-friendly and add a macro for copying a raw packet. -Date: 2012-07-19 +* Thu Jul 19 21:58:13 2012 -0700 KNF -Date: 2012-07-19 +* Thu Jul 19 21:49:41 2012 -0700 Ignore unused arguments, in order to keep the example as small as possible. -Date: 2012-07-19 +* Thu Jul 19 15:28:59 2012 -0700 Use dns_packet_len in TCP code, to reduce the diff with the UDP code. -Date: 2012-07-19 +* Thu Jul 19 15:20:44 2012 -0700 Typoz -Date: 2012-07-19 +* Thu Jul 19 15:10:30 2012 -0700 Doxygen the plugin API -Date: 2012-07-19 +* Thu Jul 19 14:35:21 2012 -0700 UDP post filter -Date: 2012-07-19 +* Thu Jul 19 13:42:41 2012 -0700 Export version. -Date: 2012-07-19 +* Thu Jul 19 12:48:15 2012 -0700 Keep libtool up until the plugin context is released. -Date: 2012-07-19 +* Thu Jul 19 12:34:11 2012 -0700 Add headers to get size_t defined. -Date: 2012-07-19 +* Thu Jul 19 12:32:31 2012 -0700 Call the first pre-filter. -Date: 2012-07-19 +* Thu Jul 19 12:19:25 2012 -0700 Looks like duplicate code, but if --tcp-only has been enabled, we don't want to call pre-filters. -Date: 2012-07-19 +* Thu Jul 19 12:11:36 2012 -0700 Prepare pre- and post- filters. Merge: 7337e74 cb06b13 -Date: 2012-07-18 +* Wed Jul 18 23:35:46 2012 -0700 Merge branch 'master' into 1.1 * master: Use CPPFLAGS, not AM_CFLAGS. -Date: 2012-07-18 +* Wed Jul 18 12:36:53 2012 -0700 Use CPPFLAGS, not AM_CFLAGS. -Date: 2012-07-18 +* Wed Jul 18 22:47:44 2012 -0700 dcps->argc should always be > 0 now. -Date: 2012-07-18 +* Wed Jul 18 22:45:06 2012 -0700 Set argv[0] to the plugin path -Date: 2012-07-18 +* Wed Jul 18 22:40:39 2012 -0700 Don't link ldns, that will only be for some specific plugins. -Date: 2012-07-18 +* Wed Jul 18 22:28:20 2012 -0700 Disable static libraries for plugins -Date: 2012-07-18 +* Wed Jul 18 22:21:07 2012 -0700 Log when parsing a --plugin switch fails. -Date: 2012-07-18 +* Wed Jul 18 22:02:07 2012 -0700 Remove module version. -Date: 2012-07-18 +* Wed Jul 18 21:02:41 2012 -0700 Fix plugin args -Date: 2012-07-18 +* Wed Jul 18 21:00:42 2012 -0700 Fix dcplugin_init() prototype. -Date: 2012-07-18 +* Wed Jul 18 20:24:38 2012 -0700 No need to check for LibLoaderApi.h and WinBase.h any more. -Date: 2012-07-18 +* Wed Jul 18 20:23:53 2012 -0700 Check if libldns is available. -Date: 2012-07-18 +* Wed Jul 18 19:54:32 2012 -0700 Add dcplugin_destroy() -Date: 2012-07-18 +* Wed Jul 18 18:20:56 2012 -0700 Start actually calling plugins. -Date: 2012-07-18 +* Wed Jul 18 18:04:55 2012 -0700 Start resolving symbols -Date: 2012-07-18 +* Wed Jul 18 17:52:50 2012 -0700 Load dynamic libraries. -Date: 2012-07-18 +* Wed Jul 18 16:56:33 2012 -0700 Link plugins with -module -Date: 2012-07-18 +* Wed Jul 18 16:51:16 2012 -0700 Prepare for loading plugins. -Date: 2012-07-18 +* Wed Jul 18 16:17:41 2012 -0700 plugin_name -> plugin_file -Date: 2012-07-18 +* Wed Jul 18 16:15:30 2012 -0700 Store plugin-specific options. -Date: 2012-07-18 +* Wed Jul 18 15:48:49 2012 -0700 Create and insert plugins. -Date: 2012-07-18 +* Wed Jul 18 14:53:20 2012 -0700 Use DCPluginSupportContext to handle multiple DCPluginSupport objects. -Date: 2012-07-18 +* Wed Jul 18 14:37:03 2012 -0700 More infrastructure for plugins. -Date: 2012-07-18 +* Wed Jul 18 13:06:20 2012 -0700 Document PLUGIN_REVISION -Date: 2012-07-18 +* Wed Jul 18 12:36:53 2012 -0700 Use CPPFLAGS, not AM_CFLAGS. -Date: 2012-07-18 +* Wed Jul 18 12:06:37 2012 -0700 is what developers should include for writing plugins. -Date: 2012-07-18 +* Wed Jul 18 11:52:36 2012 -0700 Install dnscrypt headers for plugin developers. Merge: b3e9707 9c1197d -Date: 2012-07-17 +* Tue Jul 17 21:59:33 2012 -0700 Merge branch 'master' into 1.1 * master: tab -Date: 2012-07-17 +* Tue Jul 17 21:59:14 2012 -0700 tab Merge: fb2a7f0 2799372 -Date: 2012-07-17 +* Tue Jul 17 21:58:17 2012 -0700 Merge branch 'master' into 1.1 @@ -1730,1825 +4118,1825 @@ Date: 2012-07-17 Add explicit dependencies. Update autoconf script. -Date: 2012-07-17 +* Tue Jul 17 21:53:08 2012 -0700 Prepare a simple plugin. -Date: 2012-07-17 +* Tue Jul 17 21:18:53 2012 -0700 Only build and link ltdl if plugins are enabled. -Date: 2012-07-17 +* Tue Jul 17 21:02:38 2012 -0700 Add explicit dependencies. -Date: 2012-07-17 +* Tue Jul 17 21:01:20 2012 -0700 Add some explicit dependencies -Date: 2012-07-17 +* Tue Jul 17 20:55:19 2012 -0700 Replace dl.[ch] with libltdl -Date: 2012-07-17 +* Tue Jul 17 20:36:13 2012 -0700 Update autoconf script. -Date: 2012-07-17 +* Tue Jul 17 20:32:30 2012 -0700 Add libltdl -Date: 2012-07-17 +* Tue Jul 17 20:09:50 2012 -0700 Add a basic dynamic library loader. -Date: 2012-07-17 +* Tue Jul 17 17:39:25 2012 -0700 Remove TRIM_PADDING_FROM_REPLIES. We always do. -Date: 2012-07-17 +* Tue Jul 17 17:38:36 2012 -0700 Move to version 1.0 -Date: 2012-07-17 +* Tue Jul 17 17:33:03 2012 -0700 libevent: Fix a memory leak on error in evhttp_uriencode. Not used in dnscrypt-proxy, but we should keep that up to date. -Date: 2012-07-17 +* Tue Jul 17 17:18:45 2012 -0700 Update ChangeLog -Date: 2012-07-17 +* Tue Jul 17 17:16:59 2012 -0700 Reenable --enable-debug -Date: 2012-07-17 +* Tue Jul 17 16:58:19 2012 -0700 Don't double quote CFLAGS. -Date: 2012-07-17 +* Tue Jul 17 16:22:32 2012 -0700 Change the way we pass the autoconf args to the libevent autoconf script. -Date: 2012-07-17 +* Tue Jul 17 13:05:16 2012 -0700 fpm -> 0.12 -Date: 2012-07-17 +* Tue Jul 17 12:33:08 2012 -0700 Update ChangeLog for 0.12 -Date: 2012-07-17 +* Tue Jul 17 12:01:17 2012 -0700 Bind UDP listeners first. -Date: 2012-07-17 +* Tue Jul 17 11:56:50 2012 -0700 Update ChangeLog -Date: 2012-07-17 +* Tue Jul 17 11:48:02 2012 -0700 Reset ac_configure_args before configuring libevent. This fixes the issue with the OpenBSD port, that was reseting both CC and CFLAGS. -Date: 2012-07-17 +* Tue Jul 17 11:21:02 2012 -0700 Use both -fPIE (cc) and -pie (linker) or none. -Date: 2012-07-17 +* Tue Jul 17 11:11:29 2012 -0700 Restore -pie. It breaks the OpenBSD-current port, but unbreaks Linux, aaahhhhhh. -Date: 2012-07-17 +* Tue Jul 17 10:30:58 2012 -0700 No more rlimit for now. -Date: 2012-07-17 +* Tue Jul 17 09:08:09 2012 -0700 Don't strip symbols on Debian packages. Screw you, stupid Debian policies. -Date: 2012-07-17 +* Tue Jul 17 08:40:41 2012 -0700 Start UDP listeners first. They provide an error message when they fail. -Date: 2012-07-17 +* Tue Jul 17 08:37:00 2012 -0700 Linux doesn't like RLIMIT_NPROC = 0. -Date: 2012-07-16 +* Mon Jul 16 22:47:26 2012 -0700 Use nonexistent.local instead of nonexistent.example.com or else OpenDNS servers can return the "guide" IP instead of NXDOMAIN. -Date: 2012-07-16 +* Mon Jul 16 21:40:01 2012 -0700 Invert the ifdef logic for retries. -Date: 2012-07-16 +* Mon Jul 16 21:32:45 2012 -0700 Enable retries. -Date: 2012-07-16 +* Mon Jul 16 21:26:01 2012 -0700 DNSCrypt 0.12 -Date: 2012-07-16 +* Mon Jul 16 21:22:38 2012 -0700 Fix UDP retries: ditch the retry timer after a successful sendto(). -Date: 2012-07-16 +* Mon Jul 16 18:16:39 2012 -0700 Update FreeBSD port. -Date: 2012-07-16 +* Mon Jul 16 18:14:16 2012 -0700 Update NetBSD / Dragonfly BSD packages again. -Date: 2012-07-16 +* Mon Jul 16 18:11:02 2012 -0700 Update OpenBSD package. -Date: 2012-07-16 +* Mon Jul 16 18:01:31 2012 -0700 Update Homebrew formula. -Date: 2012-07-16 +* Mon Jul 16 17:51:31 2012 -0700 Bring back _FORTIFY_SOURCE. -Date: 2012-07-16 +* Mon Jul 16 17:49:36 2012 -0700 Prepare OpenBSD package update. -Date: 2012-07-16 +* Mon Jul 16 17:42:56 2012 -0700 Add -fwrapv -Date: 2012-07-16 +* Mon Jul 16 17:34:44 2012 -0700 Update ChangeLog -Date: 2012-07-16 +* Mon Jul 16 17:33:48 2012 -0700 Nuke -pie for now. It breaks the OpenBSD-current port. -Date: 2012-07-16 +* Mon Jul 16 16:15:02 2012 -0700 Update NetBSD / Dragonfly BSD package -Date: 2012-07-16 +* Mon Jul 16 16:00:25 2012 -0700 Bump Homebrew package -Date: 2012-07-16 +* Mon Jul 16 15:07:56 2012 -0700 Cleanup dist-files -Date: 2012-07-16 +* Mon Jul 16 15:00:38 2012 -0700 Bump fpm packages to 0.11 -Date: 2012-07-16 +* Mon Jul 16 14:53:24 2012 -0700 Screw you, gcc -Date: 2012-07-16 +* Mon Jul 16 14:49:47 2012 -0700 gcc nits -Date: 2012-07-16 +* Mon Jul 16 14:40:01 2012 -0700 Disable UDP sendto() retries for now. -Date: 2012-07-16 +* Mon Jul 16 14:21:26 2012 -0700 0.11 -Date: 2012-07-16 +* Mon Jul 16 14:05:59 2012 -0700 Check for -W combos, not for individual switches. -Date: 2012-07-16 +* Mon Jul 16 14:05:46 2012 -0700 Add config.guess patch for bitrig to the tree. -Date: 2012-07-16 +* Mon Jul 16 13:50:15 2012 -0700 Try harder to trigger the gcc warning bug. -Date: 2012-07-16 +* Mon Jul 16 13:44:38 2012 -0700 Move clang detection -Date: 2012-07-16 +* Mon Jul 16 13:39:33 2012 -0700 Update Changelog -Date: 2012-07-16 +* Mon Jul 16 13:38:48 2012 -0700 Improve ax_check_compile_flag by adding an unused variable in order to always trigger a non-fatal compiler warning. -Date: 2012-07-16 +* Mon Jul 16 13:31:01 2012 -0700 Ignore unknown warnings only if we are using clang. -Date: 2012-07-16 +* Mon Jul 16 13:23:00 2012 -0700 Remove -Wno-unknown-warning-option because of this stupid gcc. -Date: 2012-07-16 +* Mon Jul 16 12:57:59 2012 -0700 libevent Win32: avoid crash when waiting forever on zero fds. -Date: 2012-07-16 +* Mon Jul 16 12:57:21 2012 -0700 Explicitly mention libtool in the autoconf script. -Date: 2012-07-16 +* Mon Jul 16 12:41:46 2012 -0700 Run sandbox_init() only if it's not a stub. -Date: 2012-07-16 +* Mon Jul 16 11:55:57 2012 -0700 Update Changelog -Date: 2012-07-16 +* Mon Jul 16 11:55:40 2012 -0700 Xcode 4.5DP3 -Date: 2012-07-16 +* Mon Jul 16 11:53:58 2012 -0700 Test --tcp-only -Date: 2012-07-16 +* Mon Jul 16 11:36:48 2012 -0700 Update dist-files -Date: 2012-07-16 +* Mon Jul 16 11:35:42 2012 -0700 opendnscache-proxy was the name of dnscrypt 1 year ago. Rename it to dnscrypt-proxy. -Date: 2012-07-16 +* Mon Jul 16 11:32:24 2012 -0700 Mention PowerDNS. -Date: 2012-07-16 +* Mon Jul 16 11:29:54 2012 -0700 And Gemfile and more tests. -Date: 2012-07-16 +* Mon Jul 16 11:01:52 2012 -0700 Exit with 1 when an invalid option is given in hostip, too. -Date: 2012-07-16 +* Mon Jul 16 10:43:52 2012 -0700 Exit with 1 when an unknown option is given. -Date: 2012-07-16 +* Mon Jul 16 00:34:06 2012 -0700 Revert to always using -fstack-protector-all on Windows. If it fails outside the MingW environment, either do some magic to statically link it, or use --disable-ssp if you're desperate. -Date: 2012-07-15 +* Sun Jul 15 23:58:37 2012 -0700 Statically link libssp on Windows. -Date: 2012-07-15 +* Sun Jul 15 23:12:15 2012 -0700 Windoz nitz -Date: 2012-07-15 +* Sun Jul 15 22:58:29 2012 -0700 Add --disable-ssp option for platforms lacking libssp. (sad) -Date: 2012-07-15 +* Sun Jul 15 21:50:18 2012 -0700 Ignore deprecated declarations warnings for sandbox*() -Date: 2012-07-15 +* Sun Jul 15 21:50:08 2012 -0700 Reorder -Date: 2012-07-15 +* Sun Jul 15 21:42:14 2012 -0700 Try to better detect Windows targets. -Date: 2012-07-15 +* Sun Jul 15 21:00:24 2012 -0700 Copy with Winsock2 prototypes. -Date: 2012-07-15 +* Sun Jul 15 21:00:10 2012 -0700 Use ev_socklen_t everywhere. -Date: 2012-07-15 +* Sun Jul 15 20:50:42 2012 -0700 Update noops for systems without dtrace. -Date: 2012-07-15 +* Sun Jul 15 17:23:58 2012 -0700 Update NEWS / ChangeLog -Date: 2012-07-15 +* Sun Jul 15 17:17:52 2012 -0700 Deprecate --local-port and --resolver-port -Date: 2012-07-15 +* Sun Jul 15 17:08:11 2012 -0700 Use some crazy heuristics to support ip:port addresses as well as the old format --x-address and --x-port. -Date: 2012-07-15 +* Sun Jul 15 17:02:50 2012 -0700 Export evutil_format_sockaddr_port() -Date: 2012-07-15 +* Sun Jul 15 16:04:47 2012 -0700 Update NEWS/ChangeLog -Date: 2012-07-15 +* Sun Jul 15 15:58:19 2012 -0700 Remove pwnam comments. -Date: 2012-07-15 +* Sun Jul 15 15:39:29 2012 -0700 Rename SendtoWithRetryCbCtx to SendtoWithRetryCtx -Date: 2012-07-15 +* Sun Jul 15 15:24:12 2012 -0700 Retries is zero, already, thanks to calloc(). -Date: 2012-07-15 +* Sun Jul 15 15:23:29 2012 -0700 Support retries on Windows. -Date: 2012-07-15 +* Sun Jul 15 14:46:41 2012 -0700 Retry every second. On relevant errors only. At least on !_WIN32. Windows roots are the DOS, anyway. -Date: 2012-07-15 +* Sun Jul 15 14:20:55 2012 -0700 Retry on UDP sendto() error. We should only do that on non-fatal errors only. Which means testing for different error codes on Windows. Bleh. -Date: 2012-07-15 +* Sun Jul 15 12:50:51 2012 -0700 Factorize sendto() calls and pave the way for retrying on non-fatal errors. -Date: 2012-07-13 +* Fri Jul 13 10:26:58 2012 -0700 Port 443 is already the default. -Date: 2012-07-12 +* Thu Jul 12 15:04:18 2012 -0700 Don't assert(! TAILQ_EMPTY()) unless the request has actually been inserted in the list of queued requests. Should fix issue #19. -Date: 2012-07-12 +* Thu Jul 12 14:24:45 2012 -0700 hostip: add things Windows needs in order to get the in6_addr structure defined -Date: 2012-07-11 +* Wed Jul 11 14:26:54 2012 -0700 Check for setrlimit() existence. -Date: 2012-07-11 +* Wed Jul 11 14:25:42 2012 -0700 Restrict a bit more what processes can do. -Date: 2012-07-09 +* Mon Jul 9 18:14:08 2012 -0700 Build hostip last. -Date: 2012-07-06 +* Fri Jul 6 21:37:12 2012 -0700 Indentation nits... -Date: 2012-07-06 +* Fri Jul 6 21:31:55 2012 -0700 Update ChangeLog, bump version to 0.11 -Date: 2012-07-06 +* Fri Jul 6 21:28:30 2012 -0700 Introduce hostip(8), a tool for resolving a name before dnscrypt-proxy starts. It should help fighting the chicken-and-egg issue seen on routers, where dnscrypt-proxy requires a working NTP server, but the NTP server requires a working resolver. -Date: 2012-07-06 +* Fri Jul 6 19:38:26 2012 -0700 Useless indentation nits. -Date: 2012-07-02 +* Mon Jul 2 23:35:17 2012 -0700 Use ioctl() instead of fnctl(fnctl()) as much as possible. Saves 1 syscall. -Date: 2012-07-02 +* Mon Jul 2 16:10:30 2012 -0700 Define getpwnam() and struct passwd if getpwnam(3) exists but the headers don't. -Date: 2012-06-26 +* Tue Jun 26 13:59:34 2012 -0700 Xcode 4.5 DP2 -Date: 2012-06-24 +* Sun Jun 24 23:55:10 2012 -0700 Bump Linux packages to 10.0.1 -Date: 2012-06-24 +* Sun Jun 24 23:47:40 2012 -0700 Update ChangeLog -Date: 2012-06-24 +* Sun Jun 24 15:45:48 2012 -0700 Current dev version is 0.10.1 -Date: 2012-06-24 +* Sun Jun 24 15:12:42 2012 -0700 chroot() as soon as we can again. Drop libevent2's evdns arc4random() to use our chroot()-proof salsa20_random() function instead. -Date: 2012-06-24 +* Sun Jun 24 15:08:11 2012 -0700 libevent: resurrect evdns_set_random_bytes_fn() and add evdns_set_random_init_fn(). Using the provided RC4 generator is nice, but we maybe want to use something else, in particular if we need something that is guaranteed to work in a chroot jail, without a /dev/*random device. -Date: 2012-06-24 +* Sun Jun 24 14:19:35 2012 -0700 libevent: don't use memset() to securely wipe a buffer, because it's prone to compiler optimization. -Date: 2012-06-24 +* Sun Jun 24 14:15:13 2012 -0700 libevent: do not close /dev/*random and /proc/**/uuid descriptors, in order to keep them accessible after chroot(), when reseeding is needed. -Date: 2012-06-24 +* Sun Jun 24 13:59:07 2012 -0700 Revoke privileges after cert_updater_start() for systems without arc4random(). Pointed out by Ben Kibbey. -Date: 2012-06-24 +* Sun Jun 24 11:46:27 2012 -0700 Change arc4random_uniform() to calculate ``2**32 % upper_bound'' as ``-upper_bound % upper_bound''. From OpenBSD. -Date: 2012-06-21 +* Thu Jun 21 10:47:36 2012 -0700 Update pkgsrc packages. -Date: 2012-06-21 +* Thu Jun 21 10:46:24 2012 -0700 Update FreeBSD package. Merge: f04c9ed 7a99603 -Date: 2012-06-21 +* Thu Jun 21 13:45:33 2012 -0400 Merge remote branch 'upstream/master' into lebel -Date: 2012-06-21 +* Thu Jun 21 10:45:06 2012 -0700 Update Homebrew formula. -Date: 2012-06-21 +* Thu Jun 21 10:44:23 2012 -0700 Update OpenBSD port. -Date: 2012-06-21 +* Thu Jun 21 02:18:36 2012 -0700 Update ChangeLog -Date: 2012-06-21 +* Thu Jun 21 02:18:13 2012 -0700 Don't install libevent. -Date: 2012-06-21 +* Thu Jun 21 00:36:44 2012 -0700 Compile with -fPIC if possible. -Date: 2012-06-21 +* Thu Jun 21 00:26:28 2012 -0700 Make some type conversions explicit. -Date: 2012-06-21 +* Thu Jun 21 00:13:33 2012 -0700 Typo -Date: 2012-06-20 +* Wed Jun 20 21:41:59 2012 -0700 Fix IOC diagnostic with a left shift. -Date: 2012-06-20 +* Wed Jun 20 08:45:58 2012 -0700 mingw defines cygwin32 as a host OS. -Date: 2012-06-19 +* Tue Jun 19 14:12:30 2012 -0700 Update NetBSD / Dragonfly BSD package. -Date: 2012-06-19 +* Tue Jun 19 14:10:17 2012 -0700 Update Homebrew formula -Date: 2012-06-19 +* Tue Jun 19 14:09:40 2012 -0700 Update OpenBSD package -Date: 2012-06-19 +* Tue Jun 19 14:07:52 2012 -0700 Update the FreeBSD port -Date: 2012-06-19 +* Tue Jun 19 13:43:20 2012 -0700 We officially support Bitrig. -Date: 2012-06-19 +* Tue Jun 19 12:00:14 2012 -0700 Update ChangeLog -Date: 2012-06-19 +* Tue Jun 19 11:59:16 2012 -0700 More dtrace probes. -Date: 2012-06-19 +* Tue Jun 19 11:46:02 2012 -0700 Update TCP dtrace probes -Date: 2012-06-19 +* Tue Jun 19 11:16:19 2012 -0700 Bump Linux packages to 0.10 -Date: 2012-06-19 +* Tue Jun 19 11:07:18 2012 -0700 Update libevent to be7a95c62995a679ee24146b0d641b7392cbab51 -Date: 2012-06-19 +* Tue Jun 19 10:57:09 2012 -0700 Cast txtlen to size_t -Date: 2012-06-19 +* Tue Jun 19 10:37:56 2012 -0700 Fix txt size check -Date: 2012-06-19 +* Tue Jun 19 10:29:16 2012 -0700 Update date & changelog. -Date: 2012-06-19 +* Tue Jun 19 08:48:23 2012 -0700 IPPROTO_TCP is defined in netinet/in.h on Dragonfly BSD -Date: 2012-06-19 +* Tue Jun 19 00:56:23 2012 -0700 More gwurglz zindoz needz -Date: 2012-06-19 +* Tue Jun 19 00:32:04 2012 -0700 Shit Windows needs. -Date: 2012-06-19 +* Tue Jun 19 00:02:39 2012 -0700 Some fixes for Windows... -Date: 2012-06-18 +* Mon Jun 18 21:38:47 2012 -0700 Allow 64K packets on TCP, use a different definition for UDP. -Date: 2012-06-18 +* Mon Jun 18 21:30:05 2012 -0700 Spacing, blank lines, etc. -Date: 2012-06-18 +* Mon Jun 18 21:25:48 2012 -0700 Test for big endianness in configure.ac Change the first part of the client nonce to little endian on a big endian system. Add 10 extra bits of randomness by the way. -Date: 2012-06-18 +* Mon Jun 18 17:55:48 2012 -0700 Update ChangeLog -Date: 2012-06-18 +* Mon Jun 18 17:55:08 2012 -0700 Disable the Nagle algorithm when sending a query to a resolver. -Date: 2012-06-18 +* Mon Jun 18 17:39:46 2012 -0700 If we need a free slot and there's none for the current protocol, steal one from the other protocol. Having distinct knobs for UDP and TCP makes sense now, but it will not make sense once OpenDNS will properly support TCP persistent connections. -Date: 2012-06-18 +* Mon Jun 18 17:21:41 2012 -0700 Factorize. -Date: 2012-06-18 +* Mon Jun 18 12:54:22 2012 -0700 Update ChangeLog -Date: 2012-06-18 +* Mon Jun 18 12:04:41 2012 -0700 Only resolve local_sockaddr once. -Date: 2012-06-18 +* Mon Jun 18 10:41:29 2012 -0700 Unfuck libevent on Win32 when threading support has been disabled. -Date: 2012-06-18 +* Mon Jun 18 08:23:26 2012 -0700 Run libevent's autogen.sh along with the top-level one. -Date: 2012-06-18 +* Mon Jun 18 01:26:51 2012 -0700 Unfuck compilation on Linux. -Date: 2012-06-18 +* Mon Jun 18 01:04:52 2012 -0700 Update ChangeLog -Date: 2012-06-18 +* Mon Jun 18 01:03:14 2012 -0700 Remove free() leftover. -Date: 2012-06-18 +* Mon Jun 18 00:48:26 2012 -0700 Use -Oz for the iOS build. -Date: 2012-06-14 +* Thu Jun 14 16:50:34 2012 -0700 Rewrite using libevent instead of libuv. -Date: 2012-06-13 +* Wed Jun 13 17:10:05 2012 -0700 libuv update -Date: 2012-06-13 +* Wed Jun 13 17:06:37 2012 -0700 Update Xcode -Date: 2012-05-20 +* Sun May 20 21:27:15 2012 -0700 Unbreak libuv compilation with mingw32. -Date: 2012-05-20 +* Sun May 20 19:15:17 2012 -0700 This libuv code is scary and we don't use it, but check at least the strdup() output. -Date: 2012-05-16 +* Wed May 16 07:13:49 2012 -0700 Change #if FIONBIO to #ifdef FIONBIO. Fixes compilation on Debian/ppc 6.0.4. Reported by Sebastian Sjoholm. -Date: 2012-02-09 +* Thu Feb 9 14:57:31 2012 -0800 Don't malloc(0). If we don't have any interfaces, return OK / null. -Date: 2012-02-09 +* Thu Feb 9 14:53:18 2012 -0800 Rewrite uv_hrtime() for Darwin in a portable way. -Date: 2012-02-09 +* Thu Feb 9 14:33:05 2012 -0800 rename() requires on OSX. Don't ask why. -Date: 2012-06-13 +* Wed Jun 13 16:59:43 2012 -0700 Resync libuv -Date: 2012-06-13 +* Wed Jun 13 16:31:44 2012 -0700 Remove overzealous assertion. -Date: 2012-06-13 +* Wed Jun 13 11:34:44 2012 -0700 Typo -Date: 2012-06-13 +* Wed Jun 13 11:23:35 2012 -0700 OpenDNS finally sends zero-padded replies. Define TRIM_PADDING_FROM_REPLIES. -Date: 2012-06-05 +* Tue Jun 5 16:58:17 2012 -0700 Update Homebrew formula. -Date: 2012-06-05 +* Tue Jun 5 16:55:01 2012 -0700 Update the OpenBSD package to 0.9.5 -Date: 2012-06-05 +* Tue Jun 5 16:30:34 2012 -0700 Update ChangeLog -Date: 2012-06-05 +* Tue Jun 5 16:30:10 2012 -0700 Implement dnscrypt_memzero() instead of using a volatile cast. -Date: 2012-06-05 +* Tue Jun 5 16:12:26 2012 -0700 Update ChangeLog -Date: 2012-06-05 +* Tue Jun 5 16:11:18 2012 -0700 Send the initial query through ares to whatever port has been specified using --resolver-port even using UDP. -Date: 2012-06-05 +* Tue Jun 5 16:00:43 2012 -0700 More libuv cherrypicks -Date: 2012-06-04 +* Mon Jun 4 22:09:50 2012 -0700 libuv cherrypicks -Date: 2012-06-04 +* Mon Jun 4 21:57:22 2012 -0700 Update ChangeLog -Date: 2012-06-04 +* Mon Jun 4 21:50:46 2012 -0700 Revert libuv to 3f0833eec07b5fbea2057c47e1c9014d3b347d35 Something looks broken on Linux between this revision and 75565907073055dd717fb6a6074518cafdd9355d. -Date: 2012-06-04 +* Mon Jun 4 15:52:28 2012 -0700 libuv update to 7d2ea316183ba29a8ab5883593d1f6ee6f8f8ae3 unix: fix event loop stall -Date: 2012-06-04 +* Mon Jun 4 12:28:03 2012 -0700 ChangeLog update. -Date: 2012-06-04 +* Mon Jun 4 12:02:10 2012 -0700 Update libuv to 0dff0e7d47453fafb72a287c0acdddd6e3f2d9de A big and scary update. -Date: 2012-05-29 +* Tue May 29 22:39:36 2012 -0700 Avoid compiler optimizations. -Date: 2012-05-28 +* Mon May 28 23:11:34 2012 -0700 Update the plist file to use port 443 by default. -Date: 2012-05-28 +* Mon May 28 22:39:56 2012 -0700 libuv update to 75565907073055dd717fb6a6074518cafdd9355d -Date: 2012-05-28 +* Mon May 28 22:25:18 2012 -0700 Make sure that the event loop is always NULL before parsing options. -Date: 2012-05-28 +* Mon May 28 22:17:24 2012 -0700 Don't call anything from libuv before fork()ing. Since libuv will never be fork()-safe. -Date: 2012-05-28 +* Mon May 28 22:01:48 2012 -0700 Initialize options one by one. Fixes dnscrypt on iOS. -Date: 2012-05-28 +* Mon May 28 21:49:59 2012 -0700 Log when uv_loop_new() fails. -Date: 2012-05-27 +* Sun May 27 10:56:45 2012 -0700 Remove libc6 dependency for RPMs because Fedora apparently doesn't like it. -Date: 2012-05-27 +* Sun May 27 01:16:08 2012 -0700 We need to somehow call WSAStartup before trying to perform any lookups on Win32. -Date: 2012-05-27 +* Sun May 27 00:57:48 2012 -0700 Unfuck Win32 build -Date: 2012-05-26 +* Sat May 26 19:32:53 2012 -0700 Fix Cygwin test -Date: 2012-05-26 +* Sat May 26 14:13:48 2012 -0700 Update NEWS -Date: 2012-05-26 +* Sat May 26 14:11:17 2012 -0700 Bump version to 0.9.5, but don't tag yet. -Date: 2012-05-26 +* Sat May 26 14:04:08 2012 -0700 Introduce ares_set_servers_any() -Date: 2012-05-26 +* Sat May 26 12:23:38 2012 -0700 Remove useless prototype. -Date: 2012-05-26 +* Sat May 26 12:21:41 2012 -0700 Remove STORAGE_PORT4 and STORAGE_PORT6. All we want is STORAGE_PORT_ANY. -Date: 2012-05-26 +* Sat May 26 12:13:05 2012 -0700 Complete IPv6 support. -Date: 2012-05-26 +* Sat May 26 11:30:03 2012 -0700 Support IPv6 for retrieving a certificate. -Date: 2012-05-26 +* Sat May 26 00:49:24 2012 -0700 Wrap some libuv functions to work both with IPv4 and IPv6. -Date: 2012-05-25 +* Fri May 25 21:11:26 2012 -0700 Don't use proxy_context->(ud|tc)p_listener_handle in a function where a handle is explicitly given. -Date: 2012-05-25 +* Fri May 25 20:49:13 2012 -0700 Trim padding from replies. Not supported by OpenDNS yet, so #ifdef'd. -Date: 2012-05-25 +* Fri May 25 20:37:11 2012 -0700 libuv update to 3f0833eec07b5fbea2057c47e1c9014d3b347d35 -Date: 2012-05-25 +* Fri May 25 14:28:33 2012 -0700 Ignore log_fd on Windows. -Date: 2012-05-23 +* Wed May 23 12:47:45 2012 -0400 Gentoo ebuiild for dnscrypt-proxy 0.9.4. -Date: 2012-05-23 +* Wed May 23 13:18:48 2012 -0400 use --enable-nonblocking-random as suggested by Frank DENIS. -Date: 2012-05-23 +* Wed May 23 12:47:45 2012 -0400 dnscrypt-proxy 0.9.4. -Date: 2012-05-22 +* Tue May 22 08:04:24 2012 -0700 libuv update to d1665792ca22d30b60319199662a0399be9f1352 -Date: 2012-05-22 +* Tue May 22 07:48:30 2012 -0700 Revert USE_NONBLOCKING_RANDOM since gathering enough entropy can be way too slow on Linux. Turn this switch on if your OS doesn't correctly seed /dev/urandom at boot and at install time, or use a better operating system. -Date: 2012-05-20 +* Sun May 20 23:04:48 2012 -0700 Update the Linux fpm package -Date: 2012-05-20 +* Sun May 20 23:04:23 2012 -0700 Update the FreeBSD package -Date: 2012-05-20 +* Sun May 20 23:02:30 2012 -0700 Update the NetBSD/Dragonfly BSD package. -Date: 2012-05-20 +* Sun May 20 23:00:10 2012 -0700 Update Homebrew formula. -Date: 2012-05-20 +* Sun May 20 22:58:59 2012 -0700 Update OpenBSD port. -Date: 2012-05-20 +* Sun May 20 22:41:42 2012 -0700 Unfuck libuv on Dragonfly... Again... -Date: 2012-05-20 +* Sun May 20 21:27:15 2012 -0700 Unbreak libuv compilation with mingw32. -Date: 2012-05-20 +* Sun May 20 21:06:06 2012 -0700 Update the OpenBSD port -Date: 2012-05-20 +* Sun May 20 19:30:44 2012 -0700 Update dist-files, dist-dirs -Date: 2012-05-20 +* Sun May 20 19:22:36 2012 -0700 Update ChangeLog -Date: 2012-05-20 +* Sun May 20 19:22:12 2012 -0700 Mention the new Gentoo packages and credit David Lebel. -Date: 2012-05-20 +* Sun May 20 19:17:20 2012 -0700 Doc update -Date: 2012-05-20 +* Sun May 20 19:15:17 2012 -0700 This libuv code is scary and we don't use it, but check at least the strdup() output. -Date: 2012-05-20 +* Sun May 20 18:55:36 2012 -0700 Use --enable-debug instead of --with-debug -Date: 2012-05-20 +* Sun May 20 18:53:58 2012 -0700 Provide --use-nonblocking-random if you really need to use /dev/urandom but use /dev/random by default. /dev/arandom has been removed from OpenBSD a long time ago, but I'm attached to it. -Date: 2012-05-20 +* Sun May 20 18:30:47 2012 -0700 Don't recommend DNS caches that are unable to perform DNSSec validation. -Date: 2012-05-20 +* Sun May 20 18:22:54 2012 -0700 Rename section title. -Date: 2012-05-20 +* Sun May 20 18:19:34 2012 -0700 Drop the --tcp-port= switch, and introduce --resolver-port= and --tcp-only switches instead. -Date: 2012-05-20 +* Sun May 20 15:43:15 2012 -0700 Update libuv to e82d46452e3db141d3875286cf90be0de6d724e0 -Date: 2012-05-17 +* Thu May 17 22:26:29 2012 -0700 Use Xcode4.4-DP5 -Date: 2012-05-16 +* Wed May 16 07:35:45 2012 -0700 Provide a link to github for bug reports. -Date: 2012-05-16 +* Wed May 16 07:16:15 2012 -0700 Credit Sebastian Sjoholm. -Date: 2012-05-16 +* Wed May 16 07:13:49 2012 -0700 Change #if FIONBIO to #ifdef FIONBIO. Fixes compilation on Debian/ppc 6.0.4. Reported by Sebastian Sjoholm. -Date: 2012-05-16 +* Wed May 16 07:12:41 2012 -0700 libuv - test: prevent accidental division by zero -Date: 2012-05-09 +* Wed May 9 12:51:06 2012 -0700 Mention the official GUI for Windows, now that it's officially out. -Date: 2012-05-06 +* Sun May 6 15:16:48 2012 -0700 Update Xcode Path to 4.4DP4, and mention that iOS binaries have to be signed. -Date: 2012-05-05 +* Sat May 5 21:43:04 2012 -0700 Sync ChangeLog -Date: 2012-05-05 +* Sat May 5 19:07:29 2012 -0700 Move all checks for linker flags to the same place, and always use -Wl. -Date: 2012-05-05 +* Sat May 5 18:56:25 2012 -0700 Add pass -z,noexecstack to the linker if it accepts it. Merge: 00af2e8 7c77d94 -Date: 2012-05-05 +* Sat May 5 18:51:16 2012 -0700 Merge remote-tracking branch 'lebel/lebel' * lebel/lebel: Add gentoo's portage files. -Date: 2012-05-05 +* Sat May 5 12:25:14 2012 -0700 Sync libuv to 985b961d4eab778857101b17b62f9e521d43a157 -Date: 2012-05-01 +* Tue May 1 13:54:54 2012 -0700 Switch the iOS SDK to 5.1 -Date: 2012-05-01 +* Tue May 1 13:26:19 2012 -0700 Update libuv to 6367da25b38274c31b42097056b2995c2696caef. Pretty sure it breaks non-Linux & OSX platforms as usual. -Date: 2012-05-01 +* Tue May 1 12:17:31 2012 -0700 Pad with 0x80...0 -Date: 2012-04-20 +* Fri Apr 20 09:59:05 2012 -0400 Add gentoo's portage files. -Date: 2012-03-21 +* Wed Mar 21 22:07:54 2012 -0700 Sync libuv up to c9c9d805dae321a7bdf0077547c2da2dbe70f2a2 -Date: 2012-03-19 +* Mon Mar 19 16:43:59 2012 -0700 Sync libuv up to 49d4e1884ba5ea135f68c8b17fdf2c5d5bf0f91e -Date: 2012-03-13 +* Tue Mar 13 15:30:47 2012 -0700 Give fpm a list of directories to package. -Date: 2012-03-12 +* Mon Mar 12 13:41:14 2012 -0700 libuv does support Openwall Linux by default, now. The libuv guys are very reactive when it comes to merging patches. -Date: 2012-03-12 +* Mon Mar 12 12:09:36 2012 -0700 Sync libuv up to db413f3806356a632774b8a589546fc6788debd6 -Date: 2012-03-07 +* Wed Mar 7 17:02:30 2012 -0800 Update ChangeLog -Date: 2012-03-07 +* Wed Mar 7 17:01:06 2012 -0800 --daemonize has been fixed. -Date: 2012-03-07 +* Wed Mar 7 16:38:01 2012 -0800 Update packages -Date: 2012-03-07 +* Wed Mar 7 16:24:10 2012 -0800 Update ChangeLog -Date: 2012-03-07 +* Wed Mar 7 16:21:33 2012 -0800 Initialize the event loop after having parse the options so that the event loop works fine after a possible fork() when the proxy is started with the --daemonize switch. -Date: 2012-03-07 +* Wed Mar 7 15:10:57 2012 -0800 sync libuv to d07f2466d0a10ab02db588374dd97c2edd54c7fc -Date: 2012-03-06 +* Tue Mar 6 16:54:16 2012 -0800 Update Dragonfly BSD & NetBSD package. -Date: 2012-03-06 +* Tue Mar 6 16:52:47 2012 -0800 Fix FreeBSD distinfo. -Date: 2012-03-06 +* Tue Mar 6 16:51:43 2012 -0800 Update FreeBSD package. -Date: 2012-03-06 +* Tue Mar 6 16:49:47 2012 -0800 Update OpenBSD package to 0.9.3 -Date: 2012-03-06 +* Tue Mar 6 16:47:50 2012 -0800 Update Homebrew formula. -Date: 2012-03-06 +* Tue Mar 6 16:47:07 2012 -0800 Bump Linux package version to 0.9.3 -Date: 2012-03-06 +* Tue Mar 6 14:11:02 2012 -0800 cygwin: we need to include uv-common.h for uv__set_sys_error() -Date: 2012-03-06 +* Tue Mar 6 12:22:52 2012 -0800 Add windows quirks to the distribution. -Date: 2012-03-06 +* Tue Mar 6 12:20:11 2012 -0800 Don't include sys/sysctl.h without sys/param.h first. -Date: 2012-03-06 +* Tue Mar 6 12:10:22 2012 -0800 Update ChangeLog -Date: 2012-03-06 +* Tue Mar 6 11:57:46 2012 -0800 Remove command-line switches that are unsupported on Win32. -Date: 2012-03-05 +* Mon Mar 5 15:26:53 2012 -0800 Add missing break so that comments in fingerprints work. -Date: 2012-03-05 +* Mon Mar 5 13:18:17 2012 -0800 Check for an actual library symbol in order to link Win32-specific libs. -Date: 2012-03-05 +* Mon Mar 5 12:46:00 2012 -0800 Update libuv to 5505f2e9063aaf9b52d47315ae4324efbb5834be -Date: 2012-03-03 +* Sat Mar 3 23:26:11 2012 -0800 Mention Noxwizard's dnscrypt-winclient -Date: 2012-03-03 +* Sat Mar 3 23:25:28 2012 -0800 is required for NULL to be defined in safe_rw.c -Date: 2012-03-02 +* Fri Mar 2 16:40:12 2012 -0800 Now, that's a super ugly way of linking ws2_32, psapi and iphlpapi. -Date: 2012-03-02 +* Fri Mar 2 15:41:50 2012 -0800 Mark some unused variables on Win32. -Date: 2012-03-02 +* Fri Mar 2 15:36:30 2012 -0800 Compile out more pid_file.c code on Win32. -Date: 2012-03-02 +* Fri Mar 2 15:33:39 2012 -0800 Use _WIN32 instead of __MINGW32__ just in case we want to support Visual Studio. -Date: 2012-03-02 +* Fri Mar 2 15:24:58 2012 -0800 Unfuck daemonization on Cygwin builds. -Date: 2012-03-02 +* Fri Mar 2 13:52:14 2012 -0800 Bump version to 0.9.3, featuring native support for Windows. Now, back to serious work. -Date: 2012-03-02 +* Fri Mar 2 13:37:11 2012 -0800 Native Windows builds are now supported. Sigh. -Date: 2012-03-02 +* Fri Mar 2 13:32:16 2012 -0800 Provide some logging on Windows, and disable unsupported options. -Date: 2012-03-02 +* Fri Mar 2 13:03:07 2012 -0800 Pass CRYPT_VERIFYCONTEXT to CryptAcquireContext(). -Date: 2012-03-02 +* Fri Mar 2 12:20:21 2012 -0800 Use the CryptoAPI on Win32. -Date: 2012-03-01 +* Thu Mar 1 20:41:31 2012 -0800 Fascinating whitespace changes. -Date: 2012-03-01 +* Thu Mar 1 20:06:11 2012 -0800 Sync libuv. test: make pipe_connect_to_file succeed with ECONNREFUSED windows: return UV_ENOTSOCK when doing uv_pipe_connect to a file -Date: 2012-03-01 +* Thu Mar 1 18:19:33 2012 -0800 Windows: we need to zero the loop structure when we initialize it or else the ares list of handles is uninitialized and bad things can happen when we try to perform async lookups. -Date: 2012-03-01 +* Thu Mar 1 17:14:15 2012 -0800 Oh course, there will be no /dev/*random on zindoz. -Date: 2012-03-01 +* Thu Mar 1 17:13:59 2012 -0800 Force line buffering for stdout, for zindoz -Date: 2012-03-01 +* Thu Mar 1 16:36:37 2012 -0800 Yes, it now natively compiles on Win32. Fortunately, it crashes. -Date: 2012-03-01 +* Thu Mar 1 16:33:38 2012 -0800 Shit Win32 needs. -Date: 2012-03-01 +* Thu Mar 1 16:30:42 2012 -0800 Link with Winsock2 on Windows. -Date: 2012-03-01 +* Thu Mar 1 16:26:20 2012 -0800 Unfuck MingW detection. -Date: 2012-02-29 +* Wed Feb 29 21:46:22 2012 -0800 libuv - unix: fix fs_event refcount bug on darwin -Date: 2012-02-29 +* Wed Feb 29 21:45:30 2012 -0800 libuv - unix: don't rely on libev to track timer state -Date: 2012-02-28 +* Tue Feb 28 23:54:17 2012 -0800 Bump year & remove empty line. (wow, awesome and useful commit) -Date: 2012-02-24 +* Fri Feb 24 16:26:20 2012 -0800 The beginning of the end. -Date: 2012-02-24 +* Fri Feb 24 16:19:27 2012 -0800 *sigh* -Date: 2012-02-23 +* Thu Feb 23 18:14:09 2012 -0800 There are so many random() calls that having just one hack for Win32 will never fit the bill. -Date: 2012-02-23 +* Thu Feb 23 18:12:13 2012 -0800 More disgusting changes Windows requires. Not having random()/srandom() is going to be a PITA. -Date: 2012-02-23 +* Thu Feb 23 18:03:17 2012 -0800 setrlimit() on Win32? LOL. -Date: 2012-02-23 +* Thu Feb 23 17:03:51 2012 -0800 is needed, even for Sleep(). -Date: 2012-02-23 +* Thu Feb 23 16:53:31 2012 -0800 Jeez, Win32 doesn't even provide sleep(). -Date: 2012-02-23 +* Thu Feb 23 14:52:53 2012 -0800 Fix memory leak in uv_exepath() on OSX. -Date: 2012-02-23 +* Thu Feb 23 14:07:08 2012 -0800 Sync libuv Share inotify fd across event loop. -Date: 2012-02-23 +* Thu Feb 23 13:24:46 2012 -0800 chmod +x do -Date: 2012-02-23 +* Thu Feb 23 12:59:41 2012 -0800 Update ChangeLog for version 0.9.2 -Date: 2012-02-23 +* Thu Feb 23 12:54:51 2012 -0800 Mention iOS support, bump version to 0.9.2 -Date: 2012-02-23 +* Thu Feb 23 12:46:15 2012 -0800 Some distributions don't provide a "hostname" command. Always use the same name for a compilation directory. -Date: 2012-02-23 +* Thu Feb 23 12:41:30 2012 -0800 Improve detection of -fPIE support. -Date: 2012-02-23 +* Thu Feb 23 12:22:42 2012 -0800 Unbreak libuv on iPhone. -Date: 2012-02-23 +* Thu Feb 23 12:15:54 2012 -0800 Don't benchmark functions at compile-time. That should be done at run-time. -Date: 2012-02-23 +* Thu Feb 23 10:05:50 2012 -0800 Test /dev/urandom with -r, not -f -Date: 2012-02-23 +* Thu Feb 23 10:00:43 2012 -0800 Run less executables at compile-time in order to make cross-compilation for iPhone & Android possible. -Date: 2012-02-23 +* Thu Feb 23 09:48:07 2012 -0800 Don't run test-c - It breaks cross-compilation. -Date: 2012-02-22 +* Wed Feb 22 16:04:48 2012 -0800 Add some extra info to the Debian packages so that lintian stops whining. -Date: 2012-02-21 +* Tue Feb 21 19:28:08 2012 -0800 libuv - linux: fix signedness issue in uv_exepath() -Date: 2012-02-17 +* Fri Feb 17 22:05:19 2012 -0800 Yup -Date: 2012-02-17 +* Fri Feb 17 15:59:27 2012 -0800 Add URL / maintainer / category to the Linux packages. -Date: 2012-02-17 +* Fri Feb 17 14:41:13 2012 -0800 Update NetBSD and Dragonfly BSD packages. -Date: 2012-02-17 +* Fri Feb 17 14:39:56 2012 -0800 Update FreeBSD & Homebrew packages -Date: 2012-02-17 +* Fri Feb 17 14:19:11 2012 -0800 Update the dnscrypt package for OpenBSD to 0.9.1 It should now work on non-Intel architectures. -Date: 2012-02-17 +* Fri Feb 17 13:51:43 2012 -0800 Bump version to 0.9.1 -Date: 2012-02-17 +* Fri Feb 17 13:51:25 2012 -0800 untab -Date: 2012-02-17 +* Fri Feb 17 13:46:20 2012 -0800 Both the compiler and the linker have to accept -fstack-protector -Date: 2012-02-17 +* Fri Feb 17 13:27:57 2012 -0800 Try to compile something that performs some stack allocation in order to make the AX_CHECK_COMPILE_FLAG work with -fstack-protector -Date: 2012-02-17 +* Fri Feb 17 12:16:02 2012 -0800 We actually need uclibc 0.9.32 to use ifaddrs.h -Date: 2012-02-16 +* Thu Feb 16 23:53:50 2012 -0800 Thanks, Lance Fredrickson. -Date: 2012-02-16 +* Thu Feb 16 23:36:00 2012 -0800 uClibc < 0.9.30 didn't have ifaddrs.h -Date: 2012-02-16 +* Thu Feb 16 17:14:12 2012 -0800 Regen OpenBSD distinfo. -Date: 2012-02-16 +* Thu Feb 16 17:08:05 2012 -0800 Update NEWS -Date: 2012-02-16 +* Thu Feb 16 16:58:32 2012 -0800 Replace cpucycles with a no-op. We're favoring portability for now, and we're not benchmarking functions. And cpucycles seems to be causing a lot of trouble on some architectures. -Date: 2012-02-16 +* Thu Feb 16 13:51:14 2012 -0800 Update Dragonfly BSD / NetBSD package. -Date: 2012-02-16 +* Thu Feb 16 13:49:00 2012 -0800 Update Homebrew formula. -Date: 2012-02-16 +* Thu Feb 16 13:48:11 2012 -0800 execinfo is *not* required on OpenBSD. -Date: 2012-02-16 +* Thu Feb 16 13:46:58 2012 -0800 Update OpenBSD packages -Date: 2012-02-16 +* Thu Feb 16 13:28:34 2012 -0800 Bump FreeBSD package to 0.9 -Date: 2012-02-16 +* Thu Feb 16 13:18:25 2012 -0800 Update the documentation to mention where the tarballs can be downloaded from. -Date: 2012-02-16 +* Thu Feb 16 12:46:56 2012 -0800 Update Linux packages to 0.9 -Date: 2012-02-16 +* Thu Feb 16 12:39:48 2012 -0800 Regen ChangeLog -Date: 2012-02-16 +* Thu Feb 16 12:37:58 2012 -0800 Set version to 0.9 Trying to keep the version number in sync with the Mac GUI doesn't make any sense, especially with a Windows GUI on the way. -Date: 2012-02-16 +* Thu Feb 16 12:13:41 2012 -0800 2012 & regen man page -Date: 2012-02-16 +* Thu Feb 16 12:10:27 2012 -0800 Remove test-ipc-threads.c and regen uv/dist-files. -Date: 2012-02-16 +* Thu Feb 16 12:07:18 2012 -0800 Resync libuv -Date: 2012-02-09 +* Thu Feb 9 14:59:55 2012 -0800 Explicitly NULLify app_context.proxy_context -Date: 2012-02-09 +* Thu Feb 9 14:57:50 2012 -0800 libuv: plug memleak on error path -Date: 2012-02-09 +* Thu Feb 9 14:57:31 2012 -0800 Don't malloc(0). If we don't have any interfaces, return OK / null. -Date: 2012-02-09 +* Thu Feb 9 14:53:18 2012 -0800 Rewrite uv_hrtime() for Darwin in a portable way. -Date: 2012-02-09 +* Thu Feb 9 14:33:05 2012 -0800 rename() requires on OSX. Don't ask why. -Date: 2012-02-09 +* Thu Feb 9 14:32:33 2012 -0800 Resync libuv -Date: 2012-01-25 +* Wed Jan 25 16:36:24 2012 -0800 Next version will be 0.11. (yeah, people are having a hard time figuring out that the OSX GUI is a different product, so let's try to keep version numbers more or less in sync) -Date: 2012-01-25 +* Wed Jan 25 16:27:57 2012 -0800 libuv cherrypick: unix: set SO_REUSEADDR before binding -Date: 2012-01-25 +* Wed Jan 25 16:27:12 2012 -0800 libuv cherrypick: unix: don't close kqueue fd in kqueue_fork() -Date: 2012-01-25 +* Wed Jan 25 16:26:42 2012 -0800 libuv cherrypick: unix: clean up udp read/write watchers -Date: 2012-01-25 +* Wed Jan 25 16:26:14 2012 -0800 libuv cherrypick: unix: clean up udp shutdown sequence -Date: 2012-01-25 +* Wed Jan 25 16:25:32 2012 -0800 libuv cherrypick: unix: don't retry close() on EINTR -Date: 2012-01-25 +* Wed Jan 25 16:24:50 2012 -0800 libuv cherrypick: unix: fix segfault in uv_guess_handle() -Date: 2012-01-25 +* Wed Jan 25 16:24:14 2012 -0800 libuv cherrypick: unix: fix udp recv_start refcount -Date: 2012-01-25 +* Wed Jan 25 16:23:35 2012 -0800 libuv cherrypick: remove unused #define -Date: 2012-01-25 +* Wed Jan 25 16:22:05 2012 -0800 libuv cherrypick: docs: add c-ares license note -Date: 2011-12-31 +* Sat Dec 31 22:29:59 2011 -0800 2012 -Date: 2011-12-21 +* Wed Dec 21 23:21:29 2011 -0800 Cherry-pick 6a9cb902ae25efa6f853dc10b20cd657b8a1f809 -Date: 2011-12-21 +* Wed Dec 21 23:20:42 2011 -0800 Cherrypick libuv 3cbe7c3f7952aa249450438b21cf4f346bb88e22 -Date: 2011-12-21 +* Wed Dec 21 23:10:26 2011 -0800 Revert "Update libuv" - libuv is still b0rk3d on OpenBSD, DragonflyBSD and NetBSD. -Date: 2011-12-21 +* Wed Dec 21 23:10:24 2011 -0800 Revert "Unbreak libuv on Dragonfly BSD." -Date: 2011-12-21 +* Wed Dec 21 18:36:43 2011 -0800 Unbreak libuv on Dragonfly BSD. -Date: 2011-12-21 +* Wed Dec 21 17:27:10 2011 -0800 Update libuv -Date: 2011-12-15 +* Thu Dec 15 09:06:20 2011 -0800 Set TZ even if strftime() fails. -Date: 2011-12-14 +* Wed Dec 14 21:52:33 2011 -0800 Update libuv - Except the obviously untested patch provided by Microsoft that totally breaks libuv on BSD. -Date: 2011-12-14 +* Wed Dec 14 21:37:42 2011 -0800 Revert - libuv is now totally b0rk3d on FreeBSD/DragonflyBSD. -Date: 2011-12-14 +* Wed Dec 14 21:14:18 2011 -0800 Big and scary update to libuv -Date: 2011-12-14 +* Wed Dec 14 09:30:48 2011 -0800 Add --disable-dependency-tracking to the Homebrew formula. -Date: 2011-12-13 +* Tue Dec 13 22:44:06 2011 -0800 Update Dragonfly BSD / NetBSD package. -Date: 2011-12-13 +* Tue Dec 13 22:41:28 2011 -0800 Update Homebrew package -Date: 2011-12-13 +* Tue Dec 13 22:40:07 2011 -0800 Update FreeBSD package. -Date: 2011-12-13 +* Tue Dec 13 22:36:40 2011 -0800 Update OpenBSD package. -Date: 2011-12-13 +* Tue Dec 13 17:50:32 2011 -0800 Update ChangeLog. -Date: 2011-12-13 +* Tue Dec 13 17:48:14 2011 -0800 We can detect accept4() while SOCK_CLOEXEC and SOCK_NONBLOCK are unavailable. Fixes compilation on Openwall-current. -Date: 2011-12-13 +* Tue Dec 13 17:37:48 2011 -0800 Redirect compile-time tests to an errors file. -Date: 2011-12-13 +* Tue Dec 13 17:16:39 2011 -0800 Update for Dragonfly BSD. -Date: 2011-12-13 +* Tue Dec 13 17:13:37 2011 -0800 -fstack-protector-all is causing trouble with Dragonfly BSD and NaCl. Use -fstack-protector only on Dragonfly BSD for now. -Date: 2011-12-13 +* Tue Dec 13 15:55:53 2011 -0800 Update packages to 0.8 - distinfo files have to be regenerated though. -Date: 2011-12-13 +* Tue Dec 13 15:51:52 2011 -0800 Update NEWS / ChangeLog -Date: 2011-12-12 +* Mon Dec 12 22:20:06 2011 -0800 Rename C_ASSERT, because Windows defines a macro with the same name. -Date: 2011-12-12 +* Mon Dec 12 17:21:57 2011 -0800 Don't use substitution in a $(shell) statement. -Date: 2011-12-12 +* Mon Dec 12 17:18:18 2011 -0800 Unfortunately, ULONG_LONG_MAX isn't always defined. -Date: 2011-12-12 +* Mon Dec 12 17:00:32 2011 -0800 Sync dist files -Date: 2011-12-12 +* Mon Dec 12 16:03:33 2011 -0800 Fix autoconf test. -Date: 2011-12-12 +* Mon Dec 12 16:03:19 2011 -0800 Don't include crypto_int32.h -Date: 2011-12-12 +* Mon Dec 12 15:47:20 2011 -0800 Missing quote -Date: 2011-12-12 +* Mon Dec 12 15:40:08 2011 -0800 Sync libuv -Date: 2011-12-11 +* Sun Dec 11 23:06:09 2011 -0800 assert() -> C_ASSERT() -Date: 2011-12-11 +* Sun Dec 11 23:01:22 2011 -0800 Ignore .DS_Store -Date: 2011-12-11 +* Sun Dec 11 22:53:12 2011 -0800 Typo -Date: 2011-12-11 +* Sun Dec 11 20:18:38 2011 -0800 Make getword() a bit faster by using all the output bytes. -Date: 2011-12-11 +* Sun Dec 11 19:30:19 2011 -0800 Rephrase. -Date: 2011-12-11 +* Sun Dec 11 19:28:20 2011 -0800 Introduce a C_ASSERT() macro instead of repeating (void) sizeof(char[X?1:-1]) -Date: 2011-12-11 +* Sun Dec 11 19:17:28 2011 -0800 Switch to salsa20/20 as a stream cipher. -Date: 2011-12-11 +* Sun Dec 11 17:02:48 2011 -0800 curvecp is fantastic but we don't use it for now. So don't ship a copy of it. -Date: 2011-12-10 +* Sat Dec 10 21:30:20 2011 -0800 Move Linux packages to /usr -Date: 2011-12-10 +* Sat Dec 10 16:12:06 2011 -0800 Provide better detection for Mingw when used on Windows. -Date: 2011-12-10 +* Sat Dec 10 15:35:08 2011 -0800 Disable -fstack-protector-all on Windows but enable specific flags for ASLR & DEP. -Date: 2011-12-10 +* Sat Dec 10 15:21:39 2011 -0800 Enable ASLR and DEP on Win32. -Date: 2011-12-10 +* Sat Dec 10 14:42:33 2011 -0800 Works out of the box on Windows using Cygwin (for now, native port is coming). -Date: 2011-12-10 +* Sat Dec 10 11:33:06 2011 -0800 Mention do-not-query-localhost: no for Unbound. -Date: 2011-12-09 +* Fri Dec 9 14:05:38 2011 -0800 We do support Openwall Linux now. -Date: 2011-12-09 +* Fri Dec 9 13:58:13 2011 -0800 Don't try compiling inotify-related functions on Linux distros without inotify. -Date: 2011-12-09 +* Fri Dec 9 13:57:34 2011 -0800 Provide compatibility with glibc versions that don't provide pipe2()/O_CLOEXEC -Date: 2011-12-09 +* Fri Dec 9 13:24:20 2011 -0800 resync dist-files. -Date: 2011-12-09 +* Fri Dec 9 13:19:40 2011 -0800 Moving on. -Date: 2011-12-09 +* Fri Dec 9 12:17:41 2011 -0800 Add the default public key for ed25519-signed certs. -Date: 2011-12-08 +* Thu Dec 8 17:41:15 2011 -0800 Switch to 2.dnscrypt-cert.opendns.com -Date: 2011-12-08 +* Thu Dec 8 17:38:24 2011 -0800 Switch to ed25519 -Date: 2011-12-08 +* Thu Dec 8 12:47:55 2011 -0800 Sync libuv -Date: 2011-12-08 +* Thu Dec 8 12:35:30 2011 -0800 Import ed25519 - thanks to djb for his feedback. -Date: 2011-12-07 +* Wed Dec 7 21:25:08 2011 -0800 Add a sample .plist file. -Date: 2011-12-07 +* Wed Dec 7 20:43:33 2011 -0800 Add a formula for Homebrew -Date: 2011-12-07 +* Wed Dec 7 12:41:28 2011 -0800 Nits -Date: 2011-12-07 +* Wed Dec 7 12:29:12 2011 -0800 Nits -Date: 2011-12-07 +* Wed Dec 7 12:25:23 2011 -0800 Nits -Date: 2011-12-07 +* Wed Dec 7 12:21:26 2011 -0800 Downcase + remove some redundant stuff. -Date: 2011-12-07 +* Wed Dec 7 12:13:59 2011 -0800 Spacing -Date: 2011-12-07 +* Wed Dec 7 12:08:21 2011 -0800 Per popular request, add a description of the protocol + implementation details. -Date: 2011-12-07 +* Wed Dec 7 08:44:02 2011 -0800 Add links & credits for NaCl and libuv. -Date: 2011-12-07 +* Wed Dec 7 08:36:55 2011 -0800 Add THANKS file, credit sthen@ for his help on the OpenBSD port. -Date: 2011-12-07 +* Wed Dec 7 08:35:01 2011 -0800 dnscrypt has been written by humans. -Date: 2011-12-07 +* Wed Dec 7 00:51:45 2011 -0800 Test presence of 6Jack, that will be required for new tests. Merge: 2a196e1 cfbb34c -Date: 2011-12-06 +* Tue Dec 6 15:32:15 2011 -0800 Merge pull request #1 from sthen/master OpenBSD port tweaks -Date: 2011-12-06 +* Tue Dec 6 23:19:11 2011 +0000 add ONLY_FOR_ARCH, NaCl needs more work on !i386/amd64 -Date: 2011-12-06 +* Tue Dec 6 23:17:10 2011 +0000 picks up libexecinfo if installed; add dep -Date: 2011-12-06 +* Tue Dec 6 23:16:40 2011 +0000 add OpenBSD cvs id -Date: 2011-12-06 +* Tue Dec 6 23:14:00 2011 +0000 needs a homedir to chroot to; use /var/empty -Date: 2011-12-06 +* Tue Dec 6 23:13:24 2011 +0000 daemonize in rc script, add cvs id for OpenBSD -Date: 2011-12-06 +* Tue Dec 6 12:25:52 2011 -0800 Fix MASTER_SITE and HOMEPAGE -Date: 2011-12-06 +* Tue Dec 6 11:57:21 2011 -0800 Switch back to using the .tar.gz file since the github CDN finally has it. -Date: 2011-12-06 +* Tue Dec 6 11:55:18 2011 -0800 Update the OpenBSD package. -Date: 2011-12-06 +* Tue Dec 6 11:45:28 2011 -0800 OpenBSD uid 685/686 were taken by other ports already. Switch to uid 688, reserved by sthen@ -Date: 2011-10-18 +* Tue Oct 18 21:33:26 2011 -0700 Initial public release. diff --git a/Makefile.am b/Makefile.am index e9634f3d..67ebad23 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,15 +1,16 @@ ACLOCAL_AMFLAGS = -I m4 -AUTOMAKE_OPTIONS = gnu - EXTRA_DIST = \ README.markdown \ README-PLUGINS.markdown \ README-WINDOWS.markdown \ TECHNOTES \ THANKS \ + apparmor.profile.dnscrypt-proxy \ autogen.sh \ - org.dnscrypt.osx.DNSCryptProxy.plist + org.dnscrypt.osx.DNSCryptProxy.plist \ + dnscrypt-proxy.service \ + dnscrypt-proxy.socket SUBDIRS = \ dist-build \ @@ -23,3 +24,6 @@ endif SUBDIRS += \ src \ test + +dist_pkgdata_DATA = \ + dnscrypt-resolvers.csv diff --git a/NEWS b/NEWS index 97685bf5..bc9812c3 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,58 @@ +* Version 1.4.3: + - libevent update, including a fix for CVE-2014-6272 + - Two new public dnscrypt resolvers were added: opennic-us-wa-ns1 and +dnscrypt.org-fr. + - d0wn servers in France IP have changed. + - Compilation fixes. + +* Version 1.4.2: + - New compilation switch: --with-systemd, to enable socket activation +support when using systemd. + - The list of public DNSCrypt-enabled resolvers was updated. + - Libevent2 updates. + +* Version 1.4.1: + - Alternative ports to dnscrypt.eu servers have been added + - Android build scripts are now part of the package + - UDP queries timing out are not retried any more. This caused some issues +and was already better handled by stub resolvers and caching name servers. + +* Version 1.4.0: + - Security: versions 0.11 to 1.3.3 were vulnerable to a denial of +service when running out of output buffer space. Reported by @iamultra. + - Windows: --uninstall now actually stops the service + - Windows: registry keys are automatically created for a given +provider when installing the service. + - The resolver to use and its configuration can now be specified as a +definition file + the name of the resolver to use. The new +command-line options to use are --resolvers-list= (optional +on non-Windows platforms) and --resolver-name=. This deprecates +--provider-key, --provider-name and --resolver-address. + - Documentation and diagnostics have been improved. + +* Version 1.3.3: + - Try to send questions as big as the response can be. Upgrading is +highly recommended, as the server can refuse to respond to queries using +UDP if the response is larger than the question. + +* Version 1.3.2: + - faster startup on iOS and Android + - New command-line switch: --test, in order to check if a certificate can be + used, with an optional time safety margin. + - The package now includes an AppArmor profile, thanks to InsanityBit. + - Plugins using ldns can now be compiled on Windows. + +* Version 1.3.1: + - dnscrypt-proxy doesn't ship its own, possibly outdated copy of libsodium + any more, and always picks the system one instead. + - Minor compilation improvements for iOS, Android and FreeBSD. + +* Version 1.3.0: + - The bundled NaCl library with only reference implementations has been + replaced with libsodium, leading to significant performance improvements. + - A new command-line switch, --loglevel, allows adjusting the log verbosity. + * Version 1.2.1: - Add support for certificates split into multiple TXT records. Contributed by Yecheng Fu, thanks! diff --git a/README-PLUGINS.markdown b/README-PLUGINS.markdown index f59913e1..c48c4933 100644 --- a/README-PLUGINS.markdown +++ b/README-PLUGINS.markdown @@ -4,8 +4,7 @@ DNSCrypt Plugins Overview -------- -Starting with version 1.1.0, `dnscrypt-proxy` can be extended with -plugins. +`dnscrypt-proxy` can be extended with plugins. A plugin can implement *pre-filters* and *post-filters*. @@ -89,6 +88,12 @@ Each plugin can optionally parse one or more arguments: --plugin=...libdcplugin_example.la,--one,--two,--three=4 --plugin=...libdcplugin_example2.la,127.0.0.1 +On Windows, example plugins relying on the ldns library require two +extra DLLs: + +- `libgcc_s_dw2-1.dll` +- `libeay32.dll`, from OpenSSL. + The plugin API -------------- diff --git a/README-WINDOWS.markdown b/README-WINDOWS.markdown index e0821ce9..a2cf2a55 100644 --- a/README-WINDOWS.markdown +++ b/README-WINDOWS.markdown @@ -6,23 +6,45 @@ as on other operating systems. Alternatively, it can run as a Windows Service. +Note: Also check out Dominus Temporis' excellent tutorial on +[DNSCrypt on Windows](http://dominustemporis.com/2014/05/dnscrypt-on-windows-update/) + Quickstart ---------- 1) Download and extract the latest -[Windows package for dnscrypt](http://dnscrypt.org) +[Windows package for dnscrypt](http://dnscrypt.org) and open the `bin` +directory. -2) Copy the `dnscrypt-proxy.exe` file to any location. +2) Copy the `dnscrypt-proxy.exe` file to any location, as well as the +dnscrypt-resolvers.csv file and the DLL files. +All the files should be in the same location. -3) Open a terminal (run `cmd.exe`) and type (you may need to specify +3) Open an elevated command prompt and type (you may need to specify the full path to the file): - dnscrypt-proxy.exe --install + dnscrypt-proxy.exe -R "name" -L "" --test=0 + +Replace `name` with one of the resolvers from CSV file. The (possibly +updated) file can also be viewed online: +[public DNS resolvers supporting DNSCrypt](https://github.com/jedisct1/dnscrypt-proxy/blob/master/dnscrypt-resolvers.csv) + +This command should display the server key fingerprint and exit. If +this is not the case, try a different server. If this is the case, +install the service: + + dnscrypt-proxy.exe -R "name" -L "" --install 4) Change your DNS settings to `127.0.0.1` Congratulations, you're now using DNSCrypt. +How to open an elevated command prompt +-------------------------------------- + +On Windows 8.1, press the Windows key + the X key and select "Windows +Command Prompt (Admin)" or "Windows PowerShell (Admin)". + Advanced usage -------------- @@ -30,7 +52,6 @@ The Windows build of `dnscrypt-proxy` adds the following command-line options: - `--install`: install the proxy as a service. -- `--reinstall`: ditto. - `--uninstall`: uninstall the service. Startup options should specified as subkeys from this registry key: @@ -45,6 +66,8 @@ The following subkeys are recognized and should be self-explanatory: ProviderKey (REG_SZ) ProviderName (REG_SZ) ResolverAddress (REG_SZ) + ResolverName (REG_SZ) + ResolversList (REG_SZ) EDNSPayloadSize (DWORD) MaxActiveRequests (DWORD) TCPOnly (DWORD) @@ -53,6 +76,13 @@ For example, in order to listen to local address `127.0.0.7` instead of `127.0.0.1`, the string value `127.0.0.7` should be set for the key `HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\dnscrypt-proxy\Parameters\LocalAddress`. +Mandatory entries to run `dnscrypt-proxy` as a Windows service are: +- `ResolversList`: has to be set to the full path to the `dnscrypt-resolvers.csv` file. +- `ResolverName`: has to be set to the resolver name to be used. See +the `dnscrypt-resolvers.csv` file for a list of compatible public resolvers. + +These entries are automatically created/updated when installing the service. + Plugins should be listed as full paths to .DLL files, optionally followed by a coma and plugin-specific arguments. diff --git a/README.markdown b/README.markdown index c010d011..b37ff084 100644 --- a/README.markdown +++ b/README.markdown @@ -1,16 +1,16 @@ +[![Build Status](https://travis-ci.org/jedisct1/dnscrypt-proxy.png?branch=master)](https://travis-ci.org/jedisct1/dnscrypt-proxy?branch=master) + [DNSCrypt](http://dnscrypt.org) =============================== -A tool for securing communications between a client and a DNS resolver. +A protocol for securing communications between a client and a DNS resolver. Description ----------- -dnscrypt-proxy provides local service which can be used directly as -your local resolver or as a DNS forwarder, encrypting and -authenticating requests using the DNSCrypt protocol and passing them -to an upstream server, by default OpenDNS who run this on their -resolvers. +`dnscrypt-proxy` provides local service which can be used directly as +your local resolver or as a DNS forwarder, authenticating requests +using the DNSCrypt protocol and passing them to an upstream server. The DNSCrypt protocol uses high-speed high-security elliptic-curve cryptography and is very similar to [DNSCurve](http://dnscurve.org/), @@ -22,6 +22,33 @@ network, which is often the weakest point of the chain, against man-in-the-middle attacks. It also provides some confidentiality to DNS queries. +Download and integrity check +---------------------------- + +DNSCrypt can be downloaded here: [dnscrypt download](http://dnscrypt.org) + +Note: dnscrypt.org is now blocked by the Great Firewall of China. +But the site can be accessed at dnscrypt.bit instead. Or if your +current DNS resolver doesn't support Namecoin yet, the source code can +also be downloaded on Github, in the "releases" section. + +After having downloaded a file, compute its SHA256 digest. For example: + + $ openssl dgst -sha256 dnscrypt-proxy-1.4.3.tar.bz2 + +Verify this digest against the expected one, that can be retrieved +using a simple DNS query: + + $ drill -D TXT dnscrypt-proxy-1.4.3.tar.bz2.download.dnscrypt.org + +or + + $ dig +dnssec TXT dnscrypt-proxy-1.4.3.tar.bz2.download.dnscrypt.org + +If the content of the TXT record doesn't match the SHA256 digest you +computed, please file a bug report on Github as soon as possible and +don't go any further. + Installation ------------ @@ -30,7 +57,20 @@ Bitrig, NetBSD, Dragonfly BSD, FreeBSD, Linux, iOS (requires a jailbroken device), Android (requires a rooted device), Solaris (SmartOS) and Windows (requires MingW). -Download the [latest version](http://dnscrypt.org) and extract it: +Install [libsodium](https://github.com/jedisct1/libsodium). +On Linux, don't forget to run `ldconfig` if you installed it from +source. + +A "minimal" build of libsodium (`--enable-minimal`) works equally well +as a full build with this proxy. + +On Fedora, RHEL and CentOS, you may need to add `/usr/local/lib` to +the paths the dynamic linker is going to look at. Before issuing +`ldconfig`, type: + + # echo /usr/local/lib > /etc/ld.so.conf.d/usr_local_lib.conf + +Now, download the latest `dnscrypt-proxy` version and extract it: $ bunzip2 -cd dnscrypt-proxy-*.tar.bz2 | tar xvf - $ cd dnscrypt-proxy-* @@ -43,9 +83,6 @@ Compile and install it using the standard procedure: Replace `-j2` with whatever number of CPU cores you want to use for the compilation process. -Running `make -j2 test` in the `src/libnacl` directory is also highly -recommended. - The proxy will be installed as `/usr/local/sbin/dnscrypt-proxy` by default. Command-line switches are documented in the `dnscrypt-proxy(8)` man page. @@ -60,28 +97,41 @@ GUIs for dnscrypt-proxy If you need a simple graphical user interface in order to start/stop the proxy and change your DNS settings, check out the following -projects: - -- [DNSCrypt OSX Client](http://opendns.github.com/dnscrypt-osx-client/): -A tool to easily use DNSCrypt with OpenDNS, configure plugins and -define resolvers for specific domains. It has been implemented as a -collection of shell scripts with a user interface in Objective C. +project: - [DNSCrypt WinClient](https://github.com/Noxwizard/dnscrypt-winclient): Easily enable/disable DNSCrypt on multiple adapters. Supports different ports and protocols, IPv6, parental controls and the proxy can act as a gateway service. Windows only, written in .NET. -- [DNSCrypt Win Client](https://github.com/opendns/dnscrypt-win-client): -Official GUI for Windows, by OpenDNS. Also known as "OpenDNSCrypt". +- [DNSCrypt Windows Service Manager](http://simonclausen.dk/projects/dnscrypt-winservicemgr/): +Assists in setting up DNSCrypt as a service, configure it and change network adapter DNS +settings to use DNSCrypt. It includes the option to use TCP/UDP protocol, IPV4/IPV6 +connectivity, choice of network adapter to configure, as well as configurations for currently +available DNSCrypt providers. -- dnscrypt-proxy is also available on Cydia, and it can be easily -enabled using [GuizmoDNS](http://modmyi.com/cydia/com.guizmo.dns). +- [DNSCrypt OSXClient](https://github.com/alterstep/dnscrypt-osxclient): +Mac OSX application to control the DNSCrypt Proxy. -Server-side proxy ------------------ +- [DNSCrypt Tools for Linux](http://opendesktop.org/content/show.php/DNScrypt+Tools?content=164488): +A set of tools for `dnscrypt-proxy`. Features a start and stop button as well as options to enable +or disable from startup. Developed for Porteus Linux. + +Docker images +------------- + +@mengbo maintains a [dnscrypt-proxy Docker image](https://github.com/mengbo/docker-dnscrypt) +as well as a [dnscrypt-wrapper Docker image](https://github.com/mengbo/docker-dnscrypt-wrapper). -[DNSCrypt-Wrapper](https://github.com/Cofyc/dnscrypt-wrapper) is a +DNSCrypt-enabled resolvers +-------------------------- + +To get started, you can use any of the +[public DNS resolvers supporting DNSCrypt](https://github.com/jedisct1/dnscrypt-proxy/blob/master/dnscrypt-resolvers.csv). + +If you want to add DNSCrypt support to your own public or private +resolver, check out +[DNSCrypt-Wrapper](https://github.com/Cofyc/dnscrypt-wrapper), a server-side dnscrypt proxy that works with any name resolver. Usage @@ -94,11 +144,14 @@ for this user's uid as soon as possible. The easiest way to start the daemon is: - # dnscrypt-proxy --daemonize + # dnscrypt-proxy --daemonize --resolver-name= + +Replace `` with the name of the resolver you want to +use (the first column in the list of public resolvers). The proxy will accept incoming requests on 127.0.0.1, tag them with an -authentication code, forward them to OpenDNS resolvers, and validate -each answer before passing it to the client. +authentication code, forward them to the resolver, and validate each +answer before passing it to the client. Given such a setup, in order to actually start using DNSCrypt, you need to update your `/etc/resolv.conf` file and replace your current @@ -112,34 +165,49 @@ Other common command-line switches include: * `--local-address=[:port]` in order to locally bind a different IP address than 127.0.0.1 * `--logfile=` in order to write log data to a dedicated file. By - default, logs are sent to stdout if the server is running in foreground, - and to syslog if it is running in background. +default, logs are sent to stdout if the server is running in foreground, +and to syslog if it is running in background. +* `--loglevel=` if you need less verbosity in log files. * `--max-active-requests=` to set the maximum number of active - requests. The default value is 250. -* `--pid-file=` in order to store the PID number to a file. +requests. The default value is 250. +* `--pidfile=` in order to store the PID number to a file. * `--user=` in order to chroot()/drop privileges. - -DNSCrypt comes pre-configured for OpenDNS, although the +* `--resolvers-list=`: to specity the path to the CSV file containing +the list of available resolvers, and the parameters to use them. +* `--test` in order to check that the server-side proxy is properly +configured and that a valid certificate can be used. This is useful +for monitoring your own dnscrypt proxy. See the man page for more +information. + +The `--resolver-address=[:port]`, `--provider-name=` -and `--provider-key=` can be specified in -order to change the default settings. +and `--provider-key=` switches can be specified in +order to use a DNSCrypt-enabled recursive DNS service not listed in +the configuration file. -Installation as a service (Windows only) ----------------------------------------- +Running dnscrypt-proxy using systemd +------------------------------------ -The proxy can be installed as a Windows service. +On a system using systemd, and when compiled with `--with-systemd`, +the proxy can take advantage of systemd's socket activation instead of +creating the sockets itself. The proxy will also notify systemd on successful +startup. -Copy the `dnscrypt-proxy.exe` file to any location, then open a -terminal and type (eventually with the full path to `dnscrypt-proxy.exe`): +Two sockets need to be configured: a UDP socket (`ListenStream`) and a +TCP socket (`ListenDatagram`) sharing the same port. - dnscrypt-proxy.exe --install +The source distribution includes the `dnscrypt-proxy.socket` and +`dnscrypt-proxy.service` files that can be used as a starting point. -It will install a new service named `dnscrypt-proxy`. +Installation as a service (Windows only) +---------------------------------------- -After being stopped, the service can be removed with: +The proxy can be installed as a Windows service. - dnscrypt-proxy.exe --uninstall +See +[README-WINDOWS.markdown](https://github.com/jedisct1/dnscrypt-proxy/blob/master/README-WINDOWS.markdown) +for more information on DNSCrypt on Windows. Using DNSCrypt in combination with a DNS cache ---------------------------------------------- @@ -179,7 +247,7 @@ IPv6 support IPv6 is fully supported. IPv6 addresses with a port number should be specified as [ip]:port - # dnscrypt-proxy --local-address='[::1]:40' --daemonize + # dnscrypt-proxy --local-address='[::1]:40' ... Queries using nonstandard ports / over TCP ------------------------------------------ @@ -192,7 +260,7 @@ As a workaround, the port number can be changed using the `--resolver-port=` option. For example, OpenDNS servers reply to queries sent to ports 53, 443 and 5353. -By default, dnscrypt-proxy sends outgoing queries to UDP port 443. +By default, `dnscrypt-proxy` sends outgoing queries to UDP port 443. In addition, the DNSCrypt proxy can force outgoing queries to be sent over TCP. For example, TCP port 443, which is commonly used for @@ -245,3 +313,63 @@ This tool can be useful for starting some services before `dnscrypt-proxy`. Queries made by `hostip` are not authenticated. + +Plugins +------- + +`dnscrypt-proxy` can be extended with plugins. A plugin acts as a +filter that can locally inspect and modify queries and responses. + +The plugin API is documented in the `README-PLUGINS.markdown` file. + +Any number of plugins can be combined (chained) by repeating the +`--plugin` command-line switch. + +The default distribution ships with some example plugins: + +* `libdcplugin_example_ldns_aaaa_blocking`: Directly return an empty +response to AAAA queries + +Example usage: + + # dnscrypt-proxy ... \ + --plugin libdcplugin_example_ldns_aaaa_blocking.la + +If IPv6 connectivity is not available on your network, this plugin +avoids waiting for responses about IPv6 addresses from upstream +resolvers. This can improve your web browsing experience. + +* `libdcplugin_example_ldns_blocking`: Block specific domains and IP +addresses. + +This plugin returns a REFUSED response if the query name is in a +list of blacklisted names, or if at least one of the returned +IP addresses happens to be in a list of blacklisted IPs. + +Recognized switches are: + + --domains= + --ips= + +A file should list one entry per line. + +IPv4 and IPv6 addresses are supported. +For names, leading and trailing wildcards (`*`) are also supported +(e.g. `*xxx*`, `*.example.com`, `ads.*`) + + # dnscrypt-proxy ... \ + --plugin libdcplugin_example,--ips=/etc/blk-ips,--domains=/etc/blk-names + +* `libdcplugin_example-logging`: Log client queries + +This plugin logs the client queries to the standard output (default) +or to a file. + + # dnscrypt-proxy ... \ + --plugin libdcplugin_example_logging,/var/log/dns.log + +* Extra plugins + +Additional plugins can be found on Github: +[Masquerade plugin](https://github.com/gchehab/dnscrypt-plugin-masquerade), +[GeoIP plugin](https://github.com/jedisct1/dnscrypt-plugin-geoip-block). diff --git a/TECHNOTES b/TECHNOTES index 187c922d..6ec9f6e9 100644 --- a/TECHNOTES +++ b/TECHNOTES @@ -5,27 +5,22 @@ Implementation details Cryptographic library --------------------- -- We didn't reinvent the wheel. +- The wheel hasn't been reinvented. -- The crypto code is provided by NaCl: http://nacl.cr.yp.to/ +- The crypto constructions come from [NaCl](http://nacl.cr.yp.to/) and + the proxy leverages [libsodium](https://github.com/jedisct1/libsodium). - Why NaCl? Unbloated, blazing fast, and less error-prone that other libraries. See http://cr.yp.to/highspeed/coolnacl-20111201.pdf -- Faster, but CPU-specific implementations have been removed, though, - so that portable packages can be built. CPU-specific implementations are - used server-side. - -- crypto_box_curve25519xsalsa20poly1305_*() for authenticating/encrypting - queries and replies, crypto_sign_ed25519_*() for signing certificates, and - crypto_stream_salsa20() as a PRNG. - - See the NaCl documentation for details. +- crypto_box() for authenticating/encrypting queries and replies, + crypto_sign() for signing certificates, randombytes_*() for random numbers. + See the [libsodium documentation](http://www.libsodium.org/doc/) for details. Event-notification library -------------------------- -- Uses libevent. Unbound's boilerplate is also excellent, but it hasn't been +- Uses libevent2. Unbound's boilerplate is also excellent, but it hasn't been packaged as a standalone library yet. - Because it is totally awesome for writing portable software. @@ -39,14 +34,19 @@ Certificates The following information has to be provided to the proxy: -- The provider name (defaults to 2.dnscrypt-cert.opendns.com.) -- The provider public key (defaults to the current one for OpenDNS). -- The resolver IP address (defaults to 208.67.220.220). +- The provider name +- The provider public key +- The resolver IP address + +These information can be automatically retrieved from the global list +(the `dnscrypt-proxy.csv` file) based on the name provided using the +`-R` (`--resolver-name`) command-line option. At startup and every 60 minute, the proxy directly connects to the specified resolver IP address and issues a TXT query for the provider name. The first component of the provider name indicates the latest protocol version, -or the version range, supported by the client. +or the version range, supported by the client. Right now, this should +be 2. Always. One or more TXT records are returned, each containing a signed certificate. The provider public key is only used to verify a certificate, never for @@ -63,6 +63,10 @@ Followed by signed content (the signature adds 512 bits to the payload): - 4 byte serial number - 4 + 4 byte validity period (two timestamps) +This is the current structure of the second version of the protocol. +Don't assume anything about its length, it is very likely to change +after a version bump. + The proxy drops invalid certificates for the current date, and picks the one with the highest serial number. @@ -75,7 +79,7 @@ pre-signed certificates. Queries ------- -Queries and replies are basically using djb's dnscurve protocol: +Queries and replies are based on djb's dnscurve protocol: http://www.dnscurve.org/ The proxy always generates a new, in-memory only key pair at startup. @@ -88,14 +92,14 @@ Encrypted queries are prefixed with the following header structure: - A 256 bit client public key - A 96 bit client nonce (64 bit monotically increasing timestamp + 32 random bits) -- A 128 bit Poly1305-AES MAC +- A 128 bit Poly1305 MAC Replies are prefixed with the following header structure: - 8 byte static magic header r6fnvWJ8 - A 192 bit nonce: the 96 bit client-supplied nonce + a 96 bit server nonce extension. -- A 128 bit Poly1305-AES MAC. +- A 128 bit Poly1305 MAC. The proxy immediately discards replies to queries made more than 10 second ago and replies that don't match the client-supplied nonce. @@ -104,7 +108,7 @@ Miscellaneous ------------- If you need extra monitoring/profiling, the proxy provides a bunch of -DTrace probes on OSX, as the dnscrypt-proxy provider. +dtrace probes on OSX, as the dnscrypt-proxy provider. See src/dnscrypt-proxy/probes_dnscrypt_proxy.d The proxy doesn't cache replies. Neither does it perform any DNSSEC @@ -121,7 +125,7 @@ the --tcp-port switch has been turned on. an EDNS section was already present or unless --payload-size with a < 512 bytes size has been specified. -OSX Mountain Lion, OpenBSD/amd64 and Dragonfly BSD/amd64 are the primary +OSX Yosemite, OpenBSD/amd64 and Dragonfly BSD/amd64 are the primary development platforms, but the code has been designed to be as portable as possible, and patches to support other operating systems and architectures are more than welcome. diff --git a/THANKS b/THANKS index 000daabf..09660e1c 100644 --- a/THANKS +++ b/THANKS @@ -6,3 +6,4 @@ David Lebel - Gentoo package Black Roland - OpenWRT packages RotBlitz - Reported that Windows binary packages should work on old CPUs. Marguerite Su - OpenSuSE packages +InsanityBit - AppArmor profile diff --git a/apparmor.profile.dnscrypt-proxy b/apparmor.profile.dnscrypt-proxy new file mode 100644 index 00000000..45dddcaa --- /dev/null +++ b/apparmor.profile.dnscrypt-proxy @@ -0,0 +1,31 @@ +# Last Modified: Tue Dec 02 22:20:12 2014 + +#include + +/usr/sbin/dnscrypt-proxy { + #include + + network inet stream, + network inet6 stream, + network inet dgram, + network inet6 dgram, + + capability net_admin, + capability net_bind_service, + capability setgid, + capability setuid, + capability sys_chroot, + capability ipc_lock, + + /bin/false r, + /etc/ld.so.cache r, + /etc/nsswitch.conf r, + /etc/passwd r, + +# In case of custom libsodium installation + /usr/local/lib/{@{multiarch}/,}libsodium.so* mr, + +# Reasonable pidfile location - tweak this if you prefer a different one + /run/dnscrypt-proxy.pid rw, + +} diff --git a/autogen.sh b/autogen.sh index aef8ec7b..b9a2e61c 100755 --- a/autogen.sh +++ b/autogen.sh @@ -10,8 +10,11 @@ else LIBTOOLIZE='libtoolize' fi -src/libevent/autogen.sh & -cpid=$! +src/libevent-modified/autogen.sh & +cpid1=$! + +src/libsodium/autogen.sh & +cpid2=$! $LIBTOOLIZE --ltdl && \ aclocal && \ @@ -19,4 +22,6 @@ autoheader && \ automake --add-missing --force-missing --include-deps && \ autoconf -wait $cpid +wait $cpid1 +wait $cpid2 + diff --git a/configure.ac b/configure.ac index 1d42a8f7..e5e53afc 100644 --- a/configure.ac +++ b/configure.ac @@ -1,12 +1,12 @@ -AC_PREREQ([2.61]) -AC_INIT([dnscrypt-proxy],[1.2.1],[http://dnscrypt.org]) +AC_PREREQ([2.65]) +AC_INIT([dnscrypt-proxy],[1.4.3],[http://dnscrypt.org]) AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_AUX_DIR([libltdl/config]) AC_CONFIG_SRCDIR([src/proxy/app.c]) AC_CONFIG_HEADER([config.h]) -AC_CONFIG_SUBDIRS([src/libevent]) +AC_CONFIG_SUBDIRS([src/libevent-modified]) AC_CANONICAL_HOST -AM_INIT_AUTOMAKE([1.9 dist-bzip2 tar-ustar]) +AM_INIT_AUTOMAKE([1.9 dist-bzip2 tar-ustar gnu subdir-objects]) AM_MAINTAINER_MODE AM_DEP_TRACK @@ -15,64 +15,173 @@ ISODATE=`date +%Y-%m-%d` AC_SUBST(ISODATE) LX_CFLAGS=${CFLAGS-NONE} -AC_PROG_CC_C99 -AC_USE_SYSTEM_EXTENSIONS -CPPFLAGS="$CPPFLAGS -D_FORTIFY_SOURCE=2" -AS_IF([test "$cross_compiling" != no], - AC_DEFINE(CROSS_COMPILING,,[define if you are cross-compiling]) +dnl Switches. + +AC_ARG_ENABLE(ssp, +[AS_HELP_STRING(--disable-ssp,Do not compile with -fstack-protector)], +[ + AS_IF([test "x$enableval" = "xno"], [ + enable_ssp="no" + ], [ + enable_ssp="yes" + ]) +], +[ + enable_ssp="yes" +]) + +AC_ARG_ENABLE(pie, +[AS_HELP_STRING(--disable-pie,Do not produce position independent executables)], + enable_pie=$enableval, enable_pie="maybe") + +AS_CASE([$host_os], [mingw*], [enable_pie="no"]) + +AC_ARG_WITH(safecode, +[AS_HELP_STRING(--with-safecode,For maintainers only - please do not use)], +[AS_IF([test "x$withval" = "xyes"], [ + AC_ARG_VAR([SAFECODE_HOME], [set to the safecode base directory]) + : ${SAFECODE_HOME:=/opt/safecode} + LDFLAGS="$LDFLAGS -L${SAFECODE_HOME}/lib" + LIBS="$LIBS -lsc_dbg_rt -lpoolalloc_bitmap -lstdc++" + CFLAGS="$CFLAGS -fmemsafety" + ]) +]) + +AC_ARG_ENABLE(debug, +[AS_HELP_STRING(--enable-debug,For maintainers only - please do not use)], +[ + AS_IF([test "x$enableval" = "xyes"], [ + AS_IF([test "x$LX_CFLAGS" = "xNONE"], [ + nxflags="" + for flag in `echo $CFLAGS`; do + AS_CASE([$flag], + [-O*], [ ], + [-g*], [ ], + [*], [AS_VAR_APPEND([nxflags], [" $flag"])]) + done + CFLAGS="$nxflags -O0 -g3" + ]) + CPPFLAGS="$CPPFLAGS -DDEBUG=1" + ]) +]) + +plugins=disabled +AC_ARG_ENABLE(plugins, +[AS_HELP_STRING(--enable-plugins,Enable support for plugins)], +[ + AS_IF([test "x$enableval" != "xno"], [ + CPPFLAGS="$CPPFLAGS -DPLUGINS=1" + plugins=enabled + ]) +]) +AM_CONDITIONAL(PLUGINS, test x$plugins = xenabled) + +relaxed_plugins_permissions=disabled +AC_ARG_ENABLE(relaxed-plugins-permissions, +[AS_HELP_STRING(--enable-relaxed-plugins-permissions,Allow loading plugins owned by other users)], +[ + AS_IF([test "x$enableval" != "xno"], [ + CPPFLAGS="$CPPFLAGS -DRELAXED_PLUGINS_PERMISSIONS=1" + relaxed_plugins_permissions=enabled + ]) +]) +AM_CONDITIONAL(RELAXED_PLUGINS_PERMISSIONS, test x$relaxed_plugins_permissions = xenabled) + +plugins_root=disabled +AC_ARG_ENABLE(plugins-root, +[AS_HELP_STRING(--enable-plugins-root,Only load plugins sitting in the default plugins directory)], +[ + AS_IF([test "x$enableval" != "xno"], [ + CPPFLAGS="$CPPFLAGS -DENABLE_PLUGINS_ROOT=1" + plugins_root=enabled + ]) +]) +AM_CONDITIONAL(ENABLE_PLUGINS_ROOT, test x$plugins_root = xenabled) + +AC_ARG_WITH([systemd], + AS_HELP_STRING([--with-systemd], [build with support for systemd]) ) -AX_CHECK_COMPILE_FLAG([-fPIC], [ - AX_CHECK_LINK_FLAG([-fPIC], - [CFLAGS="$CFLAGS -fPIC"] +have_systemd=no +AS_IF([test "x$with_systemd" = "xyes"], [ + PKG_CHECK_MODULES([SYSTEMD], [libsystemd], [have_systemd=yes], [ + PKG_CHECK_MODULES([SYSTEMD_DAEMON], [libsystemd-daemon], [have_systemd=yes], [have_systemd=no]) + ]) + AS_CASE([$with_systemd:$have_systemd], + [yes:no], + [AC_MSG_ERROR([systemd expected but libsystemd not found])], + [*:yes], + AC_DEFINE([HAVE_LIBSYSTEMD], [1], [Define if libsystemd is available]) ) ]) +AM_CONDITIONAL([HAVE_SYSTEMD], [test "x$have_systemd" = "xyes"]) + +AC_SUBST([MAINT]) + +dnl Checks + +AC_PROG_CC_C99 +AC_USE_SYSTEM_EXTENSIONS + +AX_CHECK_COMPILE_FLAG([-D_FORTIFY_SOURCE=2], + [CPPFLAGS="$CPPFLAGS -D_FORTIFY_SOURCE=2"]) + +AS_CASE([$host_os], [cygwin*|mingw*|msys|pw32*|cegcc*], [ ], [ + AX_CHECK_COMPILE_FLAG([-fPIC], [ + AX_CHECK_LINK_FLAG([-fPIC], + [CFLAGS="$CFLAGS -fPIC"] + ) + ]) +]) AS_IF([test "$enable_pie" != "no"],[ AX_CHECK_COMPILE_FLAG([-fPIE], [ - AX_CHECK_LINK_FLAG([-fPIE], - [AX_CHECK_LINK_FLAG([-pie], - [CFLAGS="$CFLAGS -fPIE" - LDFLAGS="$LDFLAGS -pie"]) + AX_CHECK_LINK_FLAG([-fPIE], [ + AX_CHECK_LINK_FLAG([-Wl,-pie], [ + CFLAGS="$CFLAGS -fPIE" + LDFLAGS="$LDFLAGS -Wl,-pie" + ], [ + AX_CHECK_LINK_FLAG([-pie], [ + CFLAGS="$CFLAGS -fPIE" + LDFLAGS="$LDFLAGS -pie" + ]) + ]) ]) ]) ]) -AX_CHECK_COMPILE_FLAG([-fcatch-undefined-c99-behavior], - [CFLAGS="$CFLAGS -fcatch-undefined-c99-behavior"], - [AX_CHECK_COMPILE_FLAG([-fwrapv], [CFLAGS="$CFLAGS -fwrapv"])] -) AX_CHECK_COMPILE_FLAG([-fno-strict-aliasing], [CFLAGS="$CFLAGS -fno-strict-aliasing"]) -AX_CHECK_COMPILE_FLAG([-fno-strict-overflow], [CFLAGS="$CFLAGS -fno-strict-overflow"]) +AX_CHECK_COMPILE_FLAG([-fno-strict-overflow], [CFLAGS="$CFLAGS -fno-strict-overflow"], [ + AX_CHECK_COMPILE_FLAG([-fwrapv], [CFLAGS="$CFLAGS -fwrapv"]) +]) -case $host_os in - cygwin* | mingw* | pw32* | cegcc*) +AS_CASE([$host_os], + [cygwin* | mingw* | pw32* | cegcc*], [ AX_CHECK_LINK_FLAG([-Wl,--dynamicbase], [LDFLAGS="$LDFLAGS -Wl,--dynamicbase"]) AX_CHECK_LINK_FLAG([-Wl,--nxcompat], [LDFLAGS="$LDFLAGS -Wl,--nxcompat"]) - AX_CHECK_COMPILE_FLAG([-fstack-protector-all], [ - AX_CHECK_LINK_FLAG([-fstack-protector-all], - [CFLAGS="$CFLAGS -fstack-protector-all"] - ) - ]) - ;; - dragonfly*) + ]) + +AS_IF([test "x$enable_ssp" != "xno"],[ + +AS_CASE([$host_os], + [cygwin* | mingw* | pw32* | cegcc*], [ ], + [dragonfly*], [ AX_CHECK_COMPILE_FLAG([-fstack-protector], [ AX_CHECK_LINK_FLAG([-fstack-protector], [CFLAGS="$CFLAGS -fstack-protector"] ) ]) - ;; - *) + ], + [*], [ AX_CHECK_COMPILE_FLAG([-fstack-protector-all], [ AX_CHECK_LINK_FLAG([-fstack-protector-all], [CFLAGS="$CFLAGS -fstack-protector-all"] ) ]) - ;; -esac + ]) +]) -AX_CHECK_COMPILE_FLAG([-Wbounded], [CFLAGS="$CFLAGS -Wbounded"]) AX_CHECK_COMPILE_FLAG([-Winit-self], [CFLAGS="$CFLAGS -Winit-self"]) AX_CHECK_COMPILE_FLAG([-Wwrite-strings], [CFLAGS="$CFLAGS -Wwrite-strings"]) AX_CHECK_COMPILE_FLAG([-Wdiv-by-zero], [CFLAGS="$CFLAGS -Wdiv-by-zero"]) @@ -135,7 +244,7 @@ case $host_os in case $build_os in darwin*) AC_ARG_VAR([DTRACE], [path to dtrace if you have it]) - AC_PATH_PROG([DTRACE], [dtrace]) + AC_PATH_PROG([DTRACE], [dtrace], [], [$PATH:/usr/local/sbin:/usr/sbin]) ;; esac ;; @@ -147,6 +256,8 @@ AS_IF([test -n "$DTRACE"],[ PROBES_SOURCE="probes_no_dtrace.h" ]) +AC_SUBST([PROBES_SOURCE]) + AS_IF([test -d /usr/local/include], [ CPPFLAGS="$CPPFLAGS -I/usr/local/include" ]) @@ -161,32 +272,42 @@ AC_SYS_LARGEFILE AC_CHECK_HEADERS([sys/cdefs.h sys/feature_tests.h]) AC_CHECK_HEADERS([execinfo.h paths.h pwd.h uuid/uuid.h]) AC_CHECK_HEADERS([sandbox.h]) +AC_CHECK_HEADERS([ws2tcpip.h]) dnl Checks for typedefs, structures, and compiler characteristics. +AC_C_INLINE AC_C_BIGENDIAN AC_C_RESTRICT AC_CHECK_TYPE([in_port_t], , [AC_DEFINE(in_port_t, uint16_t, [in_port_t type])], [ +#include #ifdef HAVE_UNISTD_H # include #endif -#include -#include -#include +#ifdef HAVE_WS2TCPIP_H +# include +#else +# include +# include +#endif ]) AC_MSG_CHECKING([whether sin_len is defined]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ +#include #include #ifdef HAVE_UNISTD_H # include #endif -#include -#include -#include +#ifdef HAVE_WS2TCPIP_H +# include +#else +# include +# include +#endif ]], [[ do { struct sockaddr_in a; @@ -194,19 +315,24 @@ do { } while(0) ]])],[ AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_SIN_LEN,,[define if you have sin_len]) + AC_DEFINE(HAVE_SIN_LEN,[1],[define if you have sin_len]) ],[ AC_MSG_RESULT(no) ]) AC_MSG_CHECKING([whether __ss_family is defined]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ +#include #include #ifdef HAVE_UNISTD_H # include #endif -#include -#include +#ifdef HAVE_WS2TCPIP_H +# include +#else +# include +# include +#endif ]], [[ do { struct sockaddr_storage a; @@ -214,19 +340,24 @@ do { } while(0) ]])],[ AC_MSG_RESULT(yes) - AC_DEFINE(HAVE___SS_FAMILY,,[define if you have __ss_family]) + AC_DEFINE(HAVE___SS_FAMILY,[1],[define if you have __ss_family]) ],[ AC_MSG_RESULT(no) ]) AC_MSG_CHECKING([whether ss_len is defined]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ +#include #include #ifdef HAVE_UNISTD_H # include #endif -#include -#include +#ifdef HAVE_WS2TCPIP_H +# include +#else +# include +# include +#endif ]], [[ do { struct sockaddr_storage a; @@ -234,19 +365,24 @@ do { } while(0) ]])],[ AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_SS_LEN,,[define if you have ss_len]) + AC_DEFINE(HAVE_SS_LEN,[1],[define if you have ss_len]) ],[ AC_MSG_RESULT(no) ]) AC_MSG_CHECKING([whether __ss_len is defined]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ +#include #include #ifdef HAVE_UNISTD_H # include #endif -#include -#include +#ifdef HAVE_WS2TCPIP_H +# include +#else +# include +# include +#endif ]], [[ do { struct sockaddr_storage a; @@ -254,7 +390,7 @@ do { } while(0) ]])],[ AC_MSG_RESULT(yes) - AC_DEFINE(HAVE___SS_LEN,,[define if you have __ss_len]) + AC_DEFINE(HAVE___SS_LEN,[1],[define if you have __ss_len]) ],[ AC_MSG_RESULT(no) ]) @@ -264,25 +400,31 @@ dnl Checks for library functions. AC_SEARCH_LIBS(pow, [m]) AC_SEARCH_LIBS(dlopen, [dl]) AC_SEARCH_LIBS(clock_gettime, [rt], - [AC_DEFINE(HAVE_CLOCK_GETTIME,,[define if you have clock_gettime()])]) + [AC_DEFINE(HAVE_CLOCK_GETTIME,[1],[define if you have clock_gettime()])]) AC_SEARCH_LIBS(backtrace, [execinfo], - [AC_DEFINE(HAVE_BACKTRACE,,[define if you have backtrace()])]) + [AC_DEFINE(HAVE_BACKTRACE,[1],[define if you have backtrace()])]) AC_SEARCH_LIBS(gethostbyname, [resolv nsl]) AC_SEARCH_LIBS(recvfrom, [socket]) AC_SEARCH_LIBS(kvm_open, [kvm]) +AC_SEARCH_LIBS(sodium_hex2bin, [sodium], [ ], AC_ERROR([libsodium >= 0.5.0 not found])) use_ldns=no AC_CHECK_HEADER([ldns/ldns.h], [ - AC_CHECK_LIB(ldns, ldns_verify_trusted, [ - AC_DEFINE(USE_LDNS,,[define to use the ldns library]) + AC_CHECK_LIB(ldns, ldns_wire2pkt, [ + AC_DEFINE(USE_LDNS,[1],[define to use the ldns library]) LDNS_LIBS=-lldns use_ldns=yes ]) ], [ ], -[#include - #include ]) +[#include + #include + #include + #ifdef HAVE_WS2TCPIP_H + # include + #endif +]) AM_CONDITIONAL(USE_LDNS, test x$use_ldns = xyes) AC_SUBST([LDNS_LIBS]) @@ -297,88 +439,8 @@ esac AC_CHECK_HEADER([CoreServices/CoreServices.h], [LIBS="$LIBS -framework CoreFoundation -framework CoreServices"]) -AC_CHECK_FUNCS([getpwnam sandbox_init setrlimit putc_unlocked]) -AC_CHECK_FUNCS([SecureZeroMemory]) - -dnl Switches. - -AC_ARG_ENABLE(pie, -[AS_HELP_STRING(--enable-pie,Produce position independent executables @<:@default=yes@:>@)], - enable_pie=$enableval, enable_pie="maybe") - -AC_ARG_ENABLE(ssp, -[AS_HELP_STRING(--disable-ssp,Don't compile with -fstack-protector)], -[AS_IF([test "x$enableval" = "xno"], [ - nxflags="" - for flag in `echo $CFLAGS`; do - case "$flag" in - -fstack-protector*) ;; - *) AS_VAR_APPEND([nxflags], [" $flag"]) ;; - esac - done - CFLAGS="$nxflags" - ]) -]) - -plugins=disabled -AC_ARG_ENABLE(plugins, -[AS_HELP_STRING(--enable-plugins,Enable support for plugins - experimental)], -[CPPFLAGS="$CPPFLAGS -DPLUGINS=1" - plugins=enabled]) -AM_CONDITIONAL(PLUGINS, test x$plugins = xenabled) - -relaxed_plugins_permissions=disabled -AC_ARG_ENABLE(relaxed-plugins-permissions, -[AS_HELP_STRING(--enable-relaxed-plugins-permissions,Allow loading plugins owned by other users)], -[CPPFLAGS="$CPPFLAGS -DRELAXED_PLUGINS_PERMISSIONS=1" - relaxed_plugins_permissions=enabled]) -AM_CONDITIONAL(RELAXED_PLUGINS_PERMISSIONS, test x$relaxed_plugins_permissions = xenabled) - -plugins_root=disabled -AC_ARG_ENABLE(plugins-root, -[AS_HELP_STRING(--enable-plugins-root,Only load plugins sitting in the default plugins directory)], -[CPPFLAGS="$CPPFLAGS -DENABLE_PLUGINS_ROOT=1" - plugins_root=enabled]) -AM_CONDITIONAL(ENABLE_PLUGINS_ROOT, test x$plugins_root = xenabled) - -AC_ARG_ENABLE(blocking-random, -[AS_HELP_STRING(--enable-blocking-random,Use /dev/random instead of /dev/urandom)], -[AC_DEFINE([USE_BLOCKING_RANDOM], [], [Use blocking random])]) - -AC_ARG_ENABLE(debug, -[AS_HELP_STRING(--enable-debug,For maintainers only - please do not use)], -[ - AS_IF([test "x$LX_CFLAGS" = "xNONE"], [ - nxflags="" - for flag in `echo $CFLAGS`; do - case "$flag" in - -O*) ;; - -g*) ;; - *) AS_VAR_APPEND([nxflags], [" $flag"]) ;; - esac - done - CFLAGS="$nxflags -O0 -g3" - ]) - CPPFLAGS="$CPPFLAGS -DDEBUG=1" -]) - -AC_ARG_WITH(safecode, -[AS_HELP_STRING(--with-safecode,For maintainers only - please do not use)], -[AS_IF([test "x$withval" = "xyes"], [ - AC_ARG_VAR([SAFECODE_HOME], [set to the safecode base directory]) - : ${SAFECODE_HOME:=/opt/safecode} - LDFLAGS="$LDFLAGS -L${SAFECODE_HOME}/lib" - LIBS="$LIBS -lsc_dbg_rt -lpoolalloc_bitmap -lstdc++" - CFLAGS="$CFLAGS -fmemsafety" - ]) -]) - -NACL_HOSTNAME="localhost" -NACL_PATH=libnacl/build/${NACL_HOSTNAME} - -AC_SUBST([MAINT]) -AC_SUBST([NACL_PATH]) -AC_SUBST([PROBES_SOURCE]) +AC_CHECK_FUNCS([getpwnam sandbox_init setrlimit putc_unlocked gmtime_r]) +AC_CHECK_FUNCS([sodium_mlock]) dnl Libtool. @@ -388,16 +450,6 @@ LTDL_INIT dnl Subconfig. -nx_ac_configure_args="" -for flag in $ac_configure_args; do - case "$flag" in - \'--build*) AS_VAR_APPEND([nx_ac_configure_args], [" $flag"]) ;; - \'--host*) AS_VAR_APPEND([nx_ac_configure_args], [" $flag"]) ;; - *) ;; - esac -done -ac_configure_args="$nx_ac_configure_args" - case $host_os in cygwin* | mingw* | pw32* | cegcc*) ;; *) ac_configure_args="$ac_configure_args --disable-thread-support" ;; @@ -408,12 +460,12 @@ ac_configure_args="$ac_configure_args --disable-libevent-install" ac_configure_args="$ac_configure_args --disable-openssl" ac_configure_args="$ac_configure_args --disable-shared" ac_configure_args="$ac_configure_args --enable-function-sections" -export CC -export CFLAGS -export CPP -export CPPFLAGS -export LDFLAGS -export LIBS +ac_configure_args="$ac_configure_args CC='$CC'" +ac_configure_args="$ac_configure_args CFLAGS='$CFLAGS'" +ac_configure_args="$ac_configure_args CPP='$CPP'" +ac_configure_args="$ac_configure_args CPPFLAGS='$CPPFLAGS'" +ac_configure_args="$ac_configure_args LDFLAGS='$LDFLAGS'" +ac_configure_args="$ac_configure_args LIBS='$LIBS'" dnl Output. @@ -431,20 +483,13 @@ AC_CONFIG_FILES([Makefile src/ext/Makefile src/include/Makefile src/include/dnscrypt/version.h - src/libnacl/Makefile - src/libnacl/tests/Makefile - src/libnacl/okcompilers/c - src/libnacl/okcompilers/do src/plugins/Makefile src/plugins/example/Makefile - src/plugins/example-ldns-forward-after-nxdomain/Makefile src/plugins/example-logging/Makefile src/plugins/example-ldns-aaaa-blocking/Makefile src/plugins/example-ldns-blocking/Makefile src/plugins/example-ldns-opendns-deviceid/Makefile + src/plugins/example-ldns-opendns-set-client-ip/Makefile test/Makefile]) AC_OUTPUT - -chmod +x src/libnacl/do -chmod +x src/libnacl/okcompilers/do diff --git a/dist-build/Makefile.am b/dist-build/Makefile.am index fd31986f..bf5d2d82 100644 --- a/dist-build/Makefile.am +++ b/dist-build/Makefile.am @@ -1,5 +1,10 @@ EXTRA_DIST = \ - android.sh \ - iphone.sh \ - msys.sh \ + android-arm.sh \ + android-armv7.sh \ + android-build.sh \ + android-mips.sh \ + android-x86.sh \ + ios.sh \ + mipsel-linux-static.sh \ + msys2-win32.sh \ osx.sh diff --git a/dist-build/android-arm.sh b/dist-build/android-arm.sh new file mode 100755 index 00000000..04be368c --- /dev/null +++ b/dist-build/android-arm.sh @@ -0,0 +1,3 @@ +#!/bin/sh +export CFLAGS="-Os -mthumb -marm -march=armv6" +TARGET_ARCH=arm HOST_COMPILER=arm-linux-androideabi "$(dirname "$0")/android-build.sh" diff --git a/dist-build/android-armv7.sh b/dist-build/android-armv7.sh new file mode 100755 index 00000000..c6280b86 --- /dev/null +++ b/dist-build/android-armv7.sh @@ -0,0 +1,3 @@ +#!/bin/sh +export CFLAGS="-Os -mfloat-abi=softfp -mfpu=vfpv3-d16 -mthumb -marm -march=armv7-a" +TARGET_ARCH=armv7 HOST_COMPILER=arm-linux-androideabi "$(dirname "$0")/android-build.sh" diff --git a/dist-build/android-build.sh b/dist-build/android-build.sh new file mode 100755 index 00000000..9b897e66 --- /dev/null +++ b/dist-build/android-build.sh @@ -0,0 +1,43 @@ +#! /bin/sh + +if [ -z "$ANDROID_NDK_HOME" ]; then + echo "You should probably set ANDROID_NDK_HOME to the directory containing" + echo "the Android NDK" + exit +fi + +if [ ! -f ./configure ]; then + echo "Can't find ./configure. Wrong directory or haven't run autogen.sh?" + exit 1 +fi + +if [ "x$TARGET_ARCH" = 'x' ] || [ "x$HOST_COMPILER" = 'x' ]; then + echo "You shouldn't use android-build.sh directly, use android-[arch].sh instead" + exit 1 +fi + +export MAKE_TOOLCHAIN="${ANDROID_NDK_HOME}/build/tools/make-standalone-toolchain.sh" + +export PREFIX="$(pwd)/dnscrypt-proxy-android-${TARGET_ARCH}" +export TOOLCHAIN_DIR="$(pwd)/android-toolchain-${TARGET_ARCH}" +export PATH="${PATH}:${TOOLCHAIN_DIR}/bin" + +export SODIUM_ANDROID_PREFIX=${SODIUM_ANDROID_PREFIX:-/tmp/libsodium-android-${TARGET_ARCH}} +export CPPFLAGS="$CPPFLAGS -I${SODIUM_ANDROID_PREFIX}/include" +export CPPFLAGS="$CPPFLAGS -DUSE_ONLY_PORTABLE_IMPLEMENTATIONS=1" +export LDFLAGS="$LDFLAGS -L${SODIUM_ANDROID_PREFIX}/lib" + +rm -rf "${TOOLCHAIN_DIR}" "${PREFIX}" + +$MAKE_TOOLCHAIN --platform="${NDK_PLATFORM:-android-14}" \ + --arch="$TARGET_ARCH" \ + --install-dir="$TOOLCHAIN_DIR" && \ +./configure --host="${HOST_COMPILER}" \ + --with-sysroot="${TOOLCHAIN_DIR}/sysroot" \ + --prefix="${PREFIX}" \ + --disable-soname-versions \ + --disable-shared \ + --disable-pie && \ +make clean && \ +make -j3 install && \ +echo "dnscrypt-proxy has been installed into $PREFIX" diff --git a/dist-build/android-mips.sh b/dist-build/android-mips.sh new file mode 100755 index 00000000..0fb04312 --- /dev/null +++ b/dist-build/android-mips.sh @@ -0,0 +1,3 @@ +#!/bin/sh +export CFLAGS="-Os" +TARGET_ARCH=mips HOST_COMPILER=mipsel-linux-android "$(dirname "$0")/android-build.sh" diff --git a/dist-build/android-x86.sh b/dist-build/android-x86.sh new file mode 100755 index 00000000..428511bd --- /dev/null +++ b/dist-build/android-x86.sh @@ -0,0 +1,3 @@ +#!/bin/sh +export CFLAGS="-Os" +TARGET_ARCH=x86 HOST_COMPILER=i686-linux-android "$(dirname "$0")/android-build.sh" diff --git a/dist-build/android.sh b/dist-build/android.sh deleted file mode 100755 index b2315ee4..00000000 --- a/dist-build/android.sh +++ /dev/null @@ -1,20 +0,0 @@ -#! /bin/sh - -export CFLAGS="-Os -mthumb" -export DROID_HOST=darwin-x86 -export LDFLAGS="-mthumb" -export NDK_PLATFORM=8 -export NDK_ROOT=/usr/local/Cellar/android-ndk/r8b -export TARGET_TOOLCHAIN_VERSION=4.4.3 -export TARGET=arm-linux-androideabi -export NDK_TARGET="arm-linux-androideabi-${TARGET_TOOLCHAIN_VERSION}" -export AR=droid-ar -export AS=droid-as -export CC=droid-gcc -export LD=droid-ld -export NM=droid-nm -export OBJCOPY=droid-objcopy -export RANLIB=droid-ranlib -export STRIP=droid-strip - -./configure --host=arm-linux-androideabi && make -j3 diff --git a/dist-build/ios.sh b/dist-build/ios.sh new file mode 100755 index 00000000..1ddc9a96 --- /dev/null +++ b/dist-build/ios.sh @@ -0,0 +1,22 @@ +#! /bin/sh + +export XCODEDIR=$(xcode-select -p) +export BASEDIR="${XCODEDIR}/Platforms/iPhoneOS.platform/Developer" +export PATH="${BASEDIR}/usr/bin:$BASEDIR/usr/sbin:$PATH" +export SDK="${BASEDIR}/SDKs/iPhoneOS.sdk" +export IPHONEOS_VERSION_MIN="5.1.1" +export CFLAGS="-Oz -mthumb -arch armv7 -isysroot ${SDK} -miphoneos-version-min=${IPHONEOS_VERSION_MIN}" +export LDFLAGS="-mthumb -arch armv7 -isysroot ${SDK} -miphoneos-version-min=${IPHONEOS_VERSION_MIN}" +export PREFIX="$(pwd)/dnscrypt-proxy-ios" + +export SODIUM_IOS_PREFIX="/tmp/libsodium-ios" +export CPPFLAGS="$CPPFLAGS -I${SODIUM_IOS_PREFIX}/include" +export CPPFLAGS="$CPPFLAGS -DUSE_ONLY_PORTABLE_IMPLEMENTATIONS=1" +export LDFLAGS="$LDFLAGS -L${SODIUM_IOS_PREFIX}/lib" + +./configure --host=arm-apple-darwin10 \ + --disable-shared \ + --prefix="$PREFIX" && \ +make -j3 install && \ +echo "dnscrypt-proxy has been installed into $PREFIX" && \ +echo 'Now, using codesign(1) to sign dnscrypt-proxy' diff --git a/dist-build/iphone.sh b/dist-build/iphone.sh deleted file mode 100755 index b0cc6959..00000000 --- a/dist-build/iphone.sh +++ /dev/null @@ -1,12 +0,0 @@ -#! /bin/sh - -export XCODEDIR="/Applications/Xcode.app/Contents/Developer" -export BASEDIR="${XCODEDIR}/Platforms/iPhoneOS.platform/Developer" -export PATH="${BASEDIR}/usr/bin:$BASEDIR/usr/sbin:$PATH" -export SDK="${BASEDIR}/SDKs/iPhoneOS6.0.sdk" -export CFLAGS="-Oz -mthumb -arch armv7 -isysroot ${SDK}" -export LDFLAGS="-mthumb -arch armv7 -isysroot ${SDK}" - -./configure --host=arm-apple-darwin10 && make -j3 - -echo 'Now, using codesign(1) to sign dnscrypt-proxy' diff --git a/dist-build/mipsel-linux-static.sh b/dist-build/mipsel-linux-static.sh new file mode 100755 index 00000000..b4a8b4e6 --- /dev/null +++ b/dist-build/mipsel-linux-static.sh @@ -0,0 +1,15 @@ +#! /bin/sh + +export AR='mipsel-linux-uclibc-ar' +export AS='mipsel-linux-uclibc-as' +export CC='mipsel-linux-uclibc-gcc' +export LD='mipsel-linux-uclibc-ld' +export NM='mipsel-linux-uclibc-nm' +export OBJCOPY='mipsel-linux-uclibc-objcopy' +export RANLIB='mipsel-linux-uclibc-ranlib' +export STRIP='mipsel-linux-uclibc-strip' +export LDFLAGS='-Wl,-static -static -static-libgcc -s -Wl,--gc-sections' +export CFLAGS='-Os -fomit-frame-pointer' + +./configure --host=mipsel-linux && \ + make -j3 diff --git a/dist-build/msys.sh b/dist-build/msys.sh deleted file mode 100755 index 26e078be..00000000 --- a/dist-build/msys.sh +++ /dev/null @@ -1,11 +0,0 @@ -#! /bin/sh - -export CFLAGS="-Os -march=pentium2 -mtune=nocona" - -./configure --disable-ssp --enable-plugins --with-included-ltdl && \ - make -j3 install-strip - -upx --best --ultra-brute /usr/local/sbin/dnscrypt-proxy.exe & -upx --best --ultra-brute /usr/local/bin/hostip.exe - -wait diff --git a/dist-build/msys2-win32.sh b/dist-build/msys2-win32.sh new file mode 100755 index 00000000..12905287 --- /dev/null +++ b/dist-build/msys2-win32.sh @@ -0,0 +1,33 @@ +#! /bin/sh + +export CFLAGS="-Os -m32 -march=pentium2 -mtune=nocona" +export PREFIX="$(pwd)/dnscrypt-proxy-win32" +export MINGW_PREFIX='/mingw32' +export SODIUM_PREFIX='/tmp/libsodium-win32' + +export CPPFLAGS="-I${SODIUM_PREFIX}/include" +export LDFLAGS="-L${SODIUM_PREFIX}/lib" + +./configure --prefix="$PREFIX" --exec-prefix="$PREFIX" \ + --host=i686-w64-mingw32 \ + --sbindir="${PREFIX}/bin" \ + --enable-plugins \ + --with-included-ltdl && \ +make install-strip + +rm -fr "${PREFIX}/share" +rm -fr "${PREFIX}/lib/pkgconfig" +mv "${PREFIX}/lib/dnscrypt-proxy" "${PREFIX}/plugins/" +rm -fr "${PREFIX}/lib" +cp "${MINGW_PREFIX}/bin/libwinpthread-1.dll" "${PREFIX}/bin/" +cp "${MINGW_PREFIX}/bin/libgcc_s_dw2-1.dll" "${PREFIX}/bin/" +cp "${MINGW_PREFIX}/bin/libldns-1.dll" "${PREFIX}/bin/" +cp "${SODIUM_PREFIX}/bin/libsodium-13.dll" "${PREFIX}/bin/" + +cp dnscrypt-resolvers.csv "${PREFIX}/bin/" + +if false; then + upx --best --ultra-brute "${PREFIX}/dnscrypt-proxy.exe" & + upx --best --ultra-brute "${PREFIX}/hostip.exe" + wait +fi diff --git a/dist-build/osx-32bit.sh b/dist-build/osx-32bit.sh deleted file mode 100755 index 67032244..00000000 --- a/dist-build/osx-32bit.sh +++ /dev/null @@ -1,12 +0,0 @@ -#! /bin/sh - -export CFLAGS="-mmacosx-version-min=10.6 -arch i386" -export LDFLAGS="-mmacosx-version-min=10.6 -arch i386" - -export CPPFLAGS="$CPPFLAGS -I/opt/ldns/include" -export LDFLAGS="$LDFLAGS -L/opt/ldns/lib" - -./configure --with-included-ltdl \ - --enable-plugins \ - --enable-plugins-root && \ -make -j3 diff --git a/dist-build/osx.sh b/dist-build/osx.sh index ef3d092c..b238e2c7 100755 --- a/dist-build/osx.sh +++ b/dist-build/osx.sh @@ -1,7 +1,7 @@ #! /bin/sh -export CFLAGS="-mmacosx-version-min=10.6" -export LDFLAGS="-mmacosx-version-min=10.6" +export CFLAGS="-mmacosx-version-min=10.8 -march=core2 -O2 -g" +export LDFLAGS="-mmacosx-version-min=10.8 -march=core2 -O2 -g" ./configure --with-included-ltdl \ --enable-plugins \ diff --git a/dnscrypt-proxy.service b/dnscrypt-proxy.service new file mode 100644 index 00000000..78434352 --- /dev/null +++ b/dnscrypt-proxy.service @@ -0,0 +1,13 @@ +[Unit] +Description=DNSCrypt client proxy +Requires=dnscrypt-proxy.socket + +[Install] +Also=dnscrypt-proxy.socket +WantedBy=multi-user.target + +[Service] +Type=simple +NonBlocking=true +ExecStart=/usr/local/sbin/dnscrypt-proxy \ + -R dnscrypt.eu-nl diff --git a/dnscrypt-proxy.socket b/dnscrypt-proxy.socket new file mode 100644 index 00000000..22e62b97 --- /dev/null +++ b/dnscrypt-proxy.socket @@ -0,0 +1,10 @@ +[Unit] +Description=dnscrypt-proxy listening socket +After=network.target + +[Socket] +ListenStream=127.0.0.1:53 +ListenDatagram=127.0.0.1:53 + +[Install] +WantedBy=sockets.target diff --git a/dnscrypt-resolvers.csv b/dnscrypt-resolvers.csv new file mode 100644 index 00000000..87d3fb3c --- /dev/null +++ b/dnscrypt-resolvers.csv @@ -0,0 +1,38 @@ +Name,Full name,Description,Location,Coordinates,URL,Version,DNSSEC validation,No logs,Namecoin,Resolver address,Provider name,Provider public key,Provider public key TXT record +adamas,Adamas.ai DNSCrypt,DNSCrypt Server in LUX provided by adamas.ai,Luxembourg,,http.//adamas.ai,1,no,yes,no,80.90.43.162:5678,2.dnscrypt-cert.adamas.ai,6484:544A:4B91:F23A:E8AD:2AA3:6661:C419:D09B:C88D:B1AF:C314:E59D:2C36:0F81:FB99, +cloudns-can,CloudNS Canberra,CloudNS is an Australian based security focused DNS provider.,"Canberra, AU",,https://cloudns.com.au,1,yes,yes,yes,113.20.6.2:443,2.dnscrypt-cert.cloudns.com.au,1971:7C1A:C550:6C09:F09B:ACB1:1AF7:C349:6425:2676:247F:B738:1C5A:243A:C1CC:89F4, +cloudns-syd,CloudNS Sydney,CloudNS is an Australian based security focused DNS provider.,"Sydney, AU",,https://cloudns.com.au,1,yes,yes,yes,113.20.8.17:443,2.dnscrypt-cert-2.cloudns.com.au,67A4:323E:581F:79B9:BC54:825F:54FE:1025:8B4F:37EB:0D07:0BCE:4010:6195:D94F:E330, +cypherpunk,cypherpunk.lu DNSCrypt,DNSCrypt Server in IT provided by cypherpunk.lu,Italy,,http://cypherpunk.lu,1,no,yes,no,95.141.34.162:5678,2.dnscrypt-cert-2.cypherpunk.lu,5FF6:5A49:9C19:6B39:7DAF:4758:4070:7092:5ABA:B334:5E6C:B46A:FA4B:7771:5ADA:2EC8, +d0wn-ch-ns1,d0wn server in Switzerland,Server provided by Martin 'd0wn' Albus,Singapore,,https://dns.d0wn.biz,1,no,yes,yes,179.43.143.69:54,2.dnscrypt-cert.d0wn.biz,F64D:AECA:A8AA:E31D:3896:8A93:1D96:EB54:9D70:CE57:A439:58B0:7685:6960:044B:EA62, +d0wn-de-ns1,d0wn server in Germany,Server provided by Martin 'd0wn' Albus,Germany,,https://dns.d0wn.biz,1,no,yes,yes,108.61.210.58:54,2.dnscrypt-cert.d0wn.biz,F64D:AECA:A8AA:E31D:3896:8A93:1D96:EB54:9D70:CE57:A439:58B0:7685:6960:044B:EA62, +d0wn-fr-ns1,First d0wn server in France,Server provided by Martin 'd0wn' Albus,France,,https://dns.d0wn.biz,1,no,yes,yes,178.32.122.65:54,2.dnscrypt-cert.d0wn.biz,F64D:AECA:A8AA:E31D:3896:8A93:1D96:EB54:9D70:CE57:A439:58B0:7685:6960:044B:EA62, +d0wn-fr-ns2,Second d0wn server in France,Server provided by Martin 'd0wn' Albus,France,,https://dns.d0wn.biz,1,no,yes,yes,37.187.0.40:27015,2.dnscrypt-cert.d0wn.biz,F64D:AECA:A8AA:E31D:3896:8A93:1D96:EB54:9D70:CE57:A439:58B0:7685:6960:044B:EA62, +d0wn-md-ns1,First d0wn server in Moldova,Server provided by Martin 'd0wn' Albus,Moldova,,https://dns.d0wn.biz,1,no,yes,yes,178.17.170.67:54,2.dnscrypt-cert.d0wn.biz,F64D:AECA:A8AA:E31D:3896:8A93:1D96:EB54:9D70:CE57:A439:58B0:7685:6960:044B:EA62, +d0wn-nl-ns1,First d0wn server in Netherlands,Server provided by Martin 'd0wn' Albus,Netherlands,,https://dns.d0wn.biz,1,no,yes,yes,95.85.9.86:54,2.dnscrypt-cert.d0wn.biz,F64D:AECA:A8AA:E31D:3896:8A93:1D96:EB54:9D70:CE57:A439:58B0:7685:6960:044B:EA62, +d0wn-nl-ns2,Second d0wn server in Netherlands,Server provided by Martin 'd0wn' Albus,Netherlands,,https://dns.d0wn.biz,1,no,yes,yes,31.220.27.46:54,2.dnscrypt-cert.d0wn.biz,F64D:AECA:A8AA:E31D:3896:8A93:1D96:EB54:9D70:CE57:A439:58B0:7685:6960:044B:EA62, +d0wn-ro-ns1,First d0wn server in Romania,Server provided by Martin 'd0wn' Albus,Romania,,https://dns.d0wn.biz,1,no,yes,yes,37.221.170.105:54,2.dnscrypt-cert.d0wn.biz,F64D:AECA:A8AA:E31D:3896:8A93:1D96:EB54:9D70:CE57:A439:58B0:7685:6960:044B:EA62, +d0wn-ro-ns2,Second d0wn server in Romania,Server provided by Martin 'd0wn' Albus,Romania,,https://dns.d0wn.biz,1,no,yes,yes,37.221.170.104:54,2.dnscrypt-cert.d0wn.biz,F64D:AECA:A8AA:E31D:3896:8A93:1D96:EB54:9D70:CE57:A439:58B0:7685:6960:044B:EA62, +d0wn-sa-ns1,d0wn server in Saudi Arabia,Server provided by Martin 'd0wn' Albus,Saudi Arabia,,https://dns.d0wn.biz,1,no,yes,yes,46.151.208.154:54,2.dnscrypt-cert.d0wn.biz,F64D:AECA:A8AA:E31D:3896:8A93:1D96:EB54:9D70:CE57:A439:58B0:7685:6960:044B:EA62, +d0wn-sg-ns1,d0wn server in Singapore,Server provided by Martin 'd0wn' Albus,Singapore,,https://dns.d0wn.biz,1,no,yes,yes,128.199.248.105:54,2.dnscrypt-cert.d0wn.biz,F64D:AECA:A8AA:E31D:3896:8A93:1D96:EB54:9D70:CE57:A439:58B0:7685:6960:044B:EA62, +dnscrypt.eu-dk,DNSCrypt.eu Denmark,"Free, non-logged, uncensored. Hosted by Netgroup.",Denmark,,https://dnscrypt.eu,1,yes,yes,no,77.66.84.233:443,2.dnscrypt-cert.resolver2.dnscrypt.eu,3748:5585:E3B9:D088:FD25:AD36:B037:01F5:520C:D648:9E9A:DD52:1457:4955:9F0A:9955,pubkey.resolver2.dnscrypt.eu +dnscrypt.eu-dk-ipv6,DNSCrypt.eu Denmark over IPv6,"Free, non-logged, uncensored. Hosted by Netgroup.",Denmark,,https://dnscrypt.eu,1,yes,yes,no,[2001:1448:243::dc2]:443,2.dnscrypt-cert.resolver2.dnscrypt.eu,3748:5585:E3B9:D088:FD25:AD36:B037:01F5:520C:D648:9E9A:DD52:1457:4955:9F0A:9955,pubkey.resolver2.dnscrypt.eu +dnscrypt.eu-dk-port5353,DNSCrypt.eu Denmark (port 5353),"Free, non-logged, uncensored. Hosted by Netgroup.",Denmark,,https://dnscrypt.eu,1,yes,yes,no,77.66.84.233:5353,2.dnscrypt-cert.resolver2.dnscrypt.eu,3748:5585:E3B9:D088:FD25:AD36:B037:01F5:520C:D648:9E9A:DD52:1457:4955:9F0A:9955,pubkey.resolver2.dnscrypt.eu +dnscrypt.eu-nl,DNSCrypt.eu Holland,"Free, non-logged, uncensored. Hosted by RamNode.",Netherlands,,https://dnscrypt.eu,1,yes,yes,no,176.56.237.171:443,2.dnscrypt-cert.resolver1.dnscrypt.eu,67C0:0F2C:21C5:5481:45DD:7CB4:6A27:1AF2:EB96:9931:40A3:09B6:2B8D:1653:1185:9C66,pubkey.resolver1.dnscrypt.eu +dnscrypt.eu-nl-ipv6,DNSCrypt.eu Holland over IPv6,"Free, non-logged, uncensored. Hosted by RamNode.",Netherlands,,https://dnscrypt.eu,1,yes,yes,no,[2a00:d880:3:1::a6c1:2e89]:443,2.dnscrypt-cert.resolver1.dnscrypt.eu,67C0:0F2C:21C5:5481:45DD:7CB4:6A27:1AF2:EB96:9931:40A3:09B6:2B8D:1653:1185:9C66,pubkey.resolver1.dnscrypt.eu +dnscrypt.eu-nl-port5353,DNSCrypt.eu Holland (port 5353),"Free, non-logged, uncensored. Hosted by RamNode.",Netherlands,,https://dnscrypt.eu,1,yes,yes,no,176.56.237.171:5353,2.dnscrypt-cert.resolver1.dnscrypt.eu,67C0:0F2C:21C5:5481:45DD:7CB4:6A27:1AF2:EB96:9931:40A3:09B6:2B8D:1653:1185:9C66,pubkey.resolver1.dnscrypt.eu +dnscrypt.org-fr,"DNSCrypt server in Paris, France","ARM server hosted by online.net","Paris, France",,,1,yes,yes,no,212.47.228.136,2.dnscrypt-cert.fr.dnscrypt.org,E801:B84E:A606:BFB0:BAC0:CE43:445B:B15E:BA64:B02F:A3C4:AA31:AE10:636A:0790:324D,pubkey.fr.dnscrypt.org +okturtles,okTurtles,For a surveillance-free world. HTTPS is broken. DNSChain fixes it.,"Georgia, US","33.032501, -83.895699",http://okturtles.com/,1,no,yes,yes,23.226.227.93:443,2.dnscrypt-cert.okturtles.com,1D85:3953:E34F:AFD0:05F9:4C6F:D1CC:E635:D411:9904:0D48:D19A:5D35:0B6A:7C81:73CB, +opendns,OpenDNS,Predict and prevent attacks before they happen,Anycast,,https://www.opendns.com,1,no,no,no,208.67.220.220:443,2.dnscrypt-cert.opendns.com,B735:1140:206F:225D:3E2B:D822:D7FD:691E:A1C3:3CC8:D666:8D0C:BE04:BFAB:CA43:FB79, +opendns-familyshield,OpenDNS with FamilyShield,Blocks web sites not suitable for children,Anycast,,https://www.opendns.com/home-internet-security/parental-controls/,1,no,no,no,208.67.220.123:443,2.dnscrypt-cert.opendns.com,B735:1140:206F:225D:3E2B:D822:D7FD:691E:A1C3:3CC8:D666:8D0C:BE04:BFAB:CA43:FB79, +opendns-ipv6,OpenDNS over IPv6,OpenDNS IPv6 sandbox,Anycast,,https://www.opendns.com/about/innovations/ipv6/,1,no,no,no,[2620:0:ccc::2]:443,2.dnscrypt-cert.opendns.com,B735:1140:206F:225D:3E2B:D822:D7FD:691E:A1C3:3CC8:D666:8D0C:BE04:BFAB:CA43:FB79, +opendns-port53,OpenDNS backward compatibility port 53,Predict and prevent attacks before they happen,Anycast,,https://www.opendns.com,1,no,no,no,208.67.220.220:53,2.dnscrypt-cert.opendns.com,B735:1140:206F:225D:3E2B:D822:D7FD:691E:A1C3:3CC8:D666:8D0C:BE04:BFAB:CA43:FB79, +opennic-ca-ns3,OpenNIC server ns3.ca,OpenNIC server in Canada provided by NovaKing,Canada,,http://www.opennicproject.org,1,no,yes,no,142.4.204.111:443,2.dnscrypt-cert.ns3.ca.dns.opennic.glue,1C19:7933:1BE8:23CC:CF08:9A79:0693:7E5C:3410:2A56:AC7F:6270:E046:25B2:EDDB:04E3, +opennic-ca-ns3-ipv6,OpenNIC server ns3.ca over IPv6,OpenNIC server in Canada provided by NovaKing,Canada,,http://www.opennicproject.org,1,no,yes,no,[2607:5300:60:47aa:142:4:204:111]:443,2.dnscrypt-cert.ns3.ca.dns.opennic.glue,1C19:7933:1BE8:23CC:CF08:9A79:0693:7E5C:3410:2A56:AC7F:6270:E046:25B2:EDDB:04E3, +opennic-ca-ns4,OpenNIC server ns4.ca,OpenNIC server in Canada provided by NovaKing,Canada,,http://www.opennicproject.org,1,no,yes,no,142.4.205.47:443,2.dnscrypt-cert.ns4.ca.dns.opennic.glue,12FA:EC04:3489:B374:B973:CA7C:827F:D7FA:033F:D280:8641:F2F1:430A:E5DC:6068:42B8, +opennic-ca-ns4-ipv6,OpenNIC server ns4.ca over IPv6,OpenNIC server in Canada provided by NovaKing,Canada,,http://www.opennicproject.org,1,no,yes,no,[2607:5300:60:47aa:142:4:205:47]:443,2.dnscrypt-cert.ns4.ca.dns.opennic.glue,12FA:EC04:3489:B374:B973:CA7C:827F:D7FA:033F:D280:8641:F2F1:430A:E5DC:6068:42B8, +opennic-proxy.sh-dns1,Proxy.sh Public OpenNIC One,OpenNIC server in Netherlands provided by Proxy.sh,Netherlands,,https://proxy.sh,1,no,yes,no,146.185.134.104:54,2.nscrypt-cert.proxy.sh,937B:991C:E853:EDD6:FEC5:8F88:DF78:B27E:2FAA:452B:5BBB:C05F:D0B9:DC24:DC7C:D5F3, +opennic-us-ca-ns17,OpenNIC server ns17.ca.us,OpenNIC server in California provided by Philip Southam,"Fremont, CA, US",,http://www.opennicproject.org,1,no,yes,no,173.230.156.28:443,2.dnscrypt-cert.ns17.ca.us.dns.opennic.glue,2342:215C:409A:85A5:FB63:2A3B:42CD:5089:6BA8:551A:8BDC:2654:CF57:804F:B1B2:5019, +opennic-us-ca-ns18-ipv6,OpenNIC server ns18.ca.us over IPv6,OpenNIC server in California provided by Philip Southam,"Fremont, CA, US",,http://www.opennicproject.org,1,no,yes,no,[2600:3c01::f03c:91ff:fe6e:1f6b]:443,2.dnscrypt-cert.ns18.ca.us.dns.opennic.glue,689B:DAF2:6A9F:DB2D:42B4:AA15:1825:89E8:6FAE:0C2C:522A:D0AA:DD2B:80B4:8D61:0A43, +opennic-us-wa-ns1,OpenNIC server ns1.wa.us,OpenNIC server in Seattle WA,"Seattle, WA, US",,http://www.opennicproject.org,1,no,yes,no,23.226.230.72:1053,2.dnscrypt-cert.hallowe.lt,32E5:B8D6:7495:DAC0:D286:8020:830D:8432:F552:3ACF:1818:7F46:3D25:2308:25A2:6A93, +opennic-us-wa-ns1-ipv6,OpenNIC server ns1.wa.us over IPv6,OpenNIC server in Seattle WA,"Seattle, WA, US",,http://www.opennicproject.org,1,no,yes,no,[2604:180:1::8d12:1dc]:1053,2.dnscrypt-cert.hallowe.lt,32E5:B8D6:7495:DAC0:D286:8020:830D:8432:F552:3ACF:1818:7F46:3D25:2308:25A2:6A93, +soltysiak,Soltysiak,Public DNSCrypt server in Poland,Poland,"52.4014619, 16.9278078",http://dc1.soltysiak.com/,1,yes,yes,yes,178.216.201.222:2053,2.dnscrypt-cert.soltysiak.com,25C4:E188:2915:4697:8F9C:2BBD:B6A7:AFA4:01ED:A051:0508:5D53:03E7:1928:C066:8F21,pubkey.dc1.soltysiak.com diff --git a/dnscrypt-resolvers.csv.sig b/dnscrypt-resolvers.csv.sig new file mode 100644 index 00000000..35dc7149 Binary files /dev/null and b/dnscrypt-resolvers.csv.sig differ diff --git a/man/dnscrypt-proxy.8 b/man/dnscrypt-proxy.8 deleted file mode 100644 index e8ec1b5e..00000000 --- a/man/dnscrypt-proxy.8 +++ /dev/null @@ -1,93 +0,0 @@ -.\" generated with Ronn/v0.7.3 -.\" http://github.com/rtomayko/ronn/tree/0.7.3 -. -.TH "DNSCRYPT\-PROXY" "8" "January 2013" "" "" -. -.SH "NAME" -\fBdnscrypt\-proxy\fR \- A DNSCrypt forwarder -. -.SH "SYNOPSIS" -\fBdnscrypt\-proxy\fR [\fIoptions\fR] -. -.SH "DESCRIPTION" -\fBdnscrypt\-proxy\fR accepts DNS requests, authenticates and encrypts them using dnscrypt and forwards them to a remote dnscrypt\-enabled resolver\. -. -.P -Replies from the resolver are expected to be authenticated and encrypted or else they will be discarded\. -. -.P -The proxy verifies the replies, decrypts them, and transparently forwards them to the local stub resolver\. -. -.P -\fBdnscrypt\-proxy\fR listens to \fB127\.0\.0\.1\fR / port \fB53\fR by default\. -. -.SH "WARNING" -\fBdnscrypt\-proxy\fR is not a DNS cache\. Unless your operating system already provides a decent built\-in cache (and by default, most systems don\'t), clients shouldn\'t directly send requests to \fBdnscrypt\-proxy\fR\. -. -.P -Intead, run a DNS cache like \fBUnbound\fR, and configure it to use \fBdnscrypt\-proxy\fR as a forwarder\. Both can safely run on the same machine as long as they use different IP addresses and/or different ports\. -. -.SH "OPTIONS" -. -.IP "\(bu" 4 -\fB\-a\fR, \fB\-\-local\-address=[:port]\fR: what local IP the daemon will listen to, with an optional port\. The default port is 53\. -. -.IP "\(bu" 4 -\fB\-d\fR, \fB\-\-daemonize\fR: detach from the current terminal and run the server in background\. -. -.IP "\(bu" 4 -\fB\-e\fR, \fB\-\-edns\-payload\-size=\fR: transparently add an OPT pseudo\-RR to outgoing queries in order to enable the EDNS0 extension mechanism\. The payload size is the size of the largest response we accept from the resolver before retrying over TCP\. This feature is enabled by default, with a payload size of 1252 bytes\. Any value below 512 disables it\. -. -.IP "\(bu" 4 -\fB\-h\fR, \fB\-\-help\fR: show usage\. -. -.IP "\(bu" 4 -\fB\-k\fR, \fB\-\-provider\-key=\fR: specify the provider public key (see below)\. -. -.IP "\(bu" 4 -\fB\-l\fR, \fB\-\-logfile=\fR: log events to this file instead of the standard output\. -. -.IP "\(bu" 4 -\fB\-n\fR, \fB\-\-max\-active\-requests=\fR: set the maximum number of simultaneous active requests\. The default value is 250\. -. -.IP "\(bu" 4 -\fB\-p\fR, \fB\-\-pidfile=\fR: write the PID number to a file\. -. -.IP "\(bu" 4 -\fB\-r\fR, \fB\-\-resolver\-address=[:port]\fR: a DNSCrypt\-capable resolver IP address with an optional port\. The default port is 443\. -. -.IP "\(bu" 4 -\fB\-u\fR, \fB\-\-user=\fR: chroot(2) to this user\'s home directory and drop privileges\. -. -.IP "\(bu" 4 -\fB\-N\fR, \fB\-\-provider\-name=\fR: the fully\-qualified name of the dnscrypt certificate provider\. -. -.IP "\(bu" 4 -\fB\-T\fR, \fB\-\-tcp\-only\fR: always use TCP\. A connection made using UDP will get a truncated response, so that the (stub) resolver retries using TCP\. -. -.IP "\(bu" 4 -\fB\-V\fR, \fB\-\-version\fR: show version number\. -. -.IP "" 0 -. -.P -A public key is 256\-bit long, and it has to be specified as a hexadecimal string, with optional columns\. -. -.SH "SIMPLE USAGE EXAMPLE" -. -.nf - -$ dnscrypt\-proxy \-\-daemonize -. -.fi -. -.SH "ADVANCED USAGE EXAMPLE" -. -.nf - -$ dnscrypt\-proxy \-\-provider\-key=B735:1140:206F:225D:3E2B:D822:D7FD:691E:A1C3:3CC8:D666:8D0C:BE04:BFAB:CA43:FB79 \-\-provider\-name=2\.dnscrypt\-cert\.dnscrypt\.org\. \-\-resolver\-address=208\.67\.220\.220:53 \-\-daemonize -. -.fi -. -.SH "SEE ALSO" -hostip(8) diff --git a/man/dnscrypt-proxy.8.markdown b/man/dnscrypt-proxy.8.markdown index 68b1d7ea..c12d2b7c 100644 --- a/man/dnscrypt-proxy.8.markdown +++ b/man/dnscrypt-proxy.8.markdown @@ -11,8 +11,8 @@ dnscrypt-proxy(8) -- A DNSCrypt forwarder them using dnscrypt and forwards them to a remote dnscrypt-enabled resolver. -Replies from the resolver are expected to be authenticated and -encrypted or else they will be discarded. +Replies from the resolver are expected to be authenticated or else +they will be discarded. The proxy verifies the replies, decrypts them, and transparently forwards them to the local stub resolver. @@ -49,17 +49,35 @@ ports. * `-k`, `--provider-key=`: specify the provider public key (see below). + * `-L`, `--resolvers-list=`: path to the CSV file containing + the list of available resolvers, and the parameters to use them. + * `-l`, `--logfile=`: log events to this file instead of the standard output. + * `-m`, `--loglevel=`: don't log events with priority above + this level after the service has been started up. Default is the value + for `LOG_INFO`. + * `-n`, `--max-active-requests=`: set the maximum number of simultaneous active requests. The default value is 250. * `-p`, `--pidfile=`: write the PID number to a file. + * `-R`, `--resolver-name=`: name of the resolver to use, from + the list of available resolvers (see `-L`). + * `-r`, `--resolver-address=[:port]`: a DNSCrypt-capable resolver IP address with an optional port. The default port is 443. + * `-t`, `--test=`: don't actually start the proxy, but check that + a valid certificate can be retrieved from the server and that it + will remain valid for the next minutes. The exit code is 0 + if a valid certificate can be used, 2 if no valid certificates can be used, + 3 if a timeout occurred, and 4 if a currently valid certificate is + going to expire before . The margin is always specificied in + minutes. + * `-u`, `--user=`: chroot(2) to this user's home directory and drop privileges. @@ -75,13 +93,19 @@ ports. A public key is 256-bit long, and it has to be specified as a hexadecimal string, with optional columns. -## SIMPLE USAGE EXAMPLE +## COMMON USAGE EXAMPLE + + $ dnscrypt-proxy --daemonize --resolver-name=... + +The resolver name is the first column (Name) in the CSV file. + +## USAGE EXAMPLE WITH A PRIVATE SERVER - $ dnscrypt-proxy --daemonize + $ dnscrypt-proxy --daemonize --provider-key=... --provider-name=... --resolver-address=... -## ADVANCED USAGE EXAMPLE +## BUGS AND SUPPORT - $ dnscrypt-proxy --provider-key=B735:1140:206F:225D:3E2B:D822:D7FD:691E:A1C3:3CC8:D666:8D0C:BE04:BFAB:CA43:FB79 --provider-name=2.dnscrypt-cert.dnscrypt.org. --resolver-address=208.67.220.220:53 --daemonize +Please report issues with DNSCrypt itself to http://dnscrypt.org/issues ## SEE ALSO diff --git a/man/hostip.8 b/man/hostip.8 deleted file mode 100644 index 16a4ae3b..00000000 --- a/man/hostip.8 +++ /dev/null @@ -1,54 +0,0 @@ -.\" generated with Ronn/v0.7.3 -.\" http://github.com/rtomayko/ronn/tree/0.7.3 -. -.TH "HOSTIP" "8" "January 2013" "" "" -. -.SH "NAME" -\fBhostip\fR \- Resolve a host name to an IP address -. -.SH "SYNOPSIS" -\fBhostip\fR [\fIoptions\fR] host_name -. -.SH "DESCRIPTION" -\fBhostip\fR sends a DNS query to a resolver, and prints the IP addresses for the given host name\. -. -.P -It can be useful in order to retrieve IP addresses before dnscrypt\-proxy(8) is started\. -. -.SH "OPTIONS" -. -.IP "\(bu" 4 -\fB\-6\fR, \fB\-\-ipv6\fR: ask for AAAA records\. -. -.IP "\(bu" 4 -\fB\-h\fR, \fB\-\-help\fR: show usage\. -. -.IP "\(bu" 4 -\fB\-r\fR, \fB\-\-resolver\-address=[:port]\fR: the resolver IP address (default: 208\.67\.220\.220, OpenDNS)\. -. -.IP "\(bu" 4 -\fB\-V\fR, \fB\-\-version\fR: show version number\. -. -.IP "" 0 -. -.SH "SIMPLE USAGE EXAMPLE" -. -.nf - -$ hostip www\.example\.com -. -.fi -. -.SH "ADVANCED USAGE EXAMPLE" -. -.nf - -$ hostip \-6 \-r 213\.154\.224\.3 www\.google\.com -. -.fi -. -.SH "EXIT STATUS" -The \fBhostip\fR utility exits 0 on success, and > 0 if an error occurs\. -. -.SH "SEE ALSO" -dnscrypt\-proxy(8) diff --git a/man/hostip.8.markdown b/man/hostip.8.markdown index b90587ee..bd5981cd 100644 --- a/man/hostip.8.markdown +++ b/man/hostip.8.markdown @@ -20,7 +20,7 @@ dnscrypt-proxy(8) is started. * `-h`, `--help`: show usage. * `-r`, `--resolver-address=[:port]`: the resolver IP address -(default: 208.67.220.220, OpenDNS). +(default: 8.8.8.8, Google DNS). * `-V`, `--version`: show version number. @@ -30,7 +30,7 @@ dnscrypt-proxy(8) is started. ## ADVANCED USAGE EXAMPLE - $ hostip -6 -r 213.154.224.3 www.google.com + $ hostip -6 -r 4.2.2.2 www.google.com ## EXIT STATUS diff --git a/org.dnscrypt.osx.DNSCryptProxy.plist b/org.dnscrypt.osx.DNSCryptProxy.plist index 2f9c25d7..944ec474 100644 --- a/org.dnscrypt.osx.DNSCryptProxy.plist +++ b/org.dnscrypt.osx.DNSCryptProxy.plist @@ -10,8 +10,16 @@ ProgramArguments - /usr/local/sbin/dnscrypt-proxy --user=nobody + + + /usr/local/sbin/dnscrypt-proxy + + + --resolvers-list=/usr/local/share/dnscrypt-proxy/dnscrypt-resolvers.csv + + + --resolver-name=***CHANGETHIS*** StandardErrorPath /dev/null diff --git a/packages/debian/changelog b/packages/debian/changelog new file mode 100644 index 00000000..52e01c76 --- /dev/null +++ b/packages/debian/changelog @@ -0,0 +1,63 @@ +dnscrypt-proxy (1.3.3-1) unstable; urgency=low + + * New upstream release + * Added .defaults file with configuration, updated Upstart job accordingly + * Now builds with --disable-ltdl-install --without-included-ltdl parameters + * Specified the documentation to include explicitly in docs file + + -- Sergey "Shnatsel" Davidoff Sun, 03 Nov 2013 18:20:39 +0400 + +dnscrypt-proxy (1.3.1-0~shnatsel6~precise2) precise; urgency=low + + * Fixed some essential libraries not being allowed by apparmor + + -- Sergey "Shnatsel" Davidoff Wed, 17 Jul 2013 18:38:04 +0400 + +dnscrypt-proxy (1.3.1-0~shnatsel5~precise2) precise; urgency=low + + * Fixed path in AppArmor profile that prevented it from activation + + -- Sergey "Shnatsel" Davidoff Mon, 15 Jul 2013 13:36:24 +0400 + +dnscrypt-proxy (1.3.1-0~shnatsel4~precise2) precise; urgency=low + + * Removed block_suspend capability from AppArmor profile to make it work on Precise + + -- Sergey "Shnatsel" Davidoff Sun, 07 Jul 2013 11:31:59 +0400 + +dnscrypt-proxy (1.3.1-0~shnatsel4~precise1) precise; urgency=low + + * New upstream release + + -- Sergey "Shnatsel" Davidoff Sun, 07 Jul 2013 11:31:59 +0400 + +dnscrypt-proxy (1.3.0-0~shnatsel4~precise1) precise; urgency=low + + * Updated AppArmor profile + + -- Sergey "Shnatsel" Davidoff Sun, 07 Jul 2013 10:23:14 +0400 + +dnscrypt-proxy (1.3.0-0~shnatsel3~precise1) precise; urgency=low + + * Added AppArmor profile for even greater security + + -- Sergey "Shnatsel" Davidoff Sat, 06 Jul 2013 21:01:30 +0400 + +dnscrypt-proxy (1.3.0-0~shnatsel2~precise1) precise; urgency=low + + * Fixed a bug with postrm failing for no real reason + + -- Sergey "Shnatsel" Davidoff Fri, 05 Jul 2013 20:03:09 +0400 + +dnscrypt-proxy (1.3.0-0~shnatsel1~precise1) precise; urgency=low + + * Added an upstart job to autostart dnscrypt-proxy + * dnscrypt-proxy now runs as unprivileged user + + -- Sergey "Shnatsel" Davidoff Thu, 13 Jun 2013 01:34:05 +0400 + +dnscrypt-proxy (1.3.0-1) raring; urgency=low + + * Initial release (Closes: #692320) + + -- MrTux Wed, 22 May 2013 02:54:27 +0700 diff --git a/packages/debian/compat b/packages/debian/compat new file mode 100644 index 00000000..ec635144 --- /dev/null +++ b/packages/debian/compat @@ -0,0 +1 @@ +9 diff --git a/packages/debian/control b/packages/debian/control new file mode 100644 index 00000000..2d341477 --- /dev/null +++ b/packages/debian/control @@ -0,0 +1,26 @@ +Source: dnscrypt-proxy +Section: net +Priority: optional +Maintainer: Sergey "Shnatsel" Davidoff +Build-Depends: debhelper (>= 9), autotools-dev, libsodium-dev +Standards-Version: 3.9.5 +Homepage: http://dnscrypt.org +Vcs-Git: git://github.com/jedisct1/dnscrypt-proxy.git +Vcs-Browser: https://github.com/jedisct1/dnscrypt-proxy + +Package: dnscrypt-proxy +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends}, adduser +Suggests: resolvconf +Description: Tool for securing communications between a client and a DNS resolver + dnscrypt-proxy provides local service which can be used directly as your local + resolver or as a DNS forwarder, encrypting and authenticating requests using + the DNSCrypt protocol and passing them to an upstream server. + . + The DNSCrypt protocol uses high-speed high-security elliptic-curve + cryptography and is very similar to DNSCurve, but focuses on securing + communications between a client and its first-level resolver. + . + While not providing end-to-end security, it protects the local network, which + is often the weakest point of the chain, against man-in-the-middle attacks. It + also provides some confidentiality to DNS queries. diff --git a/packages/debian/copyright b/packages/debian/copyright new file mode 100644 index 00000000..970d8601 --- /dev/null +++ b/packages/debian/copyright @@ -0,0 +1,57 @@ +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: dnscrypt-proxy +Source: https://github.com/jedisct1/dnscrypt-proxy/ + +Files: * +Copyright: 2011-2014 Frank Denis +License: ISC + Permission to use, copy, modify, and distribute this software for any + purpose with or without fee is hereby granted, provided that the above + copyright notice and this permission notice appear in all copies. + . + 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. + +Files: debian/* +Copyright: 2013 MrTux + 2013 Xu Zhen + 2013-2014 Sergey "Shnatsel" Davidoff +License: GPL-2+ + This package is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + . + This package is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + You should have received a copy of the GNU General Public License + along with this program. If not, see + . + On Debian systems, the complete text of the GNU General + Public License version 2 can be found in "/usr/share/common-licenses/GPL-2". + +Files: debian/preinst, debian/postrm +Copyright: 2013 Sergey "Shnatsel" Davidoff + This package is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + . + This package is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + You should have received a copy of the GNU General Public License + along with this program. If not, see + . + On Debian systems, the complete text of the GNU General + Public License version 2 can be found in "/usr/share/common-licenses/GPL-2". diff --git a/packages/debian/dnscrypt-proxy.default b/packages/debian/dnscrypt-proxy.default new file mode 100644 index 00000000..e56c8b78 --- /dev/null +++ b/packages/debian/dnscrypt-proxy.default @@ -0,0 +1,38 @@ +# Defaults for dnscrypt-proxy upstart script +# See man 8 dnscrypt-proxy for more info on each parameter + +# What local IP the daemon will listen to, with an optional port. The default port is 53. +local-address=127.0.0.2:53 + +# instructs resolvconf (if installed) to update the machine dns servers +resolvconf=no + +# Write PID to a file. +pidfile=/run/dnscrypt-proxy.pid + +# runs dnscrypt-proxy as a dedicated user with restrict privileges +# This is a security feature and should never be disabled. +user=dnscrypt + +# Remote DNSCrypt resolvers name +# You can find a list of resolvers names at +# https://github.com/jedisct1/dnscrypt-proxy/blob/master/dnscrypt-resolvers.csv +# Specifying multiple resolvers is not yet supported! +resolver-name=opendns + +# Custom DNSCrypt settings, if you are running you own DNSCrypt server (dnscrypt-wrapper) +#resolver-address=10.1.1.53:443 +#provider-name=2.dnscrypt-cert.example.com +#provider-key=CE57:A439:58B0:7685:6960:044B:EA64:A64D:AECA:A8AA:EB54:9D70:E31D:3896:8A93:1D96 + +# Transparently add an OPT pseudo-RR to outgoing queries in order to enable the EDNS0 extension mechanism. +# This feature is enabled by default, with a payload size of 1252 bytes. Any value below 512 disables it. +#edns-payload-size=1252 + +# The maximum number of simultaneous active requests. The default value is 250. +#max-active-requests=250 + +# Use TCP instead of UDP. This is slower than UDP, and this workaround should never be used +# except when bypassing a filter is actually required. +# Moreover, multiple queries over a single TCP connections aren't supported yet. +#tcp-only diff --git a/packages/debian/dnscrypt-proxy.init b/packages/debian/dnscrypt-proxy.init new file mode 100644 index 00000000..d453ada7 --- /dev/null +++ b/packages/debian/dnscrypt-proxy.init @@ -0,0 +1,133 @@ +#!/bin/sh -e + +### BEGIN INIT INFO +# Provides: dnscrypt-proxy +# Required-Start: $remote_fs +# Required-Stop: $remote_fs +# Should-Start: $network $syslog +# Should-Stop: $network $syslog +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Start and stop dnscrypt-proxy +# Description: dnscrypt-proxy is Domain Name resolver with extra security +# features and enhanced privacy. +### END INIT INFO + +PATH=/sbin:/bin:/usr/sbin:/usr/bin + +# for a chrooted server: "user=dnscrypt" +# Don't modify this line, change or create /etc/default/dnscrypt-proxy. +OPTIONS="" +CONF="/etc/default/dnscrypt-proxy" + +. /lib/lsb/init-functions +PIDFILE="$(grep '^pidfile' $CONF | head -n 1 | cut -d '=' -f 2)" +test -n "$PIDFILE" || PIDFILE=/run/dnscrypt-proxy.pid + +check_network() { + if [ -x /usr/bin/uname ] && [ "X$(/usr/bin/uname -o)" = XSolaris ]; then + IFCONFIG_OPTS="-au" + else + IFCONFIG_OPTS="" + fi + if [ -z "$(/sbin/ifconfig $IFCONFIG_OPTS)" ]; then + #log_action_msg "No networks configured." + return 1 + fi + return 0 +} + +case "$1" in + start) + log_daemon_msg "Starting domain name proxy service..." "dnscrypt-proxy" + + if [ ! -x /usr/sbin/dnscrypt-proxy ]; then + log_action_msg "dnscrypt-proxy binary missing - not starting" + log_end_msg 1 + fi + + if ! check_network; then + log_action_msg "no networks configured" + log_end_msg 1 + fi + + params="$(grep -v '^#' $CONF | cut -d '#' -f 1 | grep -v 'resolvconf')" + for parameter in $params; do + test -n "$parameter" && OPTIONS="$OPTIONS --$parameter" + done + + if start-stop-daemon --start --background --oknodo --quiet --exec /usr/sbin/dnscrypt-proxy \ + --pidfile ${PIDFILE} -- $OPTIONS; then + if [ "X$resolvconf" != "Xno" ] && [ -x /sbin/resolvconf ] ; then + echo "nameserver $(grep '^local-address' $CONF | head -n 1 \ + | cut -d '=' -f 2 | cut -d ':' -f 1)" \ + | /sbin/resolvconf -a lo.dnscrypt + fi + log_end_msg 0 + else + log_end_msg 1 + fi + ;; + + stop) + log_daemon_msg "Stopping domain name proxy service..." "dnscrypt-proxy" + if ! check_network; then + log_action_msg "no networks configured" + log_end_msg 1 + fi + + if [ "X$resolvconf" != "Xno" ] && [ -x /sbin/resolvconf ] ; then + /sbin/resolvconf -d lo.dnscrypt + fi + pid=$(pgrep --newest -f ^/usr/sbin/dnscrypt-proxy) || true + start-stop-daemon --stop --oknodo --quiet --exec /usr/sbin/dnscrypt-proxy \ + --pidfile ${PIDFILE} -- $OPTIONS + n=0 + if [ -n "$pid" ]; then + sig=0 + while kill -$sig $pid 2>/dev/null; do + if [ $n -eq 1 ]; then + echo -n " waiting for pid $pid to die" + fi + if [ $n -eq 11 ]; then + echo -n ". giving up on pid $pid with kill -0; trying -9" + sig=9 + fi + if [ $n -gt 20 ]; then + echo -n ". giving up on pid $pid." + break + fi + n=$(($n+1)) + sleep 1 + done + fi + if [ $n -gt 20 ] || [ $n -lt 1 ]; then + log_end_msg 1 + else + log_end_msg 0 + fi + ;; + + restart|reload|force-reload) + if ! check_network; then + log_action_msg "no networks configured" + exit 1 + fi + + $0 stop + $0 start + ;; + + status) + ret=0 + status_of_proc -p ${PIDFILE} /usr/sbin/dnscrypt-proxy dnscrypt-proxy 2>/dev/null || ret=$? + exit $ret + ;; + + *) + log_action_msg "Usage: /etc/init.d/dnscrypt-proxy {start|stop|reload|restart|force-reload|status}" + exit 1 + ;; +esac + +exit 0 diff --git a/packages/debian/dnscrypt-proxy.upstart b/packages/debian/dnscrypt-proxy.upstart new file mode 100644 index 00000000..edc63aaa --- /dev/null +++ b/packages/debian/dnscrypt-proxy.upstart @@ -0,0 +1,26 @@ +description "dnscrypt-proxy startup script" + +start on (local-filesystems and net-device-up IFACE=lo) +stop on runlevel [!2345] + +pre-start script + # This is the home dir of user "dnscrypt" + # dnscrypt-proxy will chroot there for security reasons + mkdir -p /run/dnscrypt + + #Load the AppArmor profile, otherwise it wouldn't be applied + /lib/init/apparmor-profile-load usr.sbin.dnscrypt-proxy || true +end script + +script + conffile="/etc/default/dnscrypt-proxy" + + if test -r "$conffile"; then + params="$(grep -v '^#' $conffile | cut -d '#' -f 1 | grep -v '^resolvconf')" + for parameter in $params; do + test -n "$parameter" && options="$options --$parameter" + done + fi + + exec /usr/sbin/dnscrypt-proxy $options +end script diff --git a/packages/debian/docs b/packages/debian/docs new file mode 100644 index 00000000..e00c089c --- /dev/null +++ b/packages/debian/docs @@ -0,0 +1,6 @@ +AUTHORS +NEWS +README.markdown +README-PLUGINS.markdown +TECHNOTES +THANKS diff --git a/packages/debian/postrm b/packages/debian/postrm new file mode 100644 index 00000000..453c5b7f --- /dev/null +++ b/packages/debian/postrm @@ -0,0 +1,42 @@ +#!/bin/sh +# postrm script for dnscrypt +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `remove' +# * `purge' +# * `upgrade' +# * `failed-upgrade' +# * `abort-install' +# * `abort-install' +# * `abort-upgrade' +# * `disappear' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + remove|purge|abort-install) + deluser --system --quiet dnscrypt + ;; + + upgrade|failed-upgrade|abort-upgrade|disappear) + : + ;; + + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/packages/debian/preinst b/packages/debian/preinst new file mode 100644 index 00000000..3880772b --- /dev/null +++ b/packages/debian/preinst @@ -0,0 +1,36 @@ +#!/bin/sh +# preinst script for dnscrypt +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `install' +# * `install' +# * `upgrade' +# * `abort-upgrade' +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + install|upgrade) + adduser --system --quiet --home /run/dnscrypt --shell /bin/false --group --disabled-password --disabled-login dnscrypt + ;; + + abort-upgrade) + ;; + + *) + echo "preinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/packages/debian/rules b/packages/debian/rules new file mode 100644 index 00000000..167e272e --- /dev/null +++ b/packages/debian/rules @@ -0,0 +1,20 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# Sample debian/rules that uses debhelper. +# This file was originally written by Joey Hess and Craig Small. +# As a special exception, when this file is copied by dh-make into a +# dh-make output file, you may use that output file without restriction. +# This special exception was added by Craig Small in version 0.37 of dh-make. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +%: + dh $@ --with autotools-dev + +override_dh_auto_configure: + dh_auto_configure -- --disable-ltdl-install --without-included-ltdl + +# Tests may fail on build servers and aren't useful in release builds anyway +override_dh_auto_test: + diff --git a/packages/debian/source/format b/packages/debian/source/format new file mode 100644 index 00000000..163aaf8d --- /dev/null +++ b/packages/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/packages/fpm/fpm.sh b/packages/fpm/fpm.sh index 4f8e1680..aef9be57 100755 --- a/packages/fpm/fpm.sh +++ b/packages/fpm/fpm.sh @@ -1,10 +1,10 @@ #! /bin/sh -VERSION="1.1.0" +VERSION="1.4.3" MAINTAINER="Frank Denis " CATEGORY="net" URL="http://dnscrypt.org" -VENDOR="OpenDNS" +VENDOR="Frank Denis" DESCRIPTION="A tool for securing communications between a client and a DNS resolver The DNSCrypt protocol is very similar to DNSCurve, but focuses on securing communications between a client and its first-level resolver. @@ -15,7 +15,7 @@ DNS queries. The DNSCrypt daemon acts as a DNS proxy between a regular client, like a DNS cache or an operating system stub resolver, and a DNSCrypt-aware -resolver, like OpenDNS." +resolver." TMPDIR=${TMPDIR:-/tmp} BASE_DIR=$(mktemp -d "$TMPDIR"/dnscrypt.XXXXXX) INSTALL_DIR="${BASE_DIR}/usr" diff --git a/packages/gentoo/metadata/layout.conf b/packages/gentoo/metadata/layout.conf new file mode 100644 index 00000000..d43e61ca --- /dev/null +++ b/packages/gentoo/metadata/layout.conf @@ -0,0 +1 @@ +masters = gentoo diff --git a/packages/gentoo/net-dns/dnscrypt-proxy/Manifest b/packages/gentoo/net-dns/dnscrypt-proxy/Manifest index 3fafe5aa..f3b226a4 100644 --- a/packages/gentoo/net-dns/dnscrypt-proxy/Manifest +++ b/packages/gentoo/net-dns/dnscrypt-proxy/Manifest @@ -1,12 +1,13 @@ -AUX dnscrypt-proxy.confd 49 SHA256 4c7a4d00bfd1413d491152617e90cf3ba225c759dcaee28eddce08156f01121b SHA512 f3d544d571bf0d1822a5727e6be43bbf9bcdb6f6df5e31db42b9d92c39e7c3d4d9a858ba859f587a0e4e0989cb1abe38ce9906217401f474fb371eeb4b904e16 WHIRLPOOL 8bb81af8605bd23514046f4fb9c76e4ccb23c0fef09ec91cbb947e4e2f4362e9c8b985655c2b7ea6a25d284c8a4c3ca1f0e163fe7ce39efdacea9bf6e391086d -AUX dnscrypt-proxy.initd 1027 SHA256 4f964340221c481166f3a5064a2fc8907acbd375e313c51a092bba8e0db26301 SHA512 34cafbb4dedc9cefa8032d9203233ee15a392d2343bfa8dda61ccdccc807a62d9202c76f25791552860a9b27c4758bf4a667224e98db070322d6471698b8c6d2 WHIRLPOOL f9356627f65d4373ecfde7334eba0db3e15189016242e20a95cef72466badb8b755957b498f48ce9ea248dc3d1974ee156598e892fed082a6527a016fa2e221c -AUX dnscrypt-proxy_1_2_0.confd 35 SHA256 e4fac1b2b76a11d7acbacb7170b7ad8b13cbff2237326c3df9dd1090e8388a56 SHA512 9a74a6de46acdb734ed12357da77f24e6c7f673edaa20197bce7665c80e640c5504bf9c126bf99a378326a46e171d150342f10690f59d0b131cc2f54bfd14725 WHIRLPOOL e34914a9b3e2d4edfb56b222942b729f6a767432f782e8688a50733264794265ee7561c8bccff6c347f6ce4c57b58cf1527e6fb4077cd9c8685a92108c67789c -AUX dnscrypt-proxy_1_2_0.initd 1007 SHA256 55318f0ef22a0855ea76763aad2b163292c6298892874b21da36e64a68a544c3 SHA512 941cc3339c6ebc02051e1565d020797d626a530a5674570c6f04a1053b7dc8222ebf69369141d8d13868a3ba0210827961b8fe9ebecc9ba5c5a17191883adc9a WHIRLPOOL e0ca0863472a69008c08375e2efc39d00b7d809324277f687da6d70ad83f755039459714c4f4beb9210a93eae29bcb442d404cc167a5428f97f30ba6539ad6f0 -DIST dnscrypt-proxy-0.9.3.tar.gz 1368327 SHA256 f1733e443a815da6789130f7718500304f2d90fbcdce863a5a5b98c9de06372b -DIST dnscrypt-proxy-0.9.4.tar.gz 1040199 SHA256 2a45f092c6eb59c5553f5c30583974cf6cff7b4f4e77d6c5ba59d29c32fee3df -DIST dnscrypt-proxy-1.0.tar.gz 1353867 SHA256 f6309c5216a2a0d7d88cdbd18ea2ca3b3f37d92b1f97dd48b8cf294b931952b8 -DIST dnscrypt-proxy-1.2.0.tar.gz 1666090 SHA256 02ae6360887995d73d4c02ea7fa0cc8cad4a4de61f89c2fd68674a65f427b333 SHA512 b628aa7b5724212883a61d1c48fcc6b14c8b6ccc94cb8ae539ef0d8625ac3ae151304ca5ccf5c1fd4c4a286c8cd7a4d51d571df53e0756d992d05153a06342e9 WHIRLPOOL 23b407caf7f1c6f8f3efc7edef4778d768ded7d1182cd1b5031b112bd2053bdcc018a4bc0236d51d4b8f1db3b0607483fb2758c34e990d8ae74fd45d46e3b61e -EBUILD dnscrypt-proxy-0.9.3.ebuild 809 SHA256 08fd9ff62f3a79599efb78b1af7d9f557c366ab75ed303dd0b75f8db88b1e907 SHA512 7b57d155bc8dc3c04c36f34841b67eade45b1322c3594749816b328f2ef2402e709a8c3d4f31c72427bb08a7f93fc422e6f781cc9946368cc6bac7ca62cb1d7b WHIRLPOOL fd00b2fbb9551415e659d40daf9847753fd43ad4ad0a73e98ffb1b74678781c2812a24f090432fc2eaba35f2254c7f837fa8cb87fec5126d41f83686521eb2b3 -EBUILD dnscrypt-proxy-0.9.4.ebuild 837 SHA256 32d813a566813c52ca7b83e9c5317c4b663fa456ac838bd5409020f3d2308bc5 SHA512 4a5d8723b2fb81e4ed4cb683d773192ed46e3a415577e730a22a4cfcf36338f62ccf4570667e1358bf7caafe7945c485ee4da5c453fb090524dfda2f623509fa WHIRLPOOL ac34e94c424fbf07bf737b903828c8a42fb9bf074558dde5433ef45c5ba7e13bb81491c615a628ed59fd7d891c76c0a3b09427a6d2b31ebff2eb54a13a76e2b9 -EBUILD dnscrypt-proxy-1.0.ebuild 837 SHA256 32d813a566813c52ca7b83e9c5317c4b663fa456ac838bd5409020f3d2308bc5 SHA512 4a5d8723b2fb81e4ed4cb683d773192ed46e3a415577e730a22a4cfcf36338f62ccf4570667e1358bf7caafe7945c485ee4da5c453fb090524dfda2f623509fa WHIRLPOOL ac34e94c424fbf07bf737b903828c8a42fb9bf074558dde5433ef45c5ba7e13bb81491c615a628ed59fd7d891c76c0a3b09427a6d2b31ebff2eb54a13a76e2b9 -EBUILD dnscrypt-proxy-1.2.0.ebuild 849 SHA256 56d820ff0a4a1e83df170c965f882c7f851e089b19929f2443d8a35359f903af SHA512 728dde35bee2e8113ba8f45911b79572f844f172813b20cc32d523f912214c59f8aa98d78e4ee404ccda63adbbd46d8ae43ca8d7318cc926e4ac0787aafe70fc WHIRLPOOL 035a6d2f17516bc7222e5273a214f8ce49410cb9880a66c92341b8f038672c9e74c07d2a55c85d0b086d769a6f89e28b7944f715102463ab820686a4c08dfc3b +AUX 0001-Handle-disable-plugins-correctly-in-configure.ac.patch 1784 SHA256 17a8e3164b72443b7618f7c712efc2a47de24da67e7393d850aceeef7f1f557c SHA512 355cd0d6bfb103ef3cd90ec9a7f79573a92362742e793a4ebb476b7055cba4d87d78fcaf0d509b69487cae88515f4651153a4198371bea189895953f41492043 WHIRLPOOL 522fefe370a16cecc3472c9de9b5753d9761d7e36d49825bbfb5b1860691ef3cd057f744d44dab20efdf22d7a88c40c27508a663837947ceeccd880c900ddee0 +AUX dnscrypt-proxy_1_2_0.confd 35 SHA256 94d8996f396ea11292416e2a9bbb4bcfbd0ddd855e3e821a3a9dcef684878b02 SHA512 bbdd550bf979af22011474435872387f4a4c9d85e74390823fe20f833d26ef38a1afcf89c9d40280ba6e12d71ca9099ca0d59aeb6a2db7b0f8a7fff9c4805b09 WHIRLPOOL 7d2bc78447273ecdbe8d6e201963b3c8e742bfa33e2b40f65d88c0ba706b2caf764d90280ffeab91b646c26aa91dc8c9f041ea932d7144b897d128d399690f84 +AUX dnscrypt-proxy_1_2_0.initd 1420 SHA256 e8f736850dd37f0f5978d9937d043af70d9542de243c0fad3be20bf6b65dc8d4 SHA512 016d1b0f633668879a69d6bb9180cbfeaafb734096ddca2c9a15c474cf1607f171f34dc5b9667becc2993e0b97c441b6728d98ff7b7491d61f4edb78c512bf69 WHIRLPOOL c93a775cad79226bcdc3f881bb083e53cdd7a6996376ba2e618a3aad22a852fc67bfcdb30e69dde97c2e5f2153e2707bf0e3ef4b50a7df1282b40906f2ca8c7c +AUX dnscrypt-proxy_1_4_0.confd 77 SHA256 ddc095c84a77c8decbcc264a79fa0e1847b7ca5a7fd5886eef0e579d567e0963 SHA512 5740c7b571d576c3baf0695cf55a533318e32cc990f3a42b2b0316fcc5a299518fa5da54b0f7f120db3da0b1b5f504b3b2827630d42c553771b2b44cdfc034a3 WHIRLPOOL 50c62fc23e88e8f9458673a063a50de377001bc3b82cb4849c21350d227f7cec78ab89f0e90de8629807a515996e239aedc0ce770582367e772f48e71cd82efe +AUX dnscrypt-proxy_1_4_0.initd 1530 SHA256 e1e5ce79edca384ee8deb537241d3016a75c8fd92106f04689e21f1b63831397 SHA512 8ac5fa46791f34458ba2d05612a65f74dce9826c082866f81a2ddf540c4c110b86e2b178bf05b04067560b68c6d63abb5911212665d771782f5001c212fa4a36 WHIRLPOOL 56da99065abffa62608bc06910f3326ebe8bcd6626cb2899e146b295d1c2044cdf72da7e739928c57b8d98ccaf76f1a7a8ff1b0cde8ca13af93616487e0ce0c2 +DIST dnscrypt-proxy-1.3.3.tar.gz 1576428 SHA256 c36ba6c3277d3438986af1e8d12adf7d35544b56d1747fa93a50b4d72ebf3e4a SHA512 16f668b7330278f7b1c837e5d498f4099af1673be8defb1d931a612d20688b0b666e9b20c2f753ffe2142812ce3c792c13e9938ed7c94dc64bb7a1786d94820c WHIRLPOOL b56cdd289ddcd240942c2481b6cc17ba95fcc0c78eb06e30af7f5ffe16b606e8cd53d2ebb9855a4c1b185506a675cd71a3cce17ea22a9a8c6078b93a898ce5bc +DIST dnscrypt-proxy-1.4.0.tar.gz 1579426 SHA256 60b57b36aa15706c4cd0c348fc59534c15913c282a2b7d4db0b3787167b33502 SHA512 74b36ef62ab4715ae27f12e7101e4a85606b9f683424fe99c5501669f591399836f2e8c8ae0cc31211f0cff7c13bed388e4567bef75e15ffb30b1701ec6c4ed2 WHIRLPOOL 119018f2202cee2d3d9a5dd1da5f32f580aa51ffaa6bc210146beb8bd854515b166e0385b540628b21edb93cc77e3e5357f71a367e17231039fb0626ffe2de77 +DIST dnscrypt-proxy-1.4.1.tar.gz 1582325 SHA256 b53822841bd275d81ff9faa4784a42618b7acc3c76a86c75be40379c503d69de SHA512 1226a06ba1fa508565dddb0c0b1b63b93b578cbd8f8912d4dcc02f9a878f25e7475917d9e966525b905d8d5b0ab0a8be637e9ff622c6c00d2686d053d553ce3e WHIRLPOOL 2aea4c5d49cb068d58969d4bc9fe67e4ea6c25ccfaac415c03bd484833580e761b54be024afcc1ca9abf573188260db5c7b0174e87e2e4d78ca027ac28e9d627 +EBUILD dnscrypt-proxy-1.3.3-r1.ebuild 952 SHA256 d8326d52d2a032f99a8442c24f1a3b4d1d3010ca8cdf551d306411b099784812 SHA512 2d4b5de51335ee2e2cb06e71e0d840eb61d3a76887d82eca5292e082111bfc1b1c8e79e565d451f8f79510ee056592a0e66729cacbb5eb99a9511dc0a7387e96 WHIRLPOOL 7f4df9744ffab00399cec1f898c763ec15c7410812355dc9f36ea383ba0fdd9a8e325141e12294fbb7a360b80e336c0bb2dea48f0c30d4fa62c15d9c5b1b708e +EBUILD dnscrypt-proxy-1.3.3.ebuild 836 SHA256 cf86233db9f210833c1da9e3ce1c117d1836672e6ee7f26e39bb1eb3fc080f1f SHA512 377f63bd98047b4c1d20fa9e31b745aa21622a24b0de32bd94ada36fcf107eb6e8bf1a98d1965c4999011c3d0ceda8fa966a3f96d2f6c587b41be81957e90e2c WHIRLPOOL 076bbe4de8e67b19ee66d1bdac92e8be99ae3e4f4cba7385228d4ba04a3231e9dc10a7d8bd28bf5af969f10a2165027c46aaab74eae7f29992d44176a398fc9e +EBUILD dnscrypt-proxy-1.4.0.ebuild 985 SHA256 a3ca1757eea6b3a9f777e3bb8e8b8ac7ac2a0439fe8758346850cac2792d636e SHA512 a519e930db1ca6c0f9a800bf5a054ba3db60c2689c0e3ac29e5d1d1bf80f197b866b37d77897e174404f3929746e9b5a9fdb3145b0f238ad999eb9ab9035b586 WHIRLPOOL 7ee4422c2e53f2a1f514d105b873b37a0b50c9fee7cda68b2da348fc2ffb56145323579f3f55efb57ec6cfc8d97fccec5fde0e5dba2f3e20853338c530d23436 +EBUILD dnscrypt-proxy-1.4.1.ebuild 984 SHA256 9c679058b347f2aff16f7ba8dc05b2fd39d87043bd122154a40192dafc33114c SHA512 4ede25ca767d373dacb9e1f61034729659e6149c4283b2655eb23625e9620257f6a4748062f045752e43fab9011c87b4a6e1b28481e0b54ac400142b01aef7f6 WHIRLPOOL e8cbb7a8ec75677aa17763eadb70a2e1816c405ebb6ddc5b027c5c8976ea0e7b0b1722e2ec851e6799e901ffb534cd7f96c87cfe48be1c33b9fecb21287b59ec +MISC metadata.xml 322 SHA256 de5dbc5fc76bbd41a9ced69ac9f30fcfe25d6c57ddc6144d2c5cad3152f395df SHA512 bb31ee7b675e17f81b8be6b5441720b4e9b4f52075ae8a2bbbb82afdc57d5c178d7304315cfedda60a085b23c369066af9bb09aee452b27021ab4f41a4fc5e9e WHIRLPOOL c9a4c44d0f77f994482afdf8738a96b2002626f2a4a2e9194a9a7f2a278268075a40073ee107e4bb7702001fdb4315c46d4a090c8e47e6071281e3395fb0569f diff --git a/packages/gentoo/net-dns/dnscrypt-proxy/dnscrypt-proxy-0.9.3.ebuild b/packages/gentoo/net-dns/dnscrypt-proxy/dnscrypt-proxy-0.9.3.ebuild deleted file mode 100644 index bfa89873..00000000 --- a/packages/gentoo/net-dns/dnscrypt-proxy/dnscrypt-proxy-0.9.3.ebuild +++ /dev/null @@ -1,30 +0,0 @@ -EAPI="3" - -inherit eutils flag-o-matic - -DESCRIPTION="A tool for securing communications between a client and a DNS resolver" -HOMEPAGE="http://www.opendns.com/technology/dnscrypt/" -SRC_URI="http://download.dnscrypt.org/dnscrypt-proxy/dnscrypt-proxy/${P}.tar.gz" - -LICENSE="BSD" -SLOT="0" -KEYWORDS="amd64 i386" - -pkg_setup() { - enewgroup dnscrypt - enewuser dnscrypt -1 -1 /var/empty dnscrypt -} - -src_configure() { - append-ldflags -Wl,-z,noexecstack || die - econf || die -} - -src_install() { - emake DESTDIR="${D}" install || die "emake install failed" - - newinitd "${FILESDIR}/dnscrypt-proxy.initd" dnscrypt-proxy || die "newinitd failed" - newconfd "${FILESDIR}/dnscrypt-proxy.confd" dnscrypt-proxy || die "newconfd failed" - - dodoc {AUTHORS,COPYING,INSTALL,NEWS,README,README.markdown,TECHNOTES,THANKS} || die "dodoc failed" -} diff --git a/packages/gentoo/net-dns/dnscrypt-proxy/dnscrypt-proxy-0.9.4.ebuild b/packages/gentoo/net-dns/dnscrypt-proxy/dnscrypt-proxy-0.9.4.ebuild deleted file mode 100644 index 651684c5..00000000 --- a/packages/gentoo/net-dns/dnscrypt-proxy/dnscrypt-proxy-0.9.4.ebuild +++ /dev/null @@ -1,30 +0,0 @@ -EAPI="3" - -inherit eutils flag-o-matic - -DESCRIPTION="A tool for securing communications between a client and a DNS resolver" -HOMEPAGE="http://www.opendns.com/technology/dnscrypt/" -SRC_URI="http://download.dnscrypt.org/dnscrypt-proxy/dnscrypt-proxy/${P}.tar.gz" - -LICENSE="BSD" -SLOT="0" -KEYWORDS="amd64 i386" - -pkg_setup() { - enewgroup dnscrypt - enewuser dnscrypt -1 -1 /var/empty dnscrypt -} - -src_configure() { - append-ldflags -Wl,-z,noexecstack || die - econf --enable-nonblocking-random || die -} - -src_install() { - emake DESTDIR="${D}" install || die "emake install failed" - - newinitd "${FILESDIR}/dnscrypt-proxy.initd" dnscrypt-proxy || die "newinitd failed" - newconfd "${FILESDIR}/dnscrypt-proxy.confd" dnscrypt-proxy || die "newconfd failed" - - dodoc {AUTHORS,COPYING,INSTALL,NEWS,README,README.markdown,TECHNOTES,THANKS} || die "dodoc failed" -} diff --git a/packages/gentoo/net-dns/dnscrypt-proxy/dnscrypt-proxy-1.0.ebuild b/packages/gentoo/net-dns/dnscrypt-proxy/dnscrypt-proxy-1.0.ebuild deleted file mode 100644 index 651684c5..00000000 --- a/packages/gentoo/net-dns/dnscrypt-proxy/dnscrypt-proxy-1.0.ebuild +++ /dev/null @@ -1,30 +0,0 @@ -EAPI="3" - -inherit eutils flag-o-matic - -DESCRIPTION="A tool for securing communications between a client and a DNS resolver" -HOMEPAGE="http://www.opendns.com/technology/dnscrypt/" -SRC_URI="http://download.dnscrypt.org/dnscrypt-proxy/dnscrypt-proxy/${P}.tar.gz" - -LICENSE="BSD" -SLOT="0" -KEYWORDS="amd64 i386" - -pkg_setup() { - enewgroup dnscrypt - enewuser dnscrypt -1 -1 /var/empty dnscrypt -} - -src_configure() { - append-ldflags -Wl,-z,noexecstack || die - econf --enable-nonblocking-random || die -} - -src_install() { - emake DESTDIR="${D}" install || die "emake install failed" - - newinitd "${FILESDIR}/dnscrypt-proxy.initd" dnscrypt-proxy || die "newinitd failed" - newconfd "${FILESDIR}/dnscrypt-proxy.confd" dnscrypt-proxy || die "newconfd failed" - - dodoc {AUTHORS,COPYING,INSTALL,NEWS,README,README.markdown,TECHNOTES,THANKS} || die "dodoc failed" -} diff --git a/packages/gentoo/net-dns/dnscrypt-proxy/dnscrypt-proxy-1.3.3-r1.ebuild b/packages/gentoo/net-dns/dnscrypt-proxy/dnscrypt-proxy-1.3.3-r1.ebuild new file mode 100644 index 00000000..5c22ee72 --- /dev/null +++ b/packages/gentoo/net-dns/dnscrypt-proxy/dnscrypt-proxy-1.3.3-r1.ebuild @@ -0,0 +1,43 @@ +EAPI=5 + +inherit autotools-utils user + +DESCRIPTION="A tool for securing communications between a client and a DNS resolver" +HOMEPAGE="http://dnscrypt.org" +SRC_URI="http://download.dnscrypt.org/dnscrypt-proxy/${P}.tar.gz" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="amd64 i386" + +RDEPEND=" + >=dev-libs/libsodium-0.4.2" +IUSE="-plugins" + +AUTOTOOLS_IN_SOURCE_BUILD=1 + +DOCS=(AUTHORS COPYING INSTALL NEWS README README.markdown TECHNOTES THANKS) + +PATCHES=( + "${FILESDIR}/0001-Handle-disable-plugins-correctly-in-configure.ac.patch" +) +AUTOTOOLS_AUTORECONF=1 + +pkg_setup() { + enewgroup dnscrypt + enewuser dnscrypt -1 -1 /var/empty dnscrypt +} + +src_configure() { + local myeconfargs=( + $(use_enable plugins) + ) + autotools-utils_src_configure +} + +src_install() { + autotools-utils_src_install + + newinitd "${FILESDIR}/dnscrypt-proxy_1_2_0.initd" dnscrypt-proxy || die "newinitd failed" + newconfd "${FILESDIR}/dnscrypt-proxy_1_2_0.confd" dnscrypt-proxy || die "newconfd failed" +} diff --git a/packages/gentoo/net-dns/dnscrypt-proxy/dnscrypt-proxy-1.2.0.ebuild b/packages/gentoo/net-dns/dnscrypt-proxy/dnscrypt-proxy-1.3.3.ebuild similarity index 51% rename from packages/gentoo/net-dns/dnscrypt-proxy/dnscrypt-proxy-1.2.0.ebuild rename to packages/gentoo/net-dns/dnscrypt-proxy/dnscrypt-proxy-1.3.3.ebuild index 57c1a31d..92a189a2 100644 --- a/packages/gentoo/net-dns/dnscrypt-proxy/dnscrypt-proxy-1.2.0.ebuild +++ b/packages/gentoo/net-dns/dnscrypt-proxy/dnscrypt-proxy-1.3.3.ebuild @@ -1,30 +1,38 @@ -EAPI="3" +EAPI=5 -inherit eutils flag-o-matic +inherit autotools-utils DESCRIPTION="A tool for securing communications between a client and a DNS resolver" -HOMEPAGE="http://www.opendns.com/technology/dnscrypt/" -SRC_URI="http://download.dnscrypt.org/dnscrypt-proxy/dnscrypt-proxy/${P}.tar.gz" +HOMEPAGE="http://dnscrypt.org" +SRC_URI="http://download.dnscrypt.org/dnscrypt-proxy/${P}.tar.gz" LICENSE="BSD" SLOT="0" KEYWORDS="amd64 i386" +RDEPEND=" + >=dev-libs/libsodium-0.4.2" +IUSE="-plugins" + +AUTOTOOLS_IN_SOURCE_BUILD=1 + +DOCS=(AUTHORS COPYING INSTALL NEWS README README.markdown TECHNOTES THANKS) + pkg_setup() { enewgroup dnscrypt enewuser dnscrypt -1 -1 /var/empty dnscrypt } src_configure() { - append-ldflags -Wl,-z,noexecstack || die - econf --enable-nonblocking-random || die + local myeconfargs=( + $(use_enable plugins) + ) + autotools-utils_src_configure } src_install() { - emake DESTDIR="${D}" install || die "emake install failed" + autotools-utils_src_install newinitd "${FILESDIR}/dnscrypt-proxy_1_2_0.initd" dnscrypt-proxy || die "newinitd failed" newconfd "${FILESDIR}/dnscrypt-proxy_1_2_0.confd" dnscrypt-proxy || die "newconfd failed" - - dodoc {AUTHORS,COPYING,INSTALL,NEWS,README,README.markdown,TECHNOTES,THANKS} || die "dodoc failed" } diff --git a/packages/gentoo/net-dns/dnscrypt-proxy/dnscrypt-proxy-1.4.0.ebuild b/packages/gentoo/net-dns/dnscrypt-proxy/dnscrypt-proxy-1.4.0.ebuild new file mode 100644 index 00000000..a822a7f9 --- /dev/null +++ b/packages/gentoo/net-dns/dnscrypt-proxy/dnscrypt-proxy-1.4.0.ebuild @@ -0,0 +1,43 @@ +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ +EAPI=5 + +inherit autotools-utils user + +DESCRIPTION="A tool for securing communications between a client and a DNS resolver" +HOMEPAGE="http://dnscrypt.org" +SRC_URI="http://download.dnscrypt.org/dnscrypt-proxy/${P}.tar.gz" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~amd64 ~x86" + +DEPEND=" + >=dev-libs/libsodium-1.0.0" +IUSE="-plugins" + +AUTOTOOLS_IN_SOURCE_BUILD=1 + +DOCS=(AUTHORS COPYING INSTALL NEWS README README.markdown TECHNOTES THANKS) + +AUTOTOOLS_AUTORECONF=1 + +pkg_setup() { + enewgroup dnscrypt + enewuser dnscrypt -1 -1 /var/empty dnscrypt +} + +src_configure() { + local myeconfargs=( + $(use_enable plugins) + ) + autotools-utils_src_configure +} + +src_install() { + autotools-utils_src_install + + newinitd "${FILESDIR}/dnscrypt-proxy_1_4_0.initd" dnscrypt-proxy || die "newinitd failed" + newconfd "${FILESDIR}/dnscrypt-proxy_1_4_0.confd" dnscrypt-proxy || die "newconfd failed" +} diff --git a/packages/gentoo/net-dns/dnscrypt-proxy/dnscrypt-proxy-1.4.1.ebuild b/packages/gentoo/net-dns/dnscrypt-proxy/dnscrypt-proxy-1.4.1.ebuild new file mode 100644 index 00000000..dcc60f33 --- /dev/null +++ b/packages/gentoo/net-dns/dnscrypt-proxy/dnscrypt-proxy-1.4.1.ebuild @@ -0,0 +1,43 @@ +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ +EAPI=5 + +inherit autotools-utils user + +DESCRIPTION="A tool for securing communications between a client and a DNS resolver" +HOMEPAGE="http://dnscrypt.org" +SRC_URI="http://download.dnscrypt.org/dnscrypt-proxy/${P}.tar.gz" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~amd64 ~x86" + +DEPEND=">=dev-libs/libsodium-1.0.0" + +IUSE="-plugins" + +AUTOTOOLS_IN_SOURCE_BUILD=1 + +DOCS=(AUTHORS COPYING INSTALL NEWS README README.markdown TECHNOTES THANKS) + +AUTOTOOLS_AUTORECONF=1 + +pkg_setup() { + enewgroup dnscrypt + enewuser dnscrypt -1 -1 /var/empty dnscrypt +} + +src_configure() { + local myeconfargs=( + $(use_enable plugins) + ) + autotools-utils_src_configure +} + +src_install() { + autotools-utils_src_install + + newinitd "${FILESDIR}/dnscrypt-proxy_1_4_0.initd" dnscrypt-proxy || die "newinitd failed" + newconfd "${FILESDIR}/dnscrypt-proxy_1_4_0.confd" dnscrypt-proxy || die "newconfd failed" +} diff --git a/packages/gentoo/net-dns/dnscrypt-proxy/files/0001-Handle-disable-plugins-correctly-in-configure.ac.patch b/packages/gentoo/net-dns/dnscrypt-proxy/files/0001-Handle-disable-plugins-correctly-in-configure.ac.patch new file mode 100644 index 00000000..0299d87d --- /dev/null +++ b/packages/gentoo/net-dns/dnscrypt-proxy/files/0001-Handle-disable-plugins-correctly-in-configure.ac.patch @@ -0,0 +1,57 @@ +From 3bc510635e4e03b8546c0edb88f5f5cff77724e0 Mon Sep 17 00:00:00 2001 +From: Sven Grunewaldt +Date: Thu, 31 Oct 2013 21:06:11 +0100 +Subject: [PATCH] Handle --disable-plugins* correctly in configure.ac + +--- + configure.ac | 24 ++++++++++++++++++------ + 1 file changed, 18 insertions(+), 6 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 2c0e8c1..8560275 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -69,22 +69,34 @@ AC_ARG_ENABLE(debug, + plugins=disabled + AC_ARG_ENABLE(plugins, + [AS_HELP_STRING(--enable-plugins,Enable support for plugins - experimental)], +-[CPPFLAGS="$CPPFLAGS -DPLUGINS=1" +- plugins=enabled]) ++[ ++ AS_IF([test "x$enableval" != "xno"], [ ++ CPPFLAGS="$CPPFLAGS -DPLUGINS=1" ++ plugins=enabled ++ ]) ++]) + AM_CONDITIONAL(PLUGINS, test x$plugins = xenabled) + + relaxed_plugins_permissions=disabled + AC_ARG_ENABLE(relaxed-plugins-permissions, + [AS_HELP_STRING(--enable-relaxed-plugins-permissions,Allow loading plugins owned by other users)], +-[CPPFLAGS="$CPPFLAGS -DRELAXED_PLUGINS_PERMISSIONS=1" +- relaxed_plugins_permissions=enabled]) ++[ ++ AS_IF([test "x$enableval" != "xno"], [ ++ CPPFLAGS="$CPPFLAGS -DRELAXED_PLUGINS_PERMISSIONS=1" ++ relaxed_plugins_permissions=enabled ++ ]) ++]) + AM_CONDITIONAL(RELAXED_PLUGINS_PERMISSIONS, test x$relaxed_plugins_permissions = xenabled) + + plugins_root=disabled + AC_ARG_ENABLE(plugins-root, + [AS_HELP_STRING(--enable-plugins-root,Only load plugins sitting in the default plugins directory)], +-[CPPFLAGS="$CPPFLAGS -DENABLE_PLUGINS_ROOT=1" +- plugins_root=enabled]) ++[ ++ AS_IF([test "x$enableval" != "xno"], [ ++ CPPFLAGS="$CPPFLAGS -DENABLE_PLUGINS_ROOT=1" ++ plugins_root=enabled ++ ]) ++]) + AM_CONDITIONAL(ENABLE_PLUGINS_ROOT, test x$plugins_root = xenabled) + + AC_SUBST([MAINT]) +-- +1.8.4.1 + diff --git a/packages/gentoo/net-dns/dnscrypt-proxy/files/dnscrypt-proxy.confd b/packages/gentoo/net-dns/dnscrypt-proxy/files/dnscrypt-proxy.confd deleted file mode 100644 index 644f856f..00000000 --- a/packages/gentoo/net-dns/dnscrypt-proxy/files/dnscrypt-proxy.confd +++ /dev/null @@ -1,2 +0,0 @@ -DNSCRYPT_LOCALIP=127.0.0.1 -DNSCRYPT_LOCALPORT=52 diff --git a/packages/gentoo/net-dns/dnscrypt-proxy/files/dnscrypt-proxy.initd b/packages/gentoo/net-dns/dnscrypt-proxy/files/dnscrypt-proxy.initd deleted file mode 100755 index 9a2280c0..00000000 --- a/packages/gentoo/net-dns/dnscrypt-proxy/files/dnscrypt-proxy.initd +++ /dev/null @@ -1,37 +0,0 @@ -#!/sbin/runscript - -DNSCRYPT_LOGFILE=${DNSCRYPT_LOGFILE:-/var/log/dnscrypt-proxy.log} - -rundir=${rundir:-/var/run/dnscrypt-proxy} -pidfile=${pidfile:-${rundir}/dnscrypt-proxy.pid} -rundir=${rundir:-/var/run/dnscrypt-proxy} -runas_user=${runas_user:-dnscrypt} -runas_group=${runas_user:-dnscrypt} - -depend() { - use net - before dns - after logger -} - -start() { - - if [ ! -d "${rundir}" ]; then - mkdir "${rundir}" - if [ -n "${runas_user}" ]; then - touch ${DNSCRYPT_LOGFILE} - chown ${runas_user}:${runas_group} ${DNSCRYPT_LOGFILE} - chown -R ${runas_user}:${runas_group} "${rundir}" - fi - fi - - ebegin "Starting dnscrypt-proxy" - start-stop-daemon --start --quiet --pidfile=${pidfile} --exec /usr/sbin/dnscrypt-proxy -- -p ${pidfile} -l ${DNSCRYPT_LOGFILE} -d -u ${runas_group} -a ${DNSCRYPT_LOCALIP} -P ${DNSCRYPT_LOCALPORT} - eend $? -} - -stop() { - ebegin "Stopping dnscrypt-proxy" - start-stop-daemon --stop --quiet --exec /usr/sbin/dnscrypt-proxy - eend $? -} diff --git a/packages/gentoo/net-dns/dnscrypt-proxy/files/dnscrypt-proxy_1_2_0.confd b/packages/gentoo/net-dns/dnscrypt-proxy/files/dnscrypt-proxy_1_2_0.confd index 94c1bb0b..9f1a8c93 100644 --- a/packages/gentoo/net-dns/dnscrypt-proxy/files/dnscrypt-proxy_1_2_0.confd +++ b/packages/gentoo/net-dns/dnscrypt-proxy/files/dnscrypt-proxy_1_2_0.confd @@ -1 +1 @@ -DNSCRYPT_LOCALADDRESS=127.0.0.1:52 +DNSCRYPT_LOCALADDRESS=127.0.0.1:53 diff --git a/packages/gentoo/net-dns/dnscrypt-proxy/files/dnscrypt-proxy_1_2_0.initd b/packages/gentoo/net-dns/dnscrypt-proxy/files/dnscrypt-proxy_1_2_0.initd index a7980221..bc6ed9b0 100644 --- a/packages/gentoo/net-dns/dnscrypt-proxy/files/dnscrypt-proxy_1_2_0.initd +++ b/packages/gentoo/net-dns/dnscrypt-proxy/files/dnscrypt-proxy_1_2_0.initd @@ -2,9 +2,24 @@ DNSCRYPT_LOGFILE=${DNSCRYPT_LOGFILE:-/var/log/dnscrypt-proxy.log} -rundir=${rundir:-/var/run/dnscrypt-proxy} +OPTIONS=" " +if [ -n "$DNSCRYPT_LOGLEVEL" ]; then + OPTIONS="${OPTIONS} --loglevel=${DNSCRYPT_LOGLEVEL}" +fi +if [ -n "$DNSCRYPT_PROVIDER_KEY" ]; then + OPTIONS="${OPTIONS} --provider-key=${DNSCRYPT_PROVIDER_KEY}" +fi + +if [ -n "$DNSCRYPT_PROVIDER_NAME" ]; then + OPTIONS="${OPTIONS} --provider-name=${DNSCRYPT_PROVIDER_NAME}" +fi + +if [ -n "$DNSCRYPT_PROVIDER_ADDRESS" ]; then + OPTIONS="${OPTIONS} --resolver-address=${DNSCRYPT_PROVIDER_ADDRESS}" +fi + +rundir=${rundir:-/run/dnscrypt-proxy} pidfile=${pidfile:-${rundir}/dnscrypt-proxy.pid} -rundir=${rundir:-/var/run/dnscrypt-proxy} runas_user=${runas_user:-dnscrypt} runas_group=${runas_user:-dnscrypt} @@ -26,7 +41,7 @@ start() { fi ebegin "Starting dnscrypt-proxy" - start-stop-daemon --start --quiet --pidfile=${pidfile} --exec /usr/sbin/dnscrypt-proxy -- -p ${pidfile} -l ${DNSCRYPT_LOGFILE} -d -u ${runas_group} -a ${DNSCRYPT_LOCALADDRESS} + start-stop-daemon --start --pidfile=${pidfile} --exec /usr/sbin/dnscrypt-proxy -- -p ${pidfile} -l ${DNSCRYPT_LOGFILE} -d -u ${runas_group} -a ${DNSCRYPT_LOCALADDRESS} ${OPTIONS} eend $? } diff --git a/packages/gentoo/net-dns/dnscrypt-proxy/files/dnscrypt-proxy_1_4_0.confd b/packages/gentoo/net-dns/dnscrypt-proxy/files/dnscrypt-proxy_1_4_0.confd new file mode 100644 index 00000000..0377eccd --- /dev/null +++ b/packages/gentoo/net-dns/dnscrypt-proxy/files/dnscrypt-proxy_1_4_0.confd @@ -0,0 +1,2 @@ +DNSCRYPT_PROVIDER_NAME=opennic-us-ca-ns17 +DNSCRYPT_LOCALADDRESS=127.0.0.1:53 diff --git a/packages/gentoo/net-dns/dnscrypt-proxy/files/dnscrypt-proxy_1_4_0.initd b/packages/gentoo/net-dns/dnscrypt-proxy/files/dnscrypt-proxy_1_4_0.initd new file mode 100755 index 00000000..7c8d4bcf --- /dev/null +++ b/packages/gentoo/net-dns/dnscrypt-proxy/files/dnscrypt-proxy_1_4_0.initd @@ -0,0 +1,56 @@ +#!/sbin/runscript + +DNSCRYPT_LOGFILE=${DNSCRYPT_LOGFILE:-/var/log/dnscrypt-proxy.log} + +OPTIONS=" " +if [ -n "$DNSCRYPT_LOGLEVEL" ]; then + OPTIONS="${OPTIONS} --loglevel=${DNSCRYPT_LOGLEVEL}" +fi +if [ -n "$DNSCRYPT_PROVIDER_KEY" ]; then + OPTIONS="${OPTIONS} --provider-key=${DNSCRYPT_PROVIDER_KEY}" +fi + +if [ -n "$DNSCRYPT_PROVIDER_NAME" ]; then + OPTIONS="${OPTIONS} --provider-name=${DNSCRYPT_PROVIDER_NAME}" +fi + +if [ -n "$DNSCRYPT_PROVIDER_ADDRESS" ]; then + OPTIONS="${OPTIONS} --resolver-address=${DNSCRYPT_PROVIDER_ADDRESS}" +fi + +if [ -n "$DNSCRYPT_PROVIDER_NAME" ]; then + OPTIONS="${OPTIONS} --resolver-name=${DNSCRYPT_PROVIDER_NAME}" +fi + +rundir=${rundir:-/run/dnscrypt-proxy} +pidfile=${pidfile:-${rundir}/dnscrypt-proxy.pid} +runas_user=${runas_user:-dnscrypt} +runas_group=${runas_user:-dnscrypt} + +depend() { + use net + before dns + after logger +} + +start() { + + if [ ! -d "${rundir}" ]; then + mkdir "${rundir}" + if [ -n "${runas_user}" ]; then + touch ${DNSCRYPT_LOGFILE} + chown ${runas_user}:${runas_group} ${DNSCRYPT_LOGFILE} + chown -R ${runas_user}:${runas_group} "${rundir}" + fi + fi + + ebegin "Starting dnscrypt-proxy" + start-stop-daemon --start --pidfile=${pidfile} --exec /usr/sbin/dnscrypt-proxy -- -p ${pidfile} -l ${DNSCRYPT_LOGFILE} -d -u ${runas_group} -a ${DNSCRYPT_LOCALADDRESS} ${OPTIONS} + eend $? +} + +stop() { + ebegin "Stopping dnscrypt-proxy" + start-stop-daemon --stop --quiet --exec /usr/sbin/dnscrypt-proxy + eend $? +} diff --git a/packages/gentoo/net-dns/dnscrypt-proxy/metadata.xml b/packages/gentoo/net-dns/dnscrypt-proxy/metadata.xml new file mode 100644 index 00000000..94b9d210 --- /dev/null +++ b/packages/gentoo/net-dns/dnscrypt-proxy/metadata.xml @@ -0,0 +1,11 @@ + + + + + teknocratdefunct@riseup.net + Harvey Mittens + + + Add support for plugins interface + + diff --git a/packages/homebrew/dnscrypt-proxy.rb b/packages/homebrew/dnscrypt-proxy.rb deleted file mode 100644 index b800580a..00000000 --- a/packages/homebrew/dnscrypt-proxy.rb +++ /dev/null @@ -1,28 +0,0 @@ -require 'formula' - -class DnscryptProxy < Formula - homepage 'http://dnscrypt.org' - url 'http://download.dnscrypt.org/dnscrypt-proxy/dnscrypt-proxy-1.2.0.tar.gz' - head 'https://github.com/opendns/dnscrypt-proxy.git', :branch => 'master' - sha256 '02ae6360887995d73d4c02ea7fa0cc8cad4a4de61f89c2fd68674a65f427b333' - - if build.head? - depends_on :automake - depends_on :libtool - end - - option "plugins", "Support plugins and install example plugins." - - def install - system "autoreconf", "-if" if build.head? - - configure_args = [ "--prefix=#{prefix}", "--disable-dependency-tracking" ] - if build.include? "plugins" - configure_args << "--enable-plugins" - configure_args << "--enable-plugins-root" - configure_args << "--enable-relaxed-plugins-permissions" - end - system "./configure", *configure_args - system "make install" - end -end diff --git a/packages/opensuse/dnscrypt.changes b/packages/opensuse/dnscrypt.changes deleted file mode 100644 index 8dbb31d5..00000000 --- a/packages/opensuse/dnscrypt.changes +++ /dev/null @@ -1,25 +0,0 @@ -------------------------------------------------------------------- -Tue Oct 23 16:58:22 UTC 2012 - i@marguerite.su - -- fix a hang bug in dnscrypt.service -- upstream clarify license, it's BSD. - -------------------------------------------------------------------- -Sun Oct 21 18:28:26 UTC 2012 - i@marguerite.su - -- add systemd service. - -------------------------------------------------------------------- -Sun Oct 21 12:57:13 UTC 2012 - i@marguerite.su - -- Version 1.2.0: - * A pre-filter can now totally bypass the resolver and directly send a - reply to the client. - * A new example plugin has been shipped: ldns-aaaa-blocking. It - directly sends an empty response to AAAA queries in order to - significantly speed up lookups on hosts without IPv6 connectivity - (but with clients still asking for AAAA records anyway). - * Example plugins requiring ldns can be compiled on Windows. - * Paths with a drive name are now recognized as absolute paths on - Windows. - diff --git a/packages/opensuse/dnscrypt.service b/packages/opensuse/dnscrypt.service deleted file mode 100644 index 4d852a34..00000000 --- a/packages/opensuse/dnscrypt.service +++ /dev/null @@ -1,27 +0,0 @@ -# This file is part of dnscrypt -# Author: Marguerite Su with some AUR reference. -# Version: 1.2.0 -# Description: dnscrypt is a tool that encrypts your DNS queries in order to -# protect against man-in-the-middle attacks and DNS hijacking -# (commonly seen in China). It uses OpenDNS resolvers by default. -# It is BSD-licensed. -# In openSUSE it's licensed under SuSE-Permissive (non-free ware). -# For details, refer to its documentation. -[Unit] -Description=Secure connection between your computer and a DNS resolver -After=network.target ntp.service -# Ntp always has local servers, and there's nothing to encrypt for time. -# and ntp.service isn't native systemd service, if we start before it, -# it will take a long time to sync. just save 20000+ms on boot. - -[Service] -Type=forking -PIDFile=/var/run/dnscrypt-proxy.pid -ExecStart=/usr/sbin/dnscrypt-proxy --daemonize \ - -p /var/run/dnscrypt-proxy.pid \ - -l /var/log/dnscrypt-proxy.log -# Automatically Restart -Restart=on-abort - -[Install] -WantedBy=multi-user.target diff --git a/packages/opensuse/dnscrypt.spec b/packages/opensuse/dnscrypt.spec deleted file mode 100644 index 9d8187bc..00000000 --- a/packages/opensuse/dnscrypt.spec +++ /dev/null @@ -1,82 +0,0 @@ -# -# spec file for package dnscrypt -# -# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany. -# -# All modifications and additions to the file contributed by third parties -# remain the property of their copyright owners, unless otherwise agreed -# upon. The license for this file, and modifications and additions to the -# file, is the same license as for the pristine package itself (unless the -# license for the pristine package is not an Open Source License, in which -# case the license is the MIT License). An "Open Source License" is a -# license that conforms to the Open Source Definition (Version 1.9) -# published by the Open Source Initiative. - -# Please submit bugfixes or comments via http://bugs.opensuse.org/ -# - -Name: dnscrypt -Version: 1.2.0 -Release: 0 -License: BSD-3-Clause -Summary: A tool for securing communications between a client and a DNS resolver -Url: http://dnscrypt.org -Group: Productivity/Networking/DNS/Utilities -Source: %{name}-proxy-%{version}.tar.bz2 -Source1: %{name}.service -%if 0%{?suse_version} >= 1210 -BuildRequires: systemd -%{?systemd_requires} -%endif -BuildRoot: %{_tmppath}/%{name}-%{version}-build - -%description -dnscrypt-proxy provides local service which can be used directly as your local resolver or as a DNS forwarder, -encrypting and authenticating requests using the DNSCrypt protocol and passing them to an upstream server, -by default OpenDNS who run this on their resolvers. - -The DNSCrypt protocol uses high-speed high-security elliptic-curve cryptography and is very similar to -DNSCurve, but focuses on securing communications between a client and its first-level resolver. - -While not providing end-to-end security, it protects the local network, which is often the weakest point -of the chain, against man-in-the-middle attacks. It also provides some confidentiality to DNS queries. - -%prep -%setup -q -n %{name}-proxy-%{version} - -%build -%configure -make %{?_smp_mflags} - -%install -%make_install - -# install systemd service -mkdir -p %{buildroot}%{_unitdir} -cp -r %{SOURCE1} %{buildroot}%{_unitdir} - -%if 0%{?suse_version} -%pre -%service_add_pre %{name}.service - -%post -%service_add_post %{name}.service - -%preun -%service_del_preun %{name}.service - -%postun -%service_del_postun %{name}.service -%endif - -%files -%defattr(-,root,root) -%doc AUTHORS ChangeLog README COPYING NEWS TECHNOTES THANKS -%{_bindir}/hostip -%{_sbindir}/%{name}-proxy -%{_unitdir}/%{name}.service -%{_mandir}/man8/hostip.8.gz -%{_mandir}/man8/%{name}-proxy.8.gz - -%changelog - diff --git a/packages/pkgsrc/net/dnscrypt-proxy/DESCR b/packages/pkgsrc/net/dnscrypt-proxy/DESCR deleted file mode 100644 index 2820dcac..00000000 --- a/packages/pkgsrc/net/dnscrypt-proxy/DESCR +++ /dev/null @@ -1,17 +0,0 @@ -DNSCrypt is a slight variation on DNSCurve. - -DNSCurve improves confidentiality and integrity of DNS requests using -high-speed high-security elliptic-curve cryptography. Best of all, -DNSCurve has a very low overhead and adds virtually no latency to -queries. - -DNSCurve aims at securing the entiere chain down to authoritative -servers. But it only works with authoritative servers that explicitly -support the protocol. - -The DNSCrypt protocol is very similar to DNSCurve, but focuses on -securing communications between a client and its first-level resolver. -While not providing end-to-end security, it protects the local -network, which is often the weakest point of the chain, against -man-in-the-middle attacks. It also provides some confidentiality to -DNS queries. diff --git a/packages/pkgsrc/net/dnscrypt-proxy/MESSAGE b/packages/pkgsrc/net/dnscrypt-proxy/MESSAGE deleted file mode 100644 index 6d583d25..00000000 --- a/packages/pkgsrc/net/dnscrypt-proxy/MESSAGE +++ /dev/null @@ -1,10 +0,0 @@ -In order to perform queries over DNSCrypt, using OpenDNS as a -resolver, the easiest way is change your /etc/resolv.conf file to: - -nameserver 127.0.0.1 -lookup file bind -options edns0 - -But DNSCrypt does _not_ cache queries. So the recommended way to use -it is as a forwarder for a DNS cache like Unbound. -Both can safely run on the same host. diff --git a/packages/pkgsrc/net/dnscrypt-proxy/Makefile b/packages/pkgsrc/net/dnscrypt-proxy/Makefile deleted file mode 100644 index b9e02780..00000000 --- a/packages/pkgsrc/net/dnscrypt-proxy/Makefile +++ /dev/null @@ -1,29 +0,0 @@ - -DISTNAME= dnscrypt-proxy-1.1.0 -CATEGORIES= net -MASTER_SITES= http://download.dnscrypt.org/dnscrypt-proxy/ - -MAINTAINER= dnscrypt@pureftpd.org -HOMEPAGE= http://dnscrypt.org -COMMENT= secure communications between a client and a DNS resolver -LICENSE= modified-bsd - -PKG_DESTDIR_SUPPORT= user-destdir - -GNU_CONFIGURE= yes -CONFIGURE_ARGS+= --sysconfdir=${PKG_SYSCONFDIR} -CONFIGURE_ARGS+= --localstatedir=${VARBASE} - -BUILD_DEFS+= VARBASE - -.include "../../mk/bsd.prefs.mk" - -RCD_SCRIPTS= dnscrypt_proxy -INSTALLATION_DIRS= share/doc/dnscrypt-proxy - -post-install: - cd ${WRKSRC} && \ - ${INSTALL_DATA} README.markdown \ - ${DESTDIR}${PREFIX}/share/doc/dnscrypt-proxy - -.include "../../mk/bsd.pkg.mk" diff --git a/packages/pkgsrc/net/dnscrypt-proxy/PLIST b/packages/pkgsrc/net/dnscrypt-proxy/PLIST deleted file mode 100644 index 57bf7044..00000000 --- a/packages/pkgsrc/net/dnscrypt-proxy/PLIST +++ /dev/null @@ -1,8 +0,0 @@ -@comment $NetBSD$ -bin/hostip -sbin/dnscrypt-proxy -man/man8/dnscrypt-proxy.8 -man/man8/hostip.8 -share/doc/dnscrypt-proxy/README.markdown -share/examples/rc.d/dnscrypt_proxy - diff --git a/packages/pkgsrc/net/dnscrypt-proxy/distinfo b/packages/pkgsrc/net/dnscrypt-proxy/distinfo deleted file mode 100644 index a1ad9fb9..00000000 --- a/packages/pkgsrc/net/dnscrypt-proxy/distinfo +++ /dev/null @@ -1,5 +0,0 @@ -$NetBSD$ - -SHA1 (dnscrypt-proxy-1.1.0.tar.gz) = dca837481dbd6903f7a4eb212cc6189e41299e78 -RMD160 (dnscrypt-proxy-1.1.0.tar.gz) = 274f09132d46ffc1f2ebff1cff6aa99e2c587143 -Size (dnscrypt-proxy-1.0.tar.gz) = 1720324 bytes diff --git a/packages/pkgsrc/net/dnscrypt-proxy/files/dnscrypt_proxy.sh b/packages/pkgsrc/net/dnscrypt-proxy/files/dnscrypt_proxy.sh deleted file mode 100755 index 1f3c9bf0..00000000 --- a/packages/pkgsrc/net/dnscrypt-proxy/files/dnscrypt_proxy.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!@RCD_SCRIPTS_SHELL@ -# -# PROVIDE: dnscrypt_proxy -# REQUIRE: DAEMON - -. /etc/rc.subr - -name="dnscrypt_proxy" -help_name="dnscrypt-proxy" -rcvar=$name -command="@PREFIX@/sbin/${help_name}" -pidfile="@VARBASE@/run/${help_name}.pid" -command_args="--daemonize --pidfile={$pidfile}" - -load_rc_config $name -run_rc_command "$1" diff --git a/src/Makefile.am b/src/Makefile.am index 247a509d..d4a2a5fa 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,8 +1,7 @@ SUBDIRS = \ ext \ - libevent \ - libnacl \ + libevent-modified \ proxy \ hostip diff --git a/src/hostip/Makefile.am b/src/hostip/Makefile.am index 3127de82..43791b6a 100644 --- a/src/hostip/Makefile.am +++ b/src/hostip/Makefile.am @@ -11,8 +11,8 @@ hostip_SOURCES = \ AM_CFLAGS = @CWFLAGS@ AM_CPPFLAGS = \ - -I../libevent/include + -I../libevent-modified/include hostip_LDADD = \ - ../libevent/libevent_extra.la \ - ../libevent/libevent_core.la + ../libevent-modified/libevent_extra.la \ + ../libevent-modified/libevent_core.la diff --git a/src/hostip/options.c b/src/hostip/options.c index 5aa85cbe..a8044f94 100644 --- a/src/hostip/options.c +++ b/src/hostip/options.c @@ -11,7 +11,7 @@ #include "options.h" #ifndef DEFAULT_RESOLVER_IP -# define DEFAULT_RESOLVER_IP "208.67.220.220" +# define DEFAULT_RESOLVER_IP "8.8.8.8" #endif static struct option getopt_long_options[] = { @@ -26,8 +26,7 @@ static const char *getopt_options = "6hr:V"; static void options_version(void) { - puts("hostip v" PACKAGE_VERSION "\n" - "Copyright (C) 2012 OpenDNS, Inc."); + puts("hostip v" PACKAGE_VERSION); } static void @@ -36,10 +35,10 @@ options_usage(void) puts("Usage: hostip [-6] [-r resolver_ip[:port]] host_name\n" " -6, --ipv6: ask for AAAA records\n" " -h, --help: show usage\n" - " -r, --resolver-address=: the resolver IP address (default: OpenDNS)\n" + " -r, --resolver-address=: the resolver IP address\n" " -V, --version: show version number\n" "\n" - "Example: hostip -r 208.67.222.222 www.example.com\n"); + "Example: hostip www.example.com\n"); } static diff --git a/src/libevent/ChangeLog b/src/libevent-modified/ChangeLog similarity index 96% rename from src/libevent/ChangeLog rename to src/libevent-modified/ChangeLog index 80a0970e..8c0a9f8c 100644 --- a/src/libevent/ChangeLog +++ b/src/libevent-modified/ChangeLog @@ -1,4 +1,65 @@ -Changes in version 2.0.22-stable (?? ??? 201?) +Changes in version 2.0.22-stable (5 Jan 2015) + +SECURITY FIXES (evbuffers) + o Avoid integer overflow bugs in evbuffer_add() and related functions. See CVE-2014-6272 advisory for more information. (20d6d4458bee5d88bda1511c225c25b2d3198d6c) + +BUGFIXES (evhttp) + o fix #73 and fix http_connection_fail_test to catch it (crash fix) (b618204 Greg Hazel) + o Avoid racy bufferevent activation (5eb1788 Nate Rosenblum) + +BUGFIXES (compilation and portability) + o Fix compilation with WIN32_HAVE_CONDITION_VARIABLES enabled (7e45739) + o Fix missing AC_PROG_SED on older Autoconfs (9ab2b3f Tay Ray Chuan) + o Backport libevent to vanilla Autoconf 2.59 (as used in RHEL5) (74d4c44 Kevin Bowling) + o Use AC_CONFIG_HEADERS in place of AM_CONFIG_HEADERS for autmake 1.13 compat (817ea36) + o Rename configure.in to configure.ac to appease newer autoconfs (0c79787) + o Avoid using top_srcdir in TESTS: new automakes do not like this (a55514e) + o Use windows vsnprintf fixup logic on all windows environments (e826f19) + o Fix a compiler warning when checking for arc4random_buf linker breakage. (5cb3865) + o Fix another arc4random_buf-related warning (e64a2b0) + o Add -Qunused-arguments for clang on macos (b56611d Trond Norbye) + +BUGFIXES (resource leaks/lock errors on error) + o Avoid leaking fds on evconnlistener with no callback set (69db261) + o Avoid double-close on getsockname error in evutil_ersatz_socketpair (0a822a6) + o Fix a locking error in bufferevent_socket_get_dns_error. (0a5eb2e) + o libevent/win32_dealloc() : fix sizeof(pointer) vs sizeof(*pointer) (b8f5980 Frank Denis) + +BUGFIXES: (other stability) + o bufferevent_pair: don't call downcast(NULL) (f2428a2) + o Consistently check for failure from evbuffer_pullup() (60f8f72) + o Fix race caused by event_active (3c7d6fc vjpai) + +BUGFIXES (miscellaneous) + o Avoid redundant invocations of init_extension_functions for IOCP (3b77d62) + o Typo fixes from Linus Nordberg (cec62cb, 8cd695b) + o Add a few files created by "make verify" to .gitignore. (1a8295a Pierre Phaneuf) + o regress_buffer: fix 'memcmp' compare size (79800df Maks Naumov) + o Fix bufferevent setwatermark suspend_read (b34e4ac ufo2243) + o Fix evbuffer_peek() with len==-1 and start_at non-NULL. (fb7e76a) + +BUFGIXES (evdns) + o Checking request nameserver for NULL, before using it. (5c710c0 Belobrov Andrey) + o Fix SEGFAULT after evdns_base_resume if no nameservers installed. (f8d7df8 Azat Khuzhin) + o Fix a crash in evdns related to shutting down evdns (9f39c88,e8fe749) + +BUGFIXES (epoll) + o Check does arch have the epoll_create and __NR_epoll_wait syscalls. (dfe1e52 Marcin Juszkiewicz) + +BUGFIXES (evutil_secure_random) + o Avoid other RNG initialization FS reads when urandom file is specified (9695e9c, bb52471) + o When we seed from /proc/sys/kernel/random/uuid, count it as success (e35b540) + o Document that arc4random is not a great cryptographic PRNG. (6e49696) + o Add evutil_secure_rng_set_urandom_device_file (2bbb5d7) + o Really remove RNG seeds from the stack (f5ced88) + + +DOCUMENTATION FIXES + o Fix a mistake in evbuffer_remove() arguments in example http server code (c322c20 Gyepi Sam) + o Fix a typo in a comment in buffer.h. Spotted by Alt_F4 (773b0a5) + o Clarify event_base_loop exit conditions (031a803) + o Use FindClose for handle from FindFirstFile in http-server.c (6466e88) + o Fix a typo in a doxygen comment. Reported by 亦得. (be1aeff) Changes in version 2.0.21-stable (18 Nov 2012) diff --git a/src/libevent/Doxyfile b/src/libevent-modified/Doxyfile similarity index 100% rename from src/libevent/Doxyfile rename to src/libevent-modified/Doxyfile diff --git a/src/libevent/LICENSE b/src/libevent-modified/LICENSE similarity index 100% rename from src/libevent/LICENSE rename to src/libevent-modified/LICENSE diff --git a/src/libevent/Makefile.am b/src/libevent-modified/Makefile.am similarity index 98% rename from src/libevent/Makefile.am rename to src/libevent-modified/Makefile.am index 42879a31..75e376dc 100644 --- a/src/libevent/Makefile.am +++ b/src/libevent-modified/Makefile.am @@ -38,7 +38,7 @@ RELEASE = -release 2.0 # # Once an RC is out, DO NOT MAKE ANY ABI-BREAKING CHANGES IN THAT SERIES # UNLESS YOU REALLY REALLY HAVE TO. -VERSION_INFO = 6:9:1 +VERSION_INFO = 6:10:1 # History: RELEASE VERSION_INFO # 2.0.1-alpha -- 2.0 1:0:0 @@ -62,6 +62,7 @@ VERSION_INFO = 6:9:1 # 2.0.19-stable-- 2.0 6:7:1 (No ABI change) # 2.0.20-stable-- 2.0 6:8:1 (No ABI change) # 2.0.21-stable-- 2.0 6:9:1 (No ABI change) +# 2.0.22-stable-- 2.0 6:10:1 (No ABI change) # # For Libevent 2.1: # 2.1.1-alpha -- 2.1 1:0:0 diff --git a/src/libevent/Makefile.nmake b/src/libevent-modified/Makefile.nmake similarity index 100% rename from src/libevent/Makefile.nmake rename to src/libevent-modified/Makefile.nmake diff --git a/src/libevent/README b/src/libevent-modified/README similarity index 100% rename from src/libevent/README rename to src/libevent-modified/README diff --git a/src/libevent/WIN32-Code/event2/event-config.h b/src/libevent-modified/WIN32-Code/event2/event-config.h similarity index 99% rename from src/libevent/WIN32-Code/event2/event-config.h rename to src/libevent-modified/WIN32-Code/event2/event-config.h index da8c23ac..2ef93245 100644 --- a/src/libevent/WIN32-Code/event2/event-config.h +++ b/src/libevent-modified/WIN32-Code/event2/event-config.h @@ -277,7 +277,7 @@ /* #undef _EVENT_HAVE_WORKING_KQUEUE */ /* Numeric representation of the version */ -#define _EVENT_NUMERIC_VERSION 0x02001501 +#define _EVENT_NUMERIC_VERSION 0x02001600 /* Name of package */ #define _EVENT_PACKAGE "libevent" @@ -334,7 +334,7 @@ #define _EVENT_TIME_WITH_SYS_TIME 1 /* Version number of package */ -#define _EVENT_VERSION "2.0.21-stable-dev" +#define _EVENT_VERSION "2.0.22-stable" /* Define to appropriate substitue if compiler doesnt have __func__ */ #define _EVENT___func__ __FUNCTION__ diff --git a/src/libevent/WIN32-Code/tree.h b/src/libevent-modified/WIN32-Code/tree.h similarity index 100% rename from src/libevent/WIN32-Code/tree.h rename to src/libevent-modified/WIN32-Code/tree.h diff --git a/src/libevent/arc4random.c b/src/libevent-modified/arc4random.c similarity index 99% rename from src/libevent/arc4random.c rename to src/libevent-modified/arc4random.c index c2185657..2a49de6d 100644 --- a/src/libevent/arc4random.c +++ b/src/libevent-modified/arc4random.c @@ -297,6 +297,7 @@ arc4_seed_proc_sys_kernel_random_uuid(void) } arc4random_memzero(entropy, sizeof(entropy)); arc4random_memzero(buf, sizeof(buf)); + arc4_seeded_ok = 1; return 0; } #endif @@ -399,6 +400,7 @@ arc4_stir(void) */ for (i = 0; i < 12*256; i++) (void)arc4_getbyte(); + arc4_count = BYTES_BEFORE_RESEED; return 0; diff --git a/src/libevent/autogen.sh b/src/libevent-modified/autogen.sh similarity index 100% rename from src/libevent/autogen.sh rename to src/libevent-modified/autogen.sh diff --git a/src/libevent/buffer.c b/src/libevent-modified/buffer.c similarity index 96% rename from src/libevent/buffer.c rename to src/libevent-modified/buffer.c index 2091e552..f1264f1c 100644 --- a/src/libevent/buffer.c +++ b/src/libevent-modified/buffer.c @@ -159,12 +159,20 @@ evbuffer_chain_new(size_t size) struct evbuffer_chain *chain; size_t to_alloc; + if (size > EVBUFFER_CHAIN_MAX - EVBUFFER_CHAIN_SIZE) + return (NULL); + size += EVBUFFER_CHAIN_SIZE; /* get the next largest memory that can hold the buffer */ - to_alloc = MIN_BUFFER_SIZE; - while (to_alloc < size) - to_alloc <<= 1; + if (size < EVBUFFER_CHAIN_MAX / 2) { + to_alloc = MIN_BUFFER_SIZE; + while (to_alloc < size) { + to_alloc <<= 1; + } + } else { + to_alloc = size; + } /* we get everything in one chunk */ if ((chain = mm_malloc(to_alloc)) == NULL) @@ -1004,6 +1012,7 @@ evbuffer_drain(struct evbuffer *buf, size_t len) buf->first = chain; if (chain) { + EVUTIL_ASSERT(remaining <= chain->off); chain->misalign += remaining; chain->off -= remaining; } @@ -1070,6 +1079,7 @@ evbuffer_copyout(struct evbuffer *buf, void *data_out, size_t datlen) if (datlen) { EVUTIL_ASSERT(chain); + EVUTIL_ASSERT(datlen <= chain->off); memcpy(data, chain->buffer + chain->misalign, datlen); } @@ -1545,6 +1555,10 @@ evbuffer_add(struct evbuffer *buf, const void *data_in, size_t datlen) if (buf->freeze_end) { goto done; } + /* Prevent buf->total_len overflow */ + if (datlen > EV_SIZE_MAX - buf->total_len) { + goto done; + } chain = buf->last; @@ -1558,7 +1572,10 @@ evbuffer_add(struct evbuffer *buf, const void *data_in, size_t datlen) } if ((chain->flags & EVBUFFER_IMMUTABLE) == 0) { - remain = (size_t)(chain->buffer_len - chain->misalign - chain->off); + /* Always true for mutable buffers */ + EVUTIL_ASSERT(chain->misalign >= 0 && + (ev_uint64_t)chain->misalign <= EVBUFFER_CHAIN_MAX); + remain = chain->buffer_len - (size_t)chain->misalign - chain->off; if (remain >= datlen) { /* there's enough space to hold all the data in the * current last chain */ @@ -1629,6 +1646,9 @@ evbuffer_prepend(struct evbuffer *buf, const void *data, size_t datlen) if (buf->freeze_start) { goto done; } + if (datlen > EV_SIZE_MAX - buf->total_len) { + goto done; + } chain = buf->first; @@ -1641,6 +1661,10 @@ evbuffer_prepend(struct evbuffer *buf, const void *data, size_t datlen) /* we cannot touch immutable buffers */ if ((chain->flags & EVBUFFER_IMMUTABLE) == 0) { + /* Always true for mutable buffers */ + EVUTIL_ASSERT(chain->misalign >= 0 && + (ev_uint64_t)chain->misalign <= EVBUFFER_CHAIN_MAX); + /* If this chain is empty, we can treat it as * 'empty at the beginning' rather than 'empty at the end' */ if (chain->off == 0) @@ -1678,6 +1702,7 @@ evbuffer_prepend(struct evbuffer *buf, const void *data, size_t datlen) tmp->next = chain; tmp->off = datlen; + EVUTIL_ASSERT(datlen <= tmp->buffer_len); tmp->misalign = tmp->buffer_len - datlen; memcpy(tmp->buffer + tmp->misalign, data, datlen); @@ -1776,7 +1801,9 @@ evbuffer_expand_singlechain(struct evbuffer *buf, size_t datlen) /* Would expanding this chunk be affordable and worthwhile? */ if (CHAIN_SPACE_LEN(chain) < chain->buffer_len / 8 || - chain->off > MAX_TO_COPY_IN_EXPAND) { + chain->off > MAX_TO_COPY_IN_EXPAND || + (datlen < EVBUFFER_CHAIN_MAX && + EVBUFFER_CHAIN_MAX - datlen >= chain->off)) { /* It's not worth resizing this chain. Can the next one be * used? */ if (chain->next && CHAIN_SPACE_LEN(chain->next) >= datlen) { @@ -1904,6 +1931,8 @@ _evbuffer_expand_fast(struct evbuffer *buf, size_t datlen, int n) rmv_all = 1; avail = 0; } else { + /* can't overflow, since only mutable chains have + * huge misaligns. */ avail = (size_t) CHAIN_SPACE_LEN(chain); chain = chain->next; } @@ -1914,6 +1943,7 @@ _evbuffer_expand_fast(struct evbuffer *buf, size_t datlen, int n) EVUTIL_ASSERT(chain->off == 0); evbuffer_chain_free(chain); } + EVUTIL_ASSERT(datlen >= avail); tmp = evbuffer_chain_new(datlen - avail); if (tmp == NULL) { if (rmv_all) { @@ -2043,6 +2073,7 @@ get_n_bytes_readable_on_socket(evutil_socket_t fd) unsigned long lng = EVBUFFER_MAX_READ; if (ioctlsocket(fd, FIONREAD, &lng) < 0) return -1; + /* Can overflow, but mostly harmlessly. XXXX */ return (int)lng; #elif defined(FIONREAD) int n = EVBUFFER_MAX_READ; @@ -2155,8 +2186,14 @@ evbuffer_read(struct evbuffer *buf, evutil_socket_t fd, int howmuch) #ifdef USE_IOVEC_IMPL remaining = n; for (i=0; i < nvecs; ++i) { - ev_ssize_t space = (ev_ssize_t) CHAIN_SPACE_LEN(*chainp); - if (space < remaining) { + /* can't overflow, since only mutable chains have + * huge misaligns. */ + size_t space = (size_t) CHAIN_SPACE_LEN(*chainp); + /* XXXX This is a kludge that can waste space in perverse + * situations. */ + if (space > EVBUFFER_CHAIN_MAX) + space = EVBUFFER_CHAIN_MAX; + if ((ev_ssize_t)space < remaining) { (*chainp)->off += space; remaining -= (int)space; } else { @@ -2365,9 +2402,11 @@ evbuffer_write_atmost(struct evbuffer *buffer, evutil_socket_t fd, /* XXX(nickm) Don't disable this code until we know if * the WSARecv code above works. */ void *p = evbuffer_pullup(buffer, howmuch); + EVUTIL_ASSERT(p || !howmuch); n = send(fd, p, howmuch, 0); #else void *p = evbuffer_pullup(buffer, howmuch); + EVUTIL_ASSERT(p || !howmuch); n = write(fd, p, howmuch); #endif #ifdef USE_SENDFILE @@ -2427,12 +2466,17 @@ evbuffer_ptr_set(struct evbuffer *buf, struct evbuffer_ptr *pos, case EVBUFFER_PTR_ADD: /* this avoids iterating over all previous chains if we just want to advance the position */ + if (pos->pos < 0 || EV_SIZE_MAX - position < (size_t)pos->pos) { + EVBUFFER_UNLOCK(buf); + return -1; + } chain = pos->_internal.chain; pos->pos += position; position = pos->_internal.pos_in_chain; break; } + EVUTIL_ASSERT(EV_SIZE_MAX - left >= position); while (chain && position + left >= chain->off) { left -= chain->off - position; chain = chain->next; @@ -2465,7 +2509,9 @@ evbuffer_ptr_memcmp(const struct evbuffer *buf, const struct evbuffer_ptr *pos, ASSERT_EVBUFFER_LOCKED(buf); - if (pos->pos + len > buf->total_len) + if (pos->pos < 0 || + EV_SIZE_MAX - len < (size_t)pos->pos || + pos->pos + len > buf->total_len) return -1; chain = pos->_internal.chain; @@ -2589,7 +2635,10 @@ evbuffer_peek(struct evbuffer *buffer, ev_ssize_t len, if (n_vec == 0 && len < 0) { /* If no vectors are provided and they asked for "everything", * pretend they asked for the actual available amount. */ - len = buffer->total_len - len_so_far; + len = buffer->total_len; + if (start_at) { + len -= start_at->pos; + } } while (chain) { @@ -2653,6 +2702,9 @@ evbuffer_add_vprintf(struct evbuffer *buf, const char *fmt, va_list ap) if (sz < 0) goto done; + if (INT_MAX >= EVBUFFER_CHAIN_MAX && + (size_t)sz >= EVBUFFER_CHAIN_MAX) + goto done; if ((size_t)sz < space) { chain->off += sz; buf->total_len += sz; @@ -2746,6 +2798,11 @@ evbuffer_add_file(struct evbuffer *outbuf, int fd, #endif int ok = 1; + if (offset < 0 || length < 0 || + ((ev_uint64_t)length > EVBUFFER_CHAIN_MAX) || + (ev_uint64_t)offset > (ev_uint64_t)(EVBUFFER_CHAIN_MAX - length)) + return (-1); + #if defined(USE_SENDFILE) if (use_sendfile) { EVBUFFER_LOCK(outbuf); @@ -2851,7 +2908,8 @@ evbuffer_add_file(struct evbuffer *outbuf, int fd, * can abort without side effects if the read fails. */ while (length) { - read = evbuffer_readfile(tmp, fd, (ev_ssize_t)length); + ev_ssize_t to_read = length > EV_SSIZE_MAX ? EV_SSIZE_MAX : (ev_ssize_t)length; + read = evbuffer_readfile(tmp, fd, to_read); if (read == -1) { evbuffer_free(tmp); return (-1); diff --git a/src/libevent/buffer_iocp.c b/src/libevent-modified/buffer_iocp.c similarity index 100% rename from src/libevent/buffer_iocp.c rename to src/libevent-modified/buffer_iocp.c diff --git a/src/libevent/bufferevent-internal.h b/src/libevent-modified/bufferevent-internal.h similarity index 100% rename from src/libevent/bufferevent-internal.h rename to src/libevent-modified/bufferevent-internal.h diff --git a/src/libevent/bufferevent.c b/src/libevent-modified/bufferevent.c similarity index 99% rename from src/libevent/bufferevent.c rename to src/libevent-modified/bufferevent.c index 45a1437e..7518c3b1 100644 --- a/src/libevent/bufferevent.c +++ b/src/libevent-modified/bufferevent.c @@ -545,7 +545,7 @@ bufferevent_setwatermark(struct bufferevent *bufev, short events, bufev_private->read_watermarks_cb, EVBUFFER_CB_ENABLED|EVBUFFER_CB_NODEFER); - if (evbuffer_get_length(bufev->input) > highmark) + if (evbuffer_get_length(bufev->input) >= highmark) bufferevent_wm_suspend_read(bufev); else if (evbuffer_get_length(bufev->input) < highmark) bufferevent_wm_unsuspend_read(bufev); diff --git a/src/libevent/bufferevent_async.c b/src/libevent-modified/bufferevent_async.c similarity index 100% rename from src/libevent/bufferevent_async.c rename to src/libevent-modified/bufferevent_async.c diff --git a/src/libevent/bufferevent_filter.c b/src/libevent-modified/bufferevent_filter.c similarity index 100% rename from src/libevent/bufferevent_filter.c rename to src/libevent-modified/bufferevent_filter.c diff --git a/src/libevent/bufferevent_openssl.c b/src/libevent-modified/bufferevent_openssl.c similarity index 100% rename from src/libevent/bufferevent_openssl.c rename to src/libevent-modified/bufferevent_openssl.c diff --git a/src/libevent/bufferevent_pair.c b/src/libevent-modified/bufferevent_pair.c similarity index 98% rename from src/libevent/bufferevent_pair.c rename to src/libevent-modified/bufferevent_pair.c index 6ec5cac8..e9ed9f59 100644 --- a/src/libevent/bufferevent_pair.c +++ b/src/libevent-modified/bufferevent_pair.c @@ -310,13 +310,14 @@ struct bufferevent * bufferevent_pair_get_partner(struct bufferevent *bev) { struct bufferevent_pair *bev_p; - struct bufferevent *partner; + struct bufferevent *partner = NULL; bev_p = upcast(bev); if (! bev_p) return NULL; incref_and_lock(bev); - partner = downcast(bev_p->partner); + if (bev_p->partner) + partner = downcast(bev_p->partner); decref_and_unlock(bev); return partner; } diff --git a/src/libevent/bufferevent_ratelim.c b/src/libevent-modified/bufferevent_ratelim.c similarity index 100% rename from src/libevent/bufferevent_ratelim.c rename to src/libevent-modified/bufferevent_ratelim.c diff --git a/src/libevent/bufferevent_sock.c b/src/libevent-modified/bufferevent_sock.c similarity index 99% rename from src/libevent/bufferevent_sock.c rename to src/libevent-modified/bufferevent_sock.c index 19e90d5a..9b0caf24 100644 --- a/src/libevent/bufferevent_sock.c +++ b/src/libevent-modified/bufferevent_sock.c @@ -515,7 +515,7 @@ bufferevent_socket_get_dns_error(struct bufferevent *bev) BEV_LOCK(bev); rv = bev_p->dns_error; - BEV_LOCK(bev); + BEV_UNLOCK(bev); return rv; } diff --git a/src/libevent/changelist-internal.h b/src/libevent-modified/changelist-internal.h similarity index 100% rename from src/libevent/changelist-internal.h rename to src/libevent-modified/changelist-internal.h diff --git a/src/libevent/compat/sys/queue.h b/src/libevent-modified/compat/sys/queue.h similarity index 100% rename from src/libevent/compat/sys/queue.h rename to src/libevent-modified/compat/sys/queue.h diff --git a/src/libevent/configure.ac b/src/libevent-modified/configure.ac similarity index 95% rename from src/libevent/configure.ac rename to src/libevent-modified/configure.ac index 189988a2..74676a95 100644 --- a/src/libevent/configure.ac +++ b/src/libevent-modified/configure.ac @@ -6,14 +6,15 @@ dnl See LICENSE for copying information. dnl dnl Original version Dug Song -AC_PREREQ(2.59c) -AC_INIT(event.c) +AC_PREREQ(2.59) AC_CONFIG_MACRO_DIR([m4]) -AM_INIT_AUTOMAKE(libevent,2.0.21-stable-dev) -AM_CONFIG_HEADER(config.h) -AC_DEFINE(NUMERIC_VERSION, 0x02001501, [Numeric representation of the version]) +AC_INIT([libevent],[2.0.22-stable]) +AC_CONFIG_SRCDIR([evdns.c]) +AM_INIT_AUTOMAKE +AC_CONFIG_HEADERS(config.h) +AC_DEFINE(NUMERIC_VERSION, 0x02001600, [Numeric representation of the version]) dnl Initialize prefix. if test "$prefix" = "NONE"; then @@ -35,10 +36,15 @@ esac dnl Checks for programs. AC_PROG_CC AM_PROG_CC_C_O -AC_PROG_SED AC_PROG_INSTALL AC_PROG_LN_S -AC_PROG_MKDIR_P +# AC_PROG_MKDIR_P - $(MKDIR_P) should be defined by AM_INIT_AUTOMAKE + +# AC_PROG_SED is only available in Autoconf >= 2.59b; workaround for older +# versions +ifdef([AC_PROG_SED], [AC_PROG_SED], [ +AC_CHECK_PROGS(SED, [gsed sed]) +]) AC_PROG_GCC_TRADITIONAL @@ -86,8 +92,8 @@ AC_ARG_ENABLE([libevent-install], AS_HELP_STRING([--disable-libevent-install, disable installation of libevent]), [], [enable_libevent_install=yes]) AC_ARG_ENABLE([libevent-regress], - AS_HELP_STRING([--disable-libevent-regress, skip regress in make check]), - [], [enable_libevent_regress=yes]) + AS_HELP_STRING([--enable-libevent-regress, enable regress in make check]), + [enable_libevent_regress=yes], []) AC_ARG_ENABLE([function-sections], AS_HELP_STRING([--enable-function-sections, make static library allow smaller binaries with --gc-sections]), [], [enable_function_sections=no]) @@ -285,7 +291,7 @@ AC_HEADER_TIME dnl Checks for library functions. AC_CHECK_FUNCS([gettimeofday vasprintf fcntl clock_gettime strtok_r strsep]) -AC_CHECK_FUNCS([getnameinfo strlcpy inet_ntop inet_pton signal sigaction strtoll inet_aton pipe eventfd sendfile mmap splice arc4random arc4random_buf issetugid geteuid getegid getprotobynumber setenv unsetenv putenv sysctl]) +AC_CHECK_FUNCS([getnameinfo strlcpy inet_ntop inet_pton signal sigaction strtoll inet_aton pipe eventfd sendfile mmap splice arc4random arc4random_buf arc4random_addrandom issetugid geteuid getegid getprotobynumber setenv unsetenv putenv sysctl]) AC_CHECK_FUNCS([umask]) AC_CACHE_CHECK( @@ -553,6 +559,7 @@ AC_CHECK_SIZEOF(int) AC_CHECK_SIZEOF(short) AC_CHECK_SIZEOF(size_t) AC_CHECK_SIZEOF(void *) +AC_CHECK_SIZEOF(off_t) AC_CHECK_TYPES([struct in6_addr, struct sockaddr_in6, sa_family_t, struct addrinfo, struct sockaddr_storage], , , [#define _GNU_SOURCE @@ -720,6 +727,15 @@ if test x$enable_gcc_warnings = xyes && test "$GCC" = "yes"; then # Disable the unused-function warnings, because these trigger # for minheap-internal.h related code. CFLAGS="$CFLAGS -Wno-unused-function" + + # clang on macosx emits warnigns for each directory specified which + # isn't "used" generating a lot of build noise (typically 3 warnings + # per file + case "$host_os" in + darwin*) + CFLAGS="$CFLAGS -Qunused-arguments" + ;; + esac fi ##This will break the world on some 64-bit architectures diff --git a/src/libevent/defer-internal.h b/src/libevent-modified/defer-internal.h similarity index 100% rename from src/libevent/defer-internal.h rename to src/libevent-modified/defer-internal.h diff --git a/src/libevent/devpoll.c b/src/libevent-modified/devpoll.c similarity index 100% rename from src/libevent/devpoll.c rename to src/libevent-modified/devpoll.c diff --git a/src/libevent/epoll.c b/src/libevent-modified/epoll.c similarity index 100% rename from src/libevent/epoll.c rename to src/libevent-modified/epoll.c diff --git a/src/libevent/epoll_sub.c b/src/libevent-modified/epoll_sub.c similarity index 85% rename from src/libevent/epoll_sub.c rename to src/libevent-modified/epoll_sub.c index 3738b26b..facbc09f 100644 --- a/src/libevent/epoll_sub.c +++ b/src/libevent-modified/epoll_sub.c @@ -31,11 +31,20 @@ #include #include #include +#include int epoll_create(int size) { +#if !defined(__NR_epoll_create) && defined(__NR_epoll_create1) + if (size <= 0) { + errno = EINVAL; + return -1; + } + return (syscall(__NR_epoll_create1, 0)); +#else return (syscall(__NR_epoll_create, size)); +#endif } int @@ -48,5 +57,9 @@ epoll_ctl(int epfd, int op, int fd, struct epoll_event *event) int epoll_wait(int epfd, struct epoll_event *events, int maxevents, int timeout) { +#if !defined(__NR_epoll_wait) && defined(__NR_epoll_pwait) + return (syscall(__NR_epoll_pwait, epfd, events, maxevents, timeout, NULL, 0)); +#else return (syscall(__NR_epoll_wait, epfd, events, maxevents, timeout)); +#endif } diff --git a/src/libevent/evbuffer-internal.h b/src/libevent-modified/evbuffer-internal.h similarity index 96% rename from src/libevent/evbuffer-internal.h rename to src/libevent-modified/evbuffer-internal.h index e68a59df..f9dcc061 100644 --- a/src/libevent/evbuffer-internal.h +++ b/src/libevent-modified/evbuffer-internal.h @@ -153,6 +153,18 @@ struct evbuffer { struct bufferevent *parent; }; +#if _EVENT_SIZEOF_OFF_T < _EVENT_SIZEOF_SIZE_T +typedef ev_ssize_t ev_misalign_t; +#define EVBUFFER_CHAIN_MAX ((size_t)EV_SSIZE_MAX) +#else +typedef ev_off_t ev_misalign_t; +#if _EVENT_SIZEOF_OFF_T > _EVENT_SIZEOF_SIZE_T +#define EVBUFFER_CHAIN_MAX EV_SIZE_MAX +#else +#define EVBUFFER_CHAIN_MAX ((size_t)EV_SSIZE_MAX) +#endif +#endif + /** A single item in an evbuffer. */ struct evbuffer_chain { /** points to next buffer in the chain */ @@ -163,7 +175,7 @@ struct evbuffer_chain { /** unused space at the beginning of buffer or an offset into a * file for sendfile buffers. */ - ev_off_t misalign; + ev_misalign_t misalign; /** Offset into buffer + misalign at which to start writing. * In other words, the total number of bytes actually stored diff --git a/src/libevent/evdns.c b/src/libevent-modified/evdns.c similarity index 99% rename from src/libevent/evdns.c rename to src/libevent-modified/evdns.c index 10ea5c45..0481d4bc 100644 --- a/src/libevent/evdns.c +++ b/src/libevent-modified/evdns.c @@ -734,21 +734,29 @@ request_reissue(struct request *req) { /* this function looks for space on the inflight queue and promotes */ /* requests from the waiting queue if it can. */ +/* */ +/* TODO: */ +/* add return code, see at nameserver_pick() and other functions. */ static void evdns_requests_pump_waiting_queue(struct evdns_base *base) { ASSERT_LOCKED(base); while (base->global_requests_inflight < base->global_max_requests_inflight && base->global_requests_waiting) { struct request *req; - /* move a request from the waiting queue to the inflight queue */ + EVUTIL_ASSERT(base->req_waiting_head); req = base->req_waiting_head; + + req->ns = nameserver_pick(base); + if (!req->ns) + return; + + /* move a request from the waiting queue to the inflight queue */ evdns_request_remove(req, &base->req_waiting_head); base->global_requests_waiting--; base->global_requests_inflight++; - req->ns = nameserver_pick(base); request_trans_id_set(req, transaction_id_pick(base)); evdns_request_insert(req, &REQ_HEAD(base, req->trans_id)); @@ -2271,6 +2279,12 @@ evdns_request_transmit(struct request *req) { req->transmit_me = 1; EVUTIL_ASSERT(req->trans_id != 0xffff); + if (!req->ns) + { + /* unable to transmit request if no nameservers */ + return 1; + } + if (req->ns->choked) { /* don't bother trying to write to a socket */ /* which we have had EAGAIN from */ @@ -2491,6 +2505,7 @@ evdns_base_resume(struct evdns_base *base) EVDNS_LOCK(base); evdns_requests_pump_waiting_queue(base); EVDNS_UNLOCK(base); + return 0; } @@ -4016,6 +4031,10 @@ evdns_nameserver_free(struct nameserver *server) event_debug_unassign(&server->event); if (server->state == 0) (void) event_del(&server->timeout_event); + if (server->probe_request) { + evdns_cancel_request(server->base, server->probe_request); + server->probe_request = NULL; + } event_debug_unassign(&server->timeout_event); mm_free(server); } @@ -4031,6 +4050,15 @@ evdns_base_free_and_unlock(struct evdns_base *base, int fail_requests) /* TODO(nickm) we might need to refcount here. */ + for (server = base->server_head; server; server = server_next) { + server_next = server->next; + evdns_nameserver_free(server); + if (server_next == base->server_head) + break; + } + base->server_head = NULL; + base->global_good_nameservers = 0; + for (i = 0; i < base->n_req_heads; ++i) { while (base->req_heads[i]) { if (fail_requests) @@ -4045,14 +4073,6 @@ evdns_base_free_and_unlock(struct evdns_base *base, int fail_requests) } base->global_requests_inflight = base->global_requests_waiting = 0; - for (server = base->server_head; server; server = server_next) { - server_next = server->next; - evdns_nameserver_free(server); - if (server_next == base->server_head) - break; - } - base->server_head = NULL; - base->global_good_nameservers = 0; if (base->global_search_state) { for (dom = base->global_search_state->head; dom; dom = dom_next) { diff --git a/src/libevent/evdns.h b/src/libevent-modified/evdns.h similarity index 100% rename from src/libevent/evdns.h rename to src/libevent-modified/evdns.h diff --git a/src/libevent/event-internal.h b/src/libevent-modified/event-internal.h similarity index 100% rename from src/libevent/event-internal.h rename to src/libevent-modified/event-internal.h diff --git a/src/libevent/event.c b/src/libevent-modified/event.c similarity index 99% rename from src/libevent/event.c rename to src/libevent-modified/event.c index a979f1f2..fab419af 100644 --- a/src/libevent/event.c +++ b/src/libevent-modified/event.c @@ -1256,6 +1256,14 @@ event_base_init_common_timeout(struct event_base *base, static inline void event_persist_closure(struct event_base *base, struct event *ev) { + // Define our callback, we use this to store our callback before it's executed + void (*evcb_callback)(evutil_socket_t, short, void *); + + // Other fields of *ev that must be stored before executing + evutil_socket_t evcb_fd; + short evcb_res; + void *evcb_arg; + /* reschedule the persistent event if we have a timeout. */ if (ev->ev_io_timeout.tv_sec || ev->ev_io_timeout.tv_usec) { /* If there was a timeout, we want it to run at an interval of @@ -1297,8 +1305,18 @@ event_persist_closure(struct event_base *base, struct event *ev) run_at.tv_usec |= usec_mask; event_add_internal(ev, &run_at, 1); } - EVBASE_RELEASE_LOCK(base, th_base_lock); - (*ev->ev_callback)(ev->ev_fd, ev->ev_res, ev->ev_arg); + + // Save our callback before we release the lock + evcb_callback = ev->ev_callback; + evcb_fd = ev->ev_fd; + evcb_res = ev->ev_res; + evcb_arg = ev->ev_arg; + + // Release the lock + EVBASE_RELEASE_LOCK(base, th_base_lock); + + // Execute the callback + (evcb_callback)(evcb_fd, evcb_res, evcb_arg); } /* diff --git a/src/libevent/event.h b/src/libevent-modified/event.h similarity index 100% rename from src/libevent/event.h rename to src/libevent-modified/event.h diff --git a/src/libevent/event_iocp.c b/src/libevent-modified/event_iocp.c similarity index 99% rename from src/libevent/event_iocp.c rename to src/libevent-modified/event_iocp.c index 43212810..9648366d 100644 --- a/src/libevent/event_iocp.c +++ b/src/libevent-modified/event_iocp.c @@ -141,6 +141,8 @@ get_extension_function(SOCKET s, const GUID *which_fn) {0xb5367df2,0xcbac,0x11cf,{0x95,0xca,0x00,0x80,0x5f,0x48,0xa1,0x92}} #endif +static int extension_fns_initialized = 0; + static void init_extension_functions(struct win32_extension_fns *ext) { @@ -155,10 +157,11 @@ init_extension_functions(struct win32_extension_fns *ext) ext->GetAcceptExSockaddrs = get_extension_function(s, &getacceptexsockaddrs); closesocket(s); + + extension_fns_initialized = 1; } static struct win32_extension_fns the_extension_fns; -static int extension_fns_initialized = 0; const struct win32_extension_fns * event_get_win32_extension_fns(void) diff --git a/src/libevent/event_rpcgen.py b/src/libevent-modified/event_rpcgen.py similarity index 100% rename from src/libevent/event_rpcgen.py rename to src/libevent-modified/event_rpcgen.py diff --git a/src/libevent/event_tagging.c b/src/libevent-modified/event_tagging.c similarity index 99% rename from src/libevent/event_tagging.c rename to src/libevent-modified/event_tagging.c index a83e719f..eea4bfce 100644 --- a/src/libevent/event_tagging.c +++ b/src/libevent-modified/event_tagging.c @@ -206,6 +206,8 @@ decode_tag_internal(ev_uint32_t *ptag, struct evbuffer *evbuf, int dodrain) */ data = evbuffer_pullup( evbuf, len < sizeof(number) + 1 ? len : sizeof(number) + 1); + if (!data) + return (-1); while (count++ < len) { ev_uint8_t lower = *data++; @@ -312,6 +314,8 @@ do { \ \ /* XXX(niels): faster? */ \ data = evbuffer_pullup(evbuf, offset + 1) + offset; \ + if (!data) \ + return (-1); \ \ nibbles = ((data[0] & 0xf0) >> 4) + 1; \ if (nibbles > maxnibbles || (nibbles >> 1) + 1 > len) \ @@ -319,6 +323,8 @@ do { \ len = (nibbles >> 1) + 1; \ \ data = evbuffer_pullup(evbuf, offset + len) + offset; \ + if (!data) \ + return (-1); \ \ while (nibbles > 0) { \ number <<= 4; \ diff --git a/src/libevent/evhttp.h b/src/libevent-modified/evhttp.h similarity index 100% rename from src/libevent/evhttp.h rename to src/libevent-modified/evhttp.h diff --git a/src/libevent/evmap-internal.h b/src/libevent-modified/evmap-internal.h similarity index 100% rename from src/libevent/evmap-internal.h rename to src/libevent-modified/evmap-internal.h diff --git a/src/libevent/evmap.c b/src/libevent-modified/evmap.c similarity index 100% rename from src/libevent/evmap.c rename to src/libevent-modified/evmap.c diff --git a/src/libevent/evport.c b/src/libevent-modified/evport.c similarity index 100% rename from src/libevent/evport.c rename to src/libevent-modified/evport.c diff --git a/src/libevent/evrpc-internal.h b/src/libevent-modified/evrpc-internal.h similarity index 100% rename from src/libevent/evrpc-internal.h rename to src/libevent-modified/evrpc-internal.h diff --git a/src/libevent/evrpc.c b/src/libevent-modified/evrpc.c similarity index 100% rename from src/libevent/evrpc.c rename to src/libevent-modified/evrpc.c diff --git a/src/libevent/evrpc.h b/src/libevent-modified/evrpc.h similarity index 100% rename from src/libevent/evrpc.h rename to src/libevent-modified/evrpc.h diff --git a/src/libevent/evsignal-internal.h b/src/libevent-modified/evsignal-internal.h similarity index 100% rename from src/libevent/evsignal-internal.h rename to src/libevent-modified/evsignal-internal.h diff --git a/src/libevent/evthread-internal.h b/src/libevent-modified/evthread-internal.h similarity index 100% rename from src/libevent/evthread-internal.h rename to src/libevent-modified/evthread-internal.h diff --git a/src/libevent/evthread.c b/src/libevent-modified/evthread.c similarity index 100% rename from src/libevent/evthread.c rename to src/libevent-modified/evthread.c diff --git a/src/libevent/evthread_pthread.c b/src/libevent-modified/evthread_pthread.c similarity index 100% rename from src/libevent/evthread_pthread.c rename to src/libevent-modified/evthread_pthread.c diff --git a/src/libevent/evthread_win32.c b/src/libevent-modified/evthread_win32.c similarity index 100% rename from src/libevent/evthread_win32.c rename to src/libevent-modified/evthread_win32.c diff --git a/src/libevent/evutil.c b/src/libevent-modified/evutil.c similarity index 99% rename from src/libevent/evutil.c rename to src/libevent-modified/evutil.c index e681b065..4d8bdac4 100644 --- a/src/libevent/evutil.c +++ b/src/libevent-modified/evutil.c @@ -1582,7 +1582,7 @@ evutil_vsnprintf(char *buf, size_t buflen, const char *format, va_list ap) int r; if (!buflen) return 0; -#ifdef _MSC_VER +#if defined(_MSC_VER) || defined(WIN32) r = _vsnprintf(buf, buflen, format, ap); if (r < 0) r = _vscprintf(format, ap); diff --git a/src/libevent/evutil.h b/src/libevent-modified/evutil.h similarity index 100% rename from src/libevent/evutil.h rename to src/libevent-modified/evutil.h diff --git a/src/libevent/evutil_rand.c b/src/libevent-modified/evutil_rand.c similarity index 98% rename from src/libevent/evutil_rand.c rename to src/libevent-modified/evutil_rand.c index 5872e86c..94db1eba 100644 --- a/src/libevent/evutil_rand.c +++ b/src/libevent-modified/evutil_rand.c @@ -155,7 +155,12 @@ evutil_secure_rng_get_bytes(void *buf, size_t n) void evutil_secure_rng_add_bytes(const char *buf, size_t n) { +#ifdef HAVE_ARC4RANDOM_ADDRANDOM arc4random_addrandom((unsigned char*)buf, n>(size_t)INT_MAX ? INT_MAX : (int)n); +#else + (void) buf; + (void) n; +#endif } diff --git a/src/libevent/ht-internal.h b/src/libevent-modified/ht-internal.h similarity index 100% rename from src/libevent/ht-internal.h rename to src/libevent-modified/ht-internal.h diff --git a/src/libevent/http-internal.h b/src/libevent-modified/http-internal.h similarity index 100% rename from src/libevent/http-internal.h rename to src/libevent-modified/http-internal.h diff --git a/src/libevent/http.c b/src/libevent-modified/http.c similarity index 99% rename from src/libevent/http.c rename to src/libevent-modified/http.c index 3994b917..377597ea 100644 --- a/src/libevent/http.c +++ b/src/libevent-modified/http.c @@ -383,8 +383,6 @@ evhttp_write_buffer(struct evhttp_connection *evcon, evcon->cb = cb; evcon->cb_arg = arg; - bufferevent_enable(evcon->bufev, EV_WRITE); - /* Disable the read callback: we don't actually care about data; * we only care about close detection. (We don't disable reading, * since we *do* want to learn about any close events.) */ @@ -393,6 +391,8 @@ evhttp_write_buffer(struct evhttp_connection *evcon, evhttp_write_cb, evhttp_error_cb, evcon); + + bufferevent_enable(evcon->bufev, EV_WRITE); } static void @@ -2181,6 +2181,8 @@ evhttp_connection_get_peer(struct evhttp_connection *evcon, int evhttp_connection_connect(struct evhttp_connection *evcon) { + int old_state = evcon->state; + if (evcon->state == EVCON_CONNECTING) return (0); @@ -2209,8 +2211,11 @@ evhttp_connection_connect(struct evhttp_connection *evcon) /* make sure that we get a write callback */ bufferevent_enable(evcon->bufev, EV_WRITE); + evcon->state = EVCON_CONNECTING; + if (bufferevent_socket_connect_hostname(evcon->bufev, evcon->dns_base, AF_UNSPEC, evcon->address, evcon->port) < 0) { + evcon->state = old_state; event_sock_warn(evcon->fd, "%s: connection to \"%s\" failed", __func__, evcon->address); /* some operating systems return ECONNREFUSED immediately @@ -2221,8 +2226,6 @@ evhttp_connection_connect(struct evhttp_connection *evcon) return (0); } - evcon->state = EVCON_CONNECTING; - return (0); } diff --git a/src/libevent/include/Makefile.am b/src/libevent-modified/include/Makefile.am similarity index 100% rename from src/libevent/include/Makefile.am rename to src/libevent-modified/include/Makefile.am diff --git a/src/libevent/include/event2/buffer.h b/src/libevent-modified/include/event2/buffer.h similarity index 99% rename from src/libevent/include/event2/buffer.h rename to src/libevent-modified/include/event2/buffer.h index 37f424e1..5c896558 100644 --- a/src/libevent/include/event2/buffer.h +++ b/src/libevent-modified/include/event2/buffer.h @@ -769,7 +769,7 @@ void evbuffer_cb_unsuspend(struct evbuffer *buffer, struct evbuffer_cb_entry *cb #endif /** - Makes the data at the begging of an evbuffer contiguous. + Makes the data at the beginning of an evbuffer contiguous. @param buf the evbuffer to make contiguous @param size the number of bytes to make contiguous, or -1 to make the diff --git a/src/libevent/include/event2/buffer_compat.h b/src/libevent-modified/include/event2/buffer_compat.h similarity index 100% rename from src/libevent/include/event2/buffer_compat.h rename to src/libevent-modified/include/event2/buffer_compat.h diff --git a/src/libevent/include/event2/bufferevent.h b/src/libevent-modified/include/event2/bufferevent.h similarity index 99% rename from src/libevent/include/event2/bufferevent.h rename to src/libevent-modified/include/event2/bufferevent.h index 7ce4e8f8..0cc6cb1c 100644 --- a/src/libevent/include/event2/bufferevent.h +++ b/src/libevent-modified/include/event2/bufferevent.h @@ -44,10 +44,10 @@ with bufferevent_enable() and bufferevent_disable(). When reading is enabled, the bufferevent will try to read from the - file descriptor onto its input buffer, and and call the read callback. + file descriptor onto its input buffer, and call the read callback. When writing is enabled, the bufferevent will try to write data onto its - file descriptor when writing is enabled, and call the write callback - when the output buffer is sufficiently drained. + file descriptor when the output buffer has enough data, and call the write + callback when the output buffer is sufficiently drained. Bufferevents come in several flavors, including: diff --git a/src/libevent/include/event2/bufferevent_compat.h b/src/libevent-modified/include/event2/bufferevent_compat.h similarity index 100% rename from src/libevent/include/event2/bufferevent_compat.h rename to src/libevent-modified/include/event2/bufferevent_compat.h diff --git a/src/libevent/include/event2/bufferevent_ssl.h b/src/libevent-modified/include/event2/bufferevent_ssl.h similarity index 100% rename from src/libevent/include/event2/bufferevent_ssl.h rename to src/libevent-modified/include/event2/bufferevent_ssl.h diff --git a/src/libevent/include/event2/bufferevent_struct.h b/src/libevent-modified/include/event2/bufferevent_struct.h similarity index 100% rename from src/libevent/include/event2/bufferevent_struct.h rename to src/libevent-modified/include/event2/bufferevent_struct.h diff --git a/src/libevent/include/event2/dns.h b/src/libevent-modified/include/event2/dns.h similarity index 99% rename from src/libevent/include/event2/dns.h rename to src/libevent-modified/include/event2/dns.h index a4de05b6..5973dbbe 100644 --- a/src/libevent/include/event2/dns.h +++ b/src/libevent-modified/include/event2/dns.h @@ -438,7 +438,7 @@ int evdns_base_set_option(struct evdns_base *base, const char *option, const cha @param base the evdns_base to which to apply this operation @param flags any of DNS_OPTION_NAMESERVERS|DNS_OPTION_SEARCH|DNS_OPTION_MISC| - DNS_OPTIONS_HOSTSFILE|DNS_OPTIONS_ALL + DNS_OPTION_HOSTSFILE|DNS_OPTIONS_ALL @param filename the path to the resolv.conf file @return 0 if successful, or various positive error codes if an error occurred (see above) diff --git a/src/libevent/include/event2/dns_compat.h b/src/libevent-modified/include/event2/dns_compat.h similarity index 100% rename from src/libevent/include/event2/dns_compat.h rename to src/libevent-modified/include/event2/dns_compat.h diff --git a/src/libevent/include/event2/dns_struct.h b/src/libevent-modified/include/event2/dns_struct.h similarity index 100% rename from src/libevent/include/event2/dns_struct.h rename to src/libevent-modified/include/event2/dns_struct.h diff --git a/src/libevent/include/event2/event.h b/src/libevent-modified/include/event2/event.h similarity index 98% rename from src/libevent/include/event2/event.h rename to src/libevent-modified/include/event2/event.h index 700e8ca1..10bcd97c 100644 --- a/src/libevent/include/event2/event.h +++ b/src/libevent-modified/include/event2/event.h @@ -351,14 +351,14 @@ int event_reinit(struct event_base *base); /** Event dispatching loop - This loop will run the event base until either there are no more added - events, or until something calls event_base_loopbreak() or + This loop will run the event base until either there are no more pending or + active, or until something calls event_base_loopbreak() or event_base_loopexit(). @param base the event_base structure returned by event_base_new() or event_base_new_with_config() - @return 0 if successful, -1 if an error occurred, or 1 if no events were - registered. + @return 0 if successful, -1 if an error occurred, or 1 if we exited because + no events were pending or active. @see event_base_loop() */ int event_base_dispatch(struct event_base *); @@ -645,15 +645,15 @@ int event_base_set(struct event_base *, struct event *); This is a more flexible version of event_base_dispatch(). By default, this loop will run the event base until either there are no more - added events, or until something calls event_base_loopbreak() or - evenet_base_loopexit(). You can override this behavior with the 'flags' + pending or active events, or until something calls event_base_loopbreak() or + event_base_loopexit(). You can override this behavior with the 'flags' argument. @param eb the event_base structure returned by event_base_new() or event_base_new_with_config() @param flags any combination of EVLOOP_ONCE | EVLOOP_NONBLOCK - @return 0 if successful, -1 if an error occurred, or 1 if no events were - registered. + @return 0 if successful, -1 if an error occurred, or 1 if we exited because + no events were pending or active. @see event_base_loopexit(), event_base_dispatch(), EVLOOP_ONCE, EVLOOP_NONBLOCK */ diff --git a/src/libevent/include/event2/event_compat.h b/src/libevent-modified/include/event2/event_compat.h similarity index 100% rename from src/libevent/include/event2/event_compat.h rename to src/libevent-modified/include/event2/event_compat.h diff --git a/src/libevent/include/event2/event_struct.h b/src/libevent-modified/include/event2/event_struct.h similarity index 100% rename from src/libevent/include/event2/event_struct.h rename to src/libevent-modified/include/event2/event_struct.h diff --git a/src/libevent/include/event2/http.h b/src/libevent-modified/include/event2/http.h similarity index 100% rename from src/libevent/include/event2/http.h rename to src/libevent-modified/include/event2/http.h diff --git a/src/libevent/include/event2/http_compat.h b/src/libevent-modified/include/event2/http_compat.h similarity index 100% rename from src/libevent/include/event2/http_compat.h rename to src/libevent-modified/include/event2/http_compat.h diff --git a/src/libevent/include/event2/http_struct.h b/src/libevent-modified/include/event2/http_struct.h similarity index 100% rename from src/libevent/include/event2/http_struct.h rename to src/libevent-modified/include/event2/http_struct.h diff --git a/src/libevent/include/event2/keyvalq_struct.h b/src/libevent-modified/include/event2/keyvalq_struct.h similarity index 100% rename from src/libevent/include/event2/keyvalq_struct.h rename to src/libevent-modified/include/event2/keyvalq_struct.h diff --git a/src/libevent/include/event2/listener.h b/src/libevent-modified/include/event2/listener.h similarity index 100% rename from src/libevent/include/event2/listener.h rename to src/libevent-modified/include/event2/listener.h diff --git a/src/libevent/include/event2/rpc.h b/src/libevent-modified/include/event2/rpc.h similarity index 100% rename from src/libevent/include/event2/rpc.h rename to src/libevent-modified/include/event2/rpc.h diff --git a/src/libevent/include/event2/rpc_compat.h b/src/libevent-modified/include/event2/rpc_compat.h similarity index 100% rename from src/libevent/include/event2/rpc_compat.h rename to src/libevent-modified/include/event2/rpc_compat.h diff --git a/src/libevent/include/event2/rpc_struct.h b/src/libevent-modified/include/event2/rpc_struct.h similarity index 100% rename from src/libevent/include/event2/rpc_struct.h rename to src/libevent-modified/include/event2/rpc_struct.h diff --git a/src/libevent/include/event2/tag.h b/src/libevent-modified/include/event2/tag.h similarity index 100% rename from src/libevent/include/event2/tag.h rename to src/libevent-modified/include/event2/tag.h diff --git a/src/libevent/include/event2/tag_compat.h b/src/libevent-modified/include/event2/tag_compat.h similarity index 100% rename from src/libevent/include/event2/tag_compat.h rename to src/libevent-modified/include/event2/tag_compat.h diff --git a/src/libevent/include/event2/thread.h b/src/libevent-modified/include/event2/thread.h similarity index 100% rename from src/libevent/include/event2/thread.h rename to src/libevent-modified/include/event2/thread.h diff --git a/src/libevent/include/event2/util.h b/src/libevent-modified/include/event2/util.h similarity index 98% rename from src/libevent/include/event2/util.h rename to src/libevent-modified/include/event2/util.h index f4c8da04..50f5e180 100644 --- a/src/libevent/include/event2/util.h +++ b/src/libevent-modified/include/event2/util.h @@ -659,9 +659,12 @@ const char *evutil_gai_strerror(int err); /** Generate n bytes of secure pseudorandom data, and store them in buf. * - * By default, Libevent uses an ARC4-based random number generator, seeded - * using the platform's entropy source (/dev/urandom on Unix-like systems; - * CryptGenRandom on Windows). + * Current versions of Libevent use an ARC4-based random number generator, + * seeded using the platform's entropy source (/dev/urandom on Unix-like + * systems; CryptGenRandom on Windows). This is not actually as secure as it + * should be: ARC4 is a pretty lousy cipher, and the current implementation + * provides only rudimentary prediction- and backtracking-resistance. Don't + * use this for serious cryptographic applications. */ void evutil_secure_rng_get_bytes(void *buf, size_t n); diff --git a/src/libevent/iocp-internal.h b/src/libevent-modified/iocp-internal.h similarity index 100% rename from src/libevent/iocp-internal.h rename to src/libevent-modified/iocp-internal.h diff --git a/src/libevent/ipv6-internal.h b/src/libevent-modified/ipv6-internal.h similarity index 100% rename from src/libevent/ipv6-internal.h rename to src/libevent-modified/ipv6-internal.h diff --git a/src/libevent/kqueue.c b/src/libevent-modified/kqueue.c similarity index 100% rename from src/libevent/kqueue.c rename to src/libevent-modified/kqueue.c diff --git a/src/libevent/libevent.pc.in b/src/libevent-modified/libevent.pc.in similarity index 100% rename from src/libevent/libevent.pc.in rename to src/libevent-modified/libevent.pc.in diff --git a/src/libevent/libevent_openssl.pc.in b/src/libevent-modified/libevent_openssl.pc.in similarity index 100% rename from src/libevent/libevent_openssl.pc.in rename to src/libevent-modified/libevent_openssl.pc.in diff --git a/src/libevent/libevent_pthreads.pc.in b/src/libevent-modified/libevent_pthreads.pc.in similarity index 100% rename from src/libevent/libevent_pthreads.pc.in rename to src/libevent-modified/libevent_pthreads.pc.in diff --git a/src/libevent/listener.c b/src/libevent-modified/listener.c similarity index 100% rename from src/libevent/listener.c rename to src/libevent-modified/listener.c diff --git a/src/libevent/log-internal.h b/src/libevent-modified/log-internal.h similarity index 100% rename from src/libevent/log-internal.h rename to src/libevent-modified/log-internal.h diff --git a/src/libevent/log.c b/src/libevent-modified/log.c similarity index 100% rename from src/libevent/log.c rename to src/libevent-modified/log.c diff --git a/src/libevent-modified/m4/ac_backport_259_ssizet.m4 b/src/libevent-modified/m4/ac_backport_259_ssizet.m4 new file mode 100644 index 00000000..75fde386 --- /dev/null +++ b/src/libevent-modified/m4/ac_backport_259_ssizet.m4 @@ -0,0 +1,3 @@ +AN_IDENTIFIER([ssize_t], [AC_TYPE_SSIZE_T]) +AC_DEFUN([AC_TYPE_SSIZE_T], [AC_CHECK_TYPE(ssize_t, int)]) + diff --git a/src/libevent/m4/acx_pthread.m4 b/src/libevent-modified/m4/acx_pthread.m4 similarity index 100% rename from src/libevent/m4/acx_pthread.m4 rename to src/libevent-modified/m4/acx_pthread.m4 diff --git a/src/libevent/m4/ltsugar.m4 b/src/libevent-modified/m4/ltsugar.m4 similarity index 95% rename from src/libevent/m4/ltsugar.m4 rename to src/libevent-modified/m4/ltsugar.m4 index 9000a057..da4ac6b3 100644 --- a/src/libevent/m4/ltsugar.m4 +++ b/src/libevent-modified/m4/ltsugar.m4 @@ -1,6 +1,7 @@ # ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # -# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. +# Copyright (C) 2004-2005, 2007-2008, 2011-2014 Free Software +# Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives @@ -33,7 +34,7 @@ m4_define([_lt_join], # ------------ # Manipulate m4 lists. # These macros are necessary as long as will still need to support -# Autoconf-2.59 which quotes differently. +# Autoconf-2.59, which quotes differently. m4_define([lt_car], [[$1]]) m4_define([lt_cdr], [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], @@ -44,7 +45,7 @@ m4_define([lt_unquote], $1) # lt_append(MACRO-NAME, STRING, [SEPARATOR]) # ------------------------------------------ -# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. +# Redefine MACRO-NAME to hold its former content plus 'SEPARATOR''STRING'. # Note that neither SEPARATOR nor STRING are expanded; they are appended # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). # No SEPARATOR is output if MACRO-NAME was previously undefined (different diff --git a/src/libevent/m4/lt~obsolete.m4 b/src/libevent-modified/m4/lt~obsolete.m4 similarity index 98% rename from src/libevent/m4/lt~obsolete.m4 rename to src/libevent-modified/m4/lt~obsolete.m4 index c573da90..6975098b 100644 --- a/src/libevent/m4/lt~obsolete.m4 +++ b/src/libevent-modified/m4/lt~obsolete.m4 @@ -1,6 +1,7 @@ # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # -# Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. +# Copyright (C) 2004-2005, 2007, 2009, 2011-2014 Free Software +# Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file is free software; the Free Software Foundation gives @@ -11,7 +12,7 @@ # These exist entirely to fool aclocal when bootstrapping libtool. # -# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) +# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN), # which have later been changed to m4_define as they aren't part of the # exported API, or moved to Autoconf or Automake where they belong. # @@ -25,7 +26,7 @@ # included after everything else. This provides aclocal with the # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything # because those macros already exist, or will be overwritten later. -# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. +# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. # # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. # Yes, that means every name once taken will need to remain here until diff --git a/src/libevent/make-event-config.sed b/src/libevent-modified/make-event-config.sed similarity index 100% rename from src/libevent/make-event-config.sed rename to src/libevent-modified/make-event-config.sed diff --git a/src/libevent/minheap-internal.h b/src/libevent-modified/minheap-internal.h similarity index 100% rename from src/libevent/minheap-internal.h rename to src/libevent-modified/minheap-internal.h diff --git a/src/libevent/mm-internal.h b/src/libevent-modified/mm-internal.h similarity index 100% rename from src/libevent/mm-internal.h rename to src/libevent-modified/mm-internal.h diff --git a/src/libevent/poll.c b/src/libevent-modified/poll.c similarity index 100% rename from src/libevent/poll.c rename to src/libevent-modified/poll.c diff --git a/src/libevent/ratelim-internal.h b/src/libevent-modified/ratelim-internal.h similarity index 100% rename from src/libevent/ratelim-internal.h rename to src/libevent-modified/ratelim-internal.h diff --git a/src/libevent/sample/Makefile.am b/src/libevent-modified/sample/Makefile.am similarity index 100% rename from src/libevent/sample/Makefile.am rename to src/libevent-modified/sample/Makefile.am diff --git a/src/libevent/sample/dns-example.c b/src/libevent-modified/sample/dns-example.c similarity index 100% rename from src/libevent/sample/dns-example.c rename to src/libevent-modified/sample/dns-example.c diff --git a/src/libevent/sample/event-test.c b/src/libevent-modified/sample/event-test.c similarity index 100% rename from src/libevent/sample/event-test.c rename to src/libevent-modified/sample/event-test.c diff --git a/src/libevent/sample/hello-world.c b/src/libevent-modified/sample/hello-world.c similarity index 100% rename from src/libevent/sample/hello-world.c rename to src/libevent-modified/sample/hello-world.c diff --git a/src/libevent/sample/http-server.c b/src/libevent-modified/sample/http-server.c similarity index 99% rename from src/libevent/sample/http-server.c rename to src/libevent-modified/sample/http-server.c index fb455792..a63f3e91 100644 --- a/src/libevent/sample/http-server.c +++ b/src/libevent-modified/sample/http-server.c @@ -132,7 +132,7 @@ dump_request_cb(struct evhttp_request *req, void *arg) while (evbuffer_get_length(buf)) { int n; char cbuf[128]; - n = evbuffer_remove(buf, cbuf, sizeof(buf)-1); + n = evbuffer_remove(buf, cbuf, sizeof(cbuf)); if (n > 0) (void) fwrite(cbuf, 1, n, stdout); } @@ -264,7 +264,7 @@ send_document_cb(struct evhttp_request *req, void *arg) #endif evbuffer_add_printf(evb, "\n"); #ifdef WIN32 - CloseHandle(d); + FindClose(d); #else closedir(d); #endif diff --git a/src/libevent/sample/le-proxy.c b/src/libevent-modified/sample/le-proxy.c similarity index 100% rename from src/libevent/sample/le-proxy.c rename to src/libevent-modified/sample/le-proxy.c diff --git a/src/libevent/sample/signal-test.c b/src/libevent-modified/sample/signal-test.c similarity index 100% rename from src/libevent/sample/signal-test.c rename to src/libevent-modified/sample/signal-test.c diff --git a/src/libevent/sample/time-test.c b/src/libevent-modified/sample/time-test.c similarity index 100% rename from src/libevent/sample/time-test.c rename to src/libevent-modified/sample/time-test.c diff --git a/src/libevent/select.c b/src/libevent-modified/select.c similarity index 100% rename from src/libevent/select.c rename to src/libevent-modified/select.c diff --git a/src/libevent/signal.c b/src/libevent-modified/signal.c similarity index 100% rename from src/libevent/signal.c rename to src/libevent-modified/signal.c diff --git a/src/libevent/strlcpy-internal.h b/src/libevent-modified/strlcpy-internal.h similarity index 100% rename from src/libevent/strlcpy-internal.h rename to src/libevent-modified/strlcpy-internal.h diff --git a/src/libevent/strlcpy.c b/src/libevent-modified/strlcpy.c similarity index 100% rename from src/libevent/strlcpy.c rename to src/libevent-modified/strlcpy.c diff --git a/src/libevent/test/Makefile.am b/src/libevent-modified/test/Makefile.am similarity index 91% rename from src/libevent/test/Makefile.am rename to src/libevent-modified/test/Makefile.am index b10c41a8..08c2ade9 100644 --- a/src/libevent/test/Makefile.am +++ b/src/libevent-modified/test/Makefile.am @@ -19,7 +19,14 @@ endif EXTRA_PROGRAMS = regress noinst_HEADERS = tinytest.h tinytest_macros.h regress.h tinytest_local.h -TESTS = $(top_srcdir)/test/test.sh +# We need to copy this file, since automake doesn't want us to use top_srcdir +# in TESTS. +TESTS = test-script.sh + +test-script.sh: test.sh + cp $< $@ + +DISTCLEANFILES = test-script.sh BUILT_SOURCES = if BUILD_REGRESS @@ -39,7 +46,7 @@ test_time_LDADD = ../libevent_core.la test_ratelim_SOURCES = test-ratelim.c test_ratelim_LDADD = ../libevent_core.la -lm -regress_SOURCES = regress.c regress_buffer.c regress_http.c regress_dns.c \ +regress_SOURCES = regress.c regress_buffer.c regress_http.c \ regress_testutils.c regress_testutils.h \ regress_rpc.c regress.gen.c regress.gen.h regress_et.c \ regress_bufferevent.c regress_listener.c \ @@ -91,7 +98,7 @@ rpcgen-attempted: $(srcdir)/regress.rpc $(srcdir)/../event_rpcgen.py $(srcdir)/r CLEANFILES = rpcgen-attempted -DISTCLEANFILES = *~ +DISTCLEANFILES += *~ verify: check diff --git a/src/libevent/test/Makefile.nmake b/src/libevent-modified/test/Makefile.nmake similarity index 100% rename from src/libevent/test/Makefile.nmake rename to src/libevent-modified/test/Makefile.nmake diff --git a/src/libevent/test/bench.c b/src/libevent-modified/test/bench.c similarity index 100% rename from src/libevent/test/bench.c rename to src/libevent-modified/test/bench.c diff --git a/src/libevent/test/bench_cascade.c b/src/libevent-modified/test/bench_cascade.c similarity index 100% rename from src/libevent/test/bench_cascade.c rename to src/libevent-modified/test/bench_cascade.c diff --git a/src/libevent/test/bench_http.c b/src/libevent-modified/test/bench_http.c similarity index 100% rename from src/libevent/test/bench_http.c rename to src/libevent-modified/test/bench_http.c diff --git a/src/libevent/test/bench_httpclient.c b/src/libevent-modified/test/bench_httpclient.c similarity index 100% rename from src/libevent/test/bench_httpclient.c rename to src/libevent-modified/test/bench_httpclient.c diff --git a/src/libevent/test/regress.c b/src/libevent-modified/test/regress.c similarity index 100% rename from src/libevent/test/regress.c rename to src/libevent-modified/test/regress.c diff --git a/src/libevent/test/regress.gen.c b/src/libevent-modified/test/regress.gen.c similarity index 100% rename from src/libevent/test/regress.gen.c rename to src/libevent-modified/test/regress.gen.c diff --git a/src/libevent/test/regress.gen.h b/src/libevent-modified/test/regress.gen.h similarity index 100% rename from src/libevent/test/regress.gen.h rename to src/libevent-modified/test/regress.gen.h diff --git a/src/libevent/test/regress.h b/src/libevent-modified/test/regress.h similarity index 100% rename from src/libevent/test/regress.h rename to src/libevent-modified/test/regress.h diff --git a/src/libevent/test/regress.rpc b/src/libevent-modified/test/regress.rpc similarity index 100% rename from src/libevent/test/regress.rpc rename to src/libevent-modified/test/regress.rpc diff --git a/src/libevent/test/regress_buffer.c b/src/libevent-modified/test/regress_buffer.c similarity index 99% rename from src/libevent/test/regress_buffer.c rename to src/libevent-modified/test/regress_buffer.c index 99a8c0ea..d7cc5385 100644 --- a/src/libevent/test/regress_buffer.c +++ b/src/libevent-modified/test/regress_buffer.c @@ -244,7 +244,7 @@ test_evbuffer(void *ptr) if (memcmp(evbuffer_pullup( evb, -1), buffer, sizeof(buffer) / 2) != 0 || memcmp(evbuffer_pullup( - evb_two, -1), buffer, sizeof(buffer) != 0)) + evb_two, -1), buffer, sizeof(buffer)) != 0) tt_abort_msg("Pullup did not preserve content"); evbuffer_validate(evb); diff --git a/src/libevent/test/regress_bufferevent.c b/src/libevent-modified/test/regress_bufferevent.c similarity index 100% rename from src/libevent/test/regress_bufferevent.c rename to src/libevent-modified/test/regress_bufferevent.c diff --git a/src/libevent/test/regress_dns.c b/src/libevent-modified/test/regress_dns.c similarity index 100% rename from src/libevent/test/regress_dns.c rename to src/libevent-modified/test/regress_dns.c diff --git a/src/libevent/test/regress_et.c b/src/libevent-modified/test/regress_et.c similarity index 100% rename from src/libevent/test/regress_et.c rename to src/libevent-modified/test/regress_et.c diff --git a/src/libevent/test/regress_http.c b/src/libevent-modified/test/regress_http.c similarity index 99% rename from src/libevent/test/regress_http.c rename to src/libevent-modified/test/regress_http.c index cc3bf27a..9ece455b 100644 --- a/src/libevent/test/regress_http.c +++ b/src/libevent-modified/test/regress_http.c @@ -3013,16 +3013,21 @@ http_stream_in_cancel_test(void *arg) static void http_connection_fail_done(struct evhttp_request *req, void *arg) { + struct evhttp_connection *evcon = arg; + struct event_base *base = evhttp_connection_get_base(evcon); + /* An ENETUNREACH error results in an unrecoverable * evhttp_connection error (see evhttp_connection_fail()). The * connection will be reset, and the user will be notified with a NULL * req parameter. */ tt_assert(!req); + evhttp_connection_free(evcon); + test_ok = 1; end: - event_base_loopexit(arg, NULL); + event_base_loopexit(base, NULL); } /* Test unrecoverable evhttp_connection errors by generating an ENETUNREACH @@ -3053,7 +3058,7 @@ http_connection_fail_test(void *arg) * server using our make request method. */ - req = evhttp_request_new(http_connection_fail_done, data->base); + req = evhttp_request_new(http_connection_fail_done, evcon); tt_assert(req); if (evhttp_make_request(evcon, req, EVHTTP_REQ_GET, "/") == -1) { @@ -3065,8 +3070,7 @@ http_connection_fail_test(void *arg) tt_int_op(test_ok, ==, 1); end: - if (evcon) - evhttp_connection_free(evcon); + ; } static void diff --git a/src/libevent/test/regress_iocp.c b/src/libevent-modified/test/regress_iocp.c similarity index 100% rename from src/libevent/test/regress_iocp.c rename to src/libevent-modified/test/regress_iocp.c diff --git a/src/libevent/test/regress_listener.c b/src/libevent-modified/test/regress_listener.c similarity index 100% rename from src/libevent/test/regress_listener.c rename to src/libevent-modified/test/regress_listener.c diff --git a/src/libevent/test/regress_main.c b/src/libevent-modified/test/regress_main.c similarity index 99% rename from src/libevent/test/regress_main.c rename to src/libevent-modified/test/regress_main.c index 1649e9df..644f8e7d 100644 --- a/src/libevent/test/regress_main.c +++ b/src/libevent-modified/test/regress_main.c @@ -370,7 +370,6 @@ struct testgroup_t testgroups[] = { { "util/", util_testcases }, { "bufferevent/", bufferevent_testcases }, { "http/", http_testcases }, - { "dns/", dns_testcases }, { "evtag/", evtag_testcases }, { "rpc/", rpc_testcases }, { "thread/", thread_testcases }, diff --git a/src/libevent/test/regress_minheap.c b/src/libevent-modified/test/regress_minheap.c similarity index 100% rename from src/libevent/test/regress_minheap.c rename to src/libevent-modified/test/regress_minheap.c diff --git a/src/libevent/test/regress_rpc.c b/src/libevent-modified/test/regress_rpc.c similarity index 100% rename from src/libevent/test/regress_rpc.c rename to src/libevent-modified/test/regress_rpc.c diff --git a/src/libevent/test/regress_ssl.c b/src/libevent-modified/test/regress_ssl.c similarity index 100% rename from src/libevent/test/regress_ssl.c rename to src/libevent-modified/test/regress_ssl.c diff --git a/src/libevent/test/regress_testutils.c b/src/libevent-modified/test/regress_testutils.c similarity index 100% rename from src/libevent/test/regress_testutils.c rename to src/libevent-modified/test/regress_testutils.c diff --git a/src/libevent/test/regress_testutils.h b/src/libevent-modified/test/regress_testutils.h similarity index 100% rename from src/libevent/test/regress_testutils.h rename to src/libevent-modified/test/regress_testutils.h diff --git a/src/libevent/test/regress_thread.c b/src/libevent-modified/test/regress_thread.c similarity index 100% rename from src/libevent/test/regress_thread.c rename to src/libevent-modified/test/regress_thread.c diff --git a/src/libevent/test/regress_util.c b/src/libevent-modified/test/regress_util.c similarity index 100% rename from src/libevent/test/regress_util.c rename to src/libevent-modified/test/regress_util.c diff --git a/src/libevent/test/regress_zlib.c b/src/libevent-modified/test/regress_zlib.c similarity index 100% rename from src/libevent/test/regress_zlib.c rename to src/libevent-modified/test/regress_zlib.c diff --git a/src/libevent/test/rpcgen_wrapper.sh b/src/libevent-modified/test/rpcgen_wrapper.sh similarity index 100% rename from src/libevent/test/rpcgen_wrapper.sh rename to src/libevent-modified/test/rpcgen_wrapper.sh diff --git a/src/libevent/test/test-changelist.c b/src/libevent-modified/test/test-changelist.c similarity index 100% rename from src/libevent/test/test-changelist.c rename to src/libevent-modified/test/test-changelist.c diff --git a/src/libevent/test/test-eof.c b/src/libevent-modified/test/test-eof.c similarity index 100% rename from src/libevent/test/test-eof.c rename to src/libevent-modified/test/test-eof.c diff --git a/src/libevent/test/test-init.c b/src/libevent-modified/test/test-init.c similarity index 100% rename from src/libevent/test/test-init.c rename to src/libevent-modified/test/test-init.c diff --git a/src/libevent/test/test-ratelim.c b/src/libevent-modified/test/test-ratelim.c similarity index 100% rename from src/libevent/test/test-ratelim.c rename to src/libevent-modified/test/test-ratelim.c diff --git a/src/libevent/test/test-time.c b/src/libevent-modified/test/test-time.c similarity index 100% rename from src/libevent/test/test-time.c rename to src/libevent-modified/test/test-time.c diff --git a/src/libevent/test/test-weof.c b/src/libevent-modified/test/test-weof.c similarity index 100% rename from src/libevent/test/test-weof.c rename to src/libevent-modified/test/test-weof.c diff --git a/src/libevent/test/test.sh b/src/libevent-modified/test/test.sh similarity index 100% rename from src/libevent/test/test.sh rename to src/libevent-modified/test/test.sh diff --git a/src/libevent/test/tinytest.c b/src/libevent-modified/test/tinytest.c similarity index 100% rename from src/libevent/test/tinytest.c rename to src/libevent-modified/test/tinytest.c diff --git a/src/libevent/test/tinytest.h b/src/libevent-modified/test/tinytest.h similarity index 100% rename from src/libevent/test/tinytest.h rename to src/libevent-modified/test/tinytest.h diff --git a/src/libevent/test/tinytest_local.h b/src/libevent-modified/test/tinytest_local.h similarity index 100% rename from src/libevent/test/tinytest_local.h rename to src/libevent-modified/test/tinytest_local.h diff --git a/src/libevent/test/tinytest_macros.h b/src/libevent-modified/test/tinytest_macros.h similarity index 100% rename from src/libevent/test/tinytest_macros.h rename to src/libevent-modified/test/tinytest_macros.h diff --git a/src/libevent/util-internal.h b/src/libevent-modified/util-internal.h similarity index 100% rename from src/libevent/util-internal.h rename to src/libevent-modified/util-internal.h diff --git a/src/libevent/whatsnew-2.0.txt b/src/libevent-modified/whatsnew-2.0.txt similarity index 100% rename from src/libevent/whatsnew-2.0.txt rename to src/libevent-modified/whatsnew-2.0.txt diff --git a/src/libevent/win32select.c b/src/libevent-modified/win32select.c similarity index 99% rename from src/libevent/win32select.c rename to src/libevent-modified/win32select.c index 00ce27af..1743b01e 100644 --- a/src/libevent/win32select.c +++ b/src/libevent-modified/win32select.c @@ -372,6 +372,6 @@ win32_dealloc(struct event_base *_base) mm_free(win32op->exset_out); /* XXXXX free the tree. */ - memset(win32op, 0, sizeof(win32op)); + memset(win32op, 0, sizeof(*win32op)); mm_free(win32op); } diff --git a/src/libnacl/MACROS b/src/libnacl/MACROS deleted file mode 100644 index 26f6cd02..00000000 --- a/src/libnacl/MACROS +++ /dev/null @@ -1,56 +0,0 @@ -crypto_verify -crypto_verify_BYTES -crypto_core -crypto_core_OUTPUTBYTES -crypto_core_INPUTBYTES -crypto_core_KEYBYTES -crypto_core_CONSTBYTES -crypto_hashblocks -crypto_hashblocks_STATEBYTES -crypto_hashblocks_BLOCKBYTES -crypto_hash -crypto_hash_BYTES -crypto_stream -crypto_stream_xor -crypto_stream_beforenm -crypto_stream_afternm -crypto_stream_xor_afternm -crypto_stream_KEYBYTES -crypto_stream_NONCEBYTES -crypto_stream_BEFORENMBYTES -crypto_onetimeauth -crypto_onetimeauth_verify -crypto_onetimeauth_BYTES -crypto_onetimeauth_KEYBYTES -crypto_auth -crypto_auth_verify -crypto_auth_BYTES -crypto_auth_KEYBYTES -crypto_secretbox -crypto_secretbox_open -crypto_secretbox_KEYBYTES -crypto_secretbox_NONCEBYTES -crypto_secretbox_ZEROBYTES -crypto_secretbox_BOXZEROBYTES -crypto_scalarmult -crypto_scalarmult_base -crypto_scalarmult_BYTES -crypto_scalarmult_SCALARBYTES -crypto_box -crypto_box_open -crypto_box_keypair -crypto_box_beforenm -crypto_box_afternm -crypto_box_open_afternm -crypto_box_PUBLICKEYBYTES -crypto_box_SECRETKEYBYTES -crypto_box_BEFORENMBYTES -crypto_box_NONCEBYTES -crypto_box_ZEROBYTES -crypto_box_BOXZEROBYTES -crypto_sign -crypto_sign_open -crypto_sign_keypair -crypto_sign_BYTES -crypto_sign_PUBLICKEYBYTES -crypto_sign_SECRETKEYBYTES diff --git a/src/libnacl/Makefile.in b/src/libnacl/Makefile.in deleted file mode 100644 index d785e86a..00000000 --- a/src/libnacl/Makefile.in +++ /dev/null @@ -1,44 +0,0 @@ - -all: .done - -.done: - ./do - touch .done - -test: - cd tests && $(MAKE) $(AM_MAKEFLAGS) test - -clean: - cd tests && $(MAKE) $(AM_MAKEFLAGS) clean - -$(RM) .done - -$(RM) -r okcompilers/bin - -$(RM) -r okcompilers/oldbin - -$(RM) -r build/* - -distclean: clean - cd tests && $(MAKE) $(AM_MAKEFLAGS) distclean - -$(RM) okcompilers/c - -$(RM) okcompilers/do - -install: -install-data: -install-exec: -uninstall: -install-dvi: -install-html: -install-info: -install-ps: -install-pdf: -installdirs: -check: -installcheck: -mostlyclean: clean -maintainer-clean: distclean - -distdir: - while read dir ; do @MKDIR_P@ "$(distdir)/$$dir" ; done < dist-dirs - while read file ; do @INSTALL@ "$$file" "$(distdir)/$$file" ; done < dist-files - -EMPTY_AUTOMAKE_TARGETS = dvi pdf ps info html tags ctags -.PHONY: $(EMPTY_AUTOMAKE_TARGETS) -$(EMPTY_AUTOMAKE_TARGETS): diff --git a/src/libnacl/OPERATIONS b/src/libnacl/OPERATIONS deleted file mode 100644 index 5fc25d35..00000000 --- a/src/libnacl/OPERATIONS +++ /dev/null @@ -1,11 +0,0 @@ -crypto_verify -crypto_core -crypto_hashblocks -crypto_hash -crypto_stream -crypto_onetimeauth -crypto_auth -crypto_secretbox -crypto_scalarmult -crypto_box -crypto_sign diff --git a/src/libnacl/PROTOTYPES.c b/src/libnacl/PROTOTYPES.c deleted file mode 100644 index bc8ca531..00000000 --- a/src/libnacl/PROTOTYPES.c +++ /dev/null @@ -1,26 +0,0 @@ -extern int crypto_verify(const unsigned char *,const unsigned char *); -extern int crypto_core(unsigned char *,const unsigned char *,const unsigned char *,const unsigned char *); -extern int crypto_hashblocks(unsigned char *,const unsigned char *,unsigned long long); -extern int crypto_hash(unsigned char *,const unsigned char *,unsigned long long); -extern int crypto_stream(unsigned char *,unsigned long long,const unsigned char *,const unsigned char *); -extern int crypto_stream_xor(unsigned char *,const unsigned char *,unsigned long long,const unsigned char *,const unsigned char *); -extern int crypto_stream_beforenm(unsigned char *,const unsigned char *); -extern int crypto_stream_afternm(unsigned char *,unsigned long long,const unsigned char *,const unsigned char *); -extern int crypto_stream_xor_afternm(unsigned char *,const unsigned char *,unsigned long long,const unsigned char *,const unsigned char *); -extern int crypto_onetimeauth(unsigned char *,const unsigned char *,unsigned long long,const unsigned char *); -extern int crypto_onetimeauth_verify(const unsigned char *,const unsigned char *,unsigned long long,const unsigned char *); -extern int crypto_auth(unsigned char *,const unsigned char *,unsigned long long,const unsigned char *); -extern int crypto_auth_verify(const unsigned char *,const unsigned char *,unsigned long long,const unsigned char *); -extern int crypto_secretbox(unsigned char *,const unsigned char *,unsigned long long,const unsigned char *,const unsigned char *); -extern int crypto_secretbox_open(unsigned char *,const unsigned char *,unsigned long long,const unsigned char *,const unsigned char *); -extern int crypto_scalarmult(unsigned char *,const unsigned char *,const unsigned char *); -extern int crypto_scalarmult_base(unsigned char *,const unsigned char *); -extern int crypto_box(unsigned char *,const unsigned char *,unsigned long long,const unsigned char *,const unsigned char *,const unsigned char *); -extern int crypto_box_open(unsigned char *,const unsigned char *,unsigned long long,const unsigned char *,const unsigned char *,const unsigned char *); -extern int crypto_box_keypair(unsigned char *,unsigned char *); -extern int crypto_box_beforenm(unsigned char *,const unsigned char *,const unsigned char *); -extern int crypto_box_afternm(unsigned char *,const unsigned char *,unsigned long long,const unsigned char *,const unsigned char *); -extern int crypto_box_open_afternm(unsigned char *,const unsigned char *,unsigned long long,const unsigned char *,const unsigned char *); -extern int crypto_sign(unsigned char *,unsigned long long *,const unsigned char *,unsigned long long,const unsigned char *); -extern int crypto_sign_open(unsigned char *,unsigned long long *,const unsigned char *,unsigned long long,const unsigned char *); -extern int crypto_sign_keypair(unsigned char *,unsigned char *); diff --git a/src/libnacl/commandline/nacl-sha256.c b/src/libnacl/commandline/nacl-sha256.c deleted file mode 100644 index 8e0df453..00000000 --- a/src/libnacl/commandline/nacl-sha256.c +++ /dev/null @@ -1,64 +0,0 @@ -/* -commandline/nacl-sha256.c version 20080713 -D. J. Bernstein -Public domain. -*/ - -#include -#include -#include -#include -#include -#include -#include -#include "crypto_hash_sha256.h" - -unsigned char *input; -unsigned long long inputalloc; -unsigned long long inputlen; - -unsigned char h[crypto_hash_sha256_BYTES]; - -void h_print(void) -{ - int i; - for (i = 0;i < crypto_hash_sha256_BYTES;++i) printf("%02x",255 & (int) h[i]); - printf("\n"); -} - -int main() -{ - struct stat st; - int ch; - - if (fstat(0,&st) == 0) { - input = mmap(0,st.st_size,PROT_READ,MAP_SHARED,0,0); - if (input != MAP_FAILED) { - crypto_hash_sha256(h,input,st.st_size); - h_print(); - return 0; - } - } - - input = 0; - inputalloc = 0; - inputlen = 0; - - while ((ch = getchar()) != EOF) { - if (inputlen >= inputalloc) { - void *newinput; - while (inputlen >= inputalloc) - inputalloc = inputalloc * 2 + 1; - if (posix_memalign(&newinput,16,inputalloc) != 0) return 111; - memcpy(newinput,input,inputlen); - free(input); - input = newinput; - } - input[inputlen++] = ch; - } - - crypto_hash_sha256(h,input,inputlen); - h_print(); - - return 0; -} diff --git a/src/libnacl/commandline/nacl-sha512.c b/src/libnacl/commandline/nacl-sha512.c deleted file mode 100644 index 6864c76a..00000000 --- a/src/libnacl/commandline/nacl-sha512.c +++ /dev/null @@ -1,64 +0,0 @@ -/* -commandline/nacl-sha512.c version 20080713 -D. J. Bernstein -Public domain. -*/ - -#include -#include -#include -#include -#include -#include -#include -#include "crypto_hash_sha512.h" - -unsigned char *input; -unsigned long long inputalloc; -unsigned long long inputlen; - -unsigned char h[crypto_hash_sha512_BYTES]; - -void h_print(void) -{ - int i; - for (i = 0;i < crypto_hash_sha512_BYTES;++i) printf("%02x",255 & (int) h[i]); - printf("\n"); -} - -int main() -{ - struct stat st; - int ch; - - if (fstat(0,&st) == 0) { - input = mmap(0,st.st_size,PROT_READ,MAP_SHARED,0,0); - if (input != MAP_FAILED) { - crypto_hash_sha512(h,input,st.st_size); - h_print(); - return 0; - } - } - - input = 0; - inputalloc = 0; - inputlen = 0; - - while ((ch = getchar()) != EOF) { - if (inputlen >= inputalloc) { - void *newinput; - while (inputlen >= inputalloc) - inputalloc = inputalloc * 2 + 1; - if (posix_memalign(&newinput,16,inputalloc) != 0) return 111; - memcpy(newinput,input,inputlen); - free(input); - input = newinput; - } - input[inputlen++] = ch; - } - - crypto_hash_sha512(h,input,inputlen); - h_print(); - - return 0; -} diff --git a/src/libnacl/cpucycles/alpha.c b/src/libnacl/cpucycles/alpha.c deleted file mode 100644 index ef497999..00000000 --- a/src/libnacl/cpucycles/alpha.c +++ /dev/null @@ -1,80 +0,0 @@ -/* -cpucycles/alpha.c version 20060316 -D. J. Bernstein -Public domain. -*/ - -#include -#include -#include - -static long long tod(void) -{ - struct timeval t; - gettimeofday(&t,(struct timezone *) 0); - return t.tv_sec * (long long) 1000000 + t.tv_usec; -} - -static long long rpcc(void) -{ - unsigned long long t; - asm volatile("rpcc %0" : "=r"(t)); - return t & 0xffffffff; -} - -static long long firstrpcc; -static long long firsttod; -static long long lastrpcc; -static long long lasttod; -static double mhz = 0; - -static void init(void) -{ - firstrpcc = rpcc(); - firsttod = tod(); - - do { - lastrpcc = rpcc(); - lasttod = tod(); - } while (lasttod - firsttod < 10000); - - lastrpcc -= firstrpcc; lastrpcc &= 0xffffffff; - lasttod -= firsttod; - - mhz = (double) lastrpcc / (double) lasttod; -} - -long long cpucycles_alpha(void) -{ - double x; - long long y; - - if (!mhz) init(); - - lastrpcc = rpcc(); - lasttod = tod(); - - lastrpcc -= firstrpcc; lastrpcc &= 0xffffffff; - lasttod -= firsttod; - - /* Number of cycles since firstrpcc is lastrpcc + 2^32 y for unknown y. */ - /* Number of microseconds since firsttod is lasttod. */ - - x = (lasttod * mhz - lastrpcc) * 0.00000000023283064365386962890625; - y = x; - while (x > y + 0.5) y += 1; - while (x < y - 0.5) y -= 1; - - y *= 4294967296ULL; - lastrpcc += y; - - mhz = (double) lastrpcc / (double) lasttod; - - return firstrpcc + lastrpcc; -} - -long long cpucycles_alpha_persecond(void) -{ - if (!mhz) init(); - return 1000000.0 * mhz; -} diff --git a/src/libnacl/cpucycles/alpha.h b/src/libnacl/cpucycles/alpha.h deleted file mode 100644 index c97672af..00000000 --- a/src/libnacl/cpucycles/alpha.h +++ /dev/null @@ -1,27 +0,0 @@ -/* -cpucycles alpha.h version 20060318 -D. J. Bernstein -Public domain. -*/ - -#ifndef CPUCYCLES_alpha_h -#define CPUCYCLES_alpha_h - -#ifdef __cplusplus -extern "C" { -#endif - -extern long long cpucycles_alpha(void); -extern long long cpucycles_alpha_persecond(void); - -#ifdef __cplusplus -} -#endif - -#ifndef cpucycles_implementation -#define cpucycles_implementation "alpha" -#define cpucycles cpucycles_alpha -#define cpucycles_persecond cpucycles_alpha_persecond -#endif - -#endif diff --git a/src/libnacl/cpucycles/amd64cpuinfo.c b/src/libnacl/cpucycles/amd64cpuinfo.c deleted file mode 100644 index 729f2612..00000000 --- a/src/libnacl/cpucycles/amd64cpuinfo.c +++ /dev/null @@ -1,16 +0,0 @@ -#include -#include -#include "osfreq.c" - -long long cpucycles_amd64cpuinfo(void) -{ - unsigned long long result; - asm volatile(".byte 15;.byte 49;shlq $32,%%rdx;orq %%rdx,%%rax" - : "=a" (result) :: "%rdx"); - return result; -} - -long long cpucycles_amd64cpuinfo_persecond(void) -{ - return osfreq(); -} diff --git a/src/libnacl/cpucycles/amd64cpuinfo.h b/src/libnacl/cpucycles/amd64cpuinfo.h deleted file mode 100644 index 8f858ae7..00000000 --- a/src/libnacl/cpucycles/amd64cpuinfo.h +++ /dev/null @@ -1,27 +0,0 @@ -/* -cpucycles amd64cpuinfo.h version 20100803 -D. J. Bernstein -Public domain. -*/ - -#ifndef CPUCYCLES_amd64cpuinfo_h -#define CPUCYCLES_amd64cpuinfo_h - -#ifdef __cplusplus -extern "C" { -#endif - -extern long long cpucycles_amd64cpuinfo(void); -extern long long cpucycles_amd64cpuinfo_persecond(void); - -#ifdef __cplusplus -} -#endif - -#ifndef cpucycles_implementation -#define cpucycles_implementation "amd64cpuinfo" -#define cpucycles cpucycles_amd64cpuinfo -#define cpucycles_persecond cpucycles_amd64cpuinfo_persecond -#endif - -#endif diff --git a/src/libnacl/cpucycles/amd64cpuspeed.c b/src/libnacl/cpucycles/amd64cpuspeed.c deleted file mode 100644 index 7e89511c..00000000 --- a/src/libnacl/cpucycles/amd64cpuspeed.c +++ /dev/null @@ -1,25 +0,0 @@ -#include -#include -#include -#include - -long long cpucycles_amd64cpuspeed(void) -{ - unsigned long long result; - asm volatile(".byte 15;.byte 49;shlq $32,%%rdx;orq %%rdx,%%rax" - : "=a" (result) :: "%rdx"); - return result; -} - -long long cpucycles_amd64cpuspeed_persecond(void) -{ - int oid[2]; - int val; - size_t size; - oid[0] = CTL_HW; - oid[1] = HW_CPUSPEED; - size = sizeof val; - if (sysctl(oid,2,&val,&size,0,0) == -1) return 0; - if (size != sizeof val) return 0; - return val * 1000000LL; -} diff --git a/src/libnacl/cpucycles/amd64cpuspeed.h b/src/libnacl/cpucycles/amd64cpuspeed.h deleted file mode 100644 index 1f6ed54d..00000000 --- a/src/libnacl/cpucycles/amd64cpuspeed.h +++ /dev/null @@ -1,27 +0,0 @@ -/* -cpucycles amd64cpuspeed.h version 20090716 -Matthew Dempsky -Public domain. -*/ - -#ifndef CPUCYCLES_amd64cpuspeed_h -#define CPUCYCLES_amd64cpuspeed_h - -#ifdef __cplusplus -extern "C" { -#endif - -extern long long cpucycles_amd64cpuspeed(void); -extern long long cpucycles_amd64cpuspeed_persecond(void); - -#ifdef __cplusplus -} -#endif - -#ifndef cpucycles_implementation -#define cpucycles_implementation "amd64cpuspeed" -#define cpucycles cpucycles_amd64cpuspeed -#define cpucycles_persecond cpucycles_amd64cpuspeed_persecond -#endif - -#endif diff --git a/src/libnacl/cpucycles/amd64tscfreq.c b/src/libnacl/cpucycles/amd64tscfreq.c deleted file mode 100644 index ef182c1b..00000000 --- a/src/libnacl/cpucycles/amd64tscfreq.c +++ /dev/null @@ -1,18 +0,0 @@ -#include -#include - -long long cpucycles_amd64tscfreq(void) -{ - unsigned long long result; - asm volatile(".byte 15;.byte 49;shlq $32,%%rdx;orq %%rdx,%%rax" - : "=a" (result) :: "%rdx"); - return result; -} - -long long cpucycles_amd64tscfreq_persecond(void) -{ - long result = 0; - size_t resultlen = sizeof(long); - sysctlbyname("machdep.tsc_freq",&result,&resultlen,0,0); - return result; -} diff --git a/src/libnacl/cpucycles/amd64tscfreq.h b/src/libnacl/cpucycles/amd64tscfreq.h deleted file mode 100644 index a3c7aa6f..00000000 --- a/src/libnacl/cpucycles/amd64tscfreq.h +++ /dev/null @@ -1,27 +0,0 @@ -/* -cpucycles amd64tscfreq.h version 20060318 -D. J. Bernstein -Public domain. -*/ - -#ifndef CPUCYCLES_amd64tscfreq_h -#define CPUCYCLES_amd64tscfreq_h - -#ifdef __cplusplus -extern "C" { -#endif - -extern long long cpucycles_amd64tscfreq(void); -extern long long cpucycles_amd64tscfreq_persecond(void); - -#ifdef __cplusplus -} -#endif - -#ifndef cpucycles_implementation -#define cpucycles_implementation "amd64tscfreq" -#define cpucycles cpucycles_amd64tscfreq -#define cpucycles_persecond cpucycles_amd64tscfreq_persecond -#endif - -#endif diff --git a/src/libnacl/cpucycles/celllinux.c b/src/libnacl/cpucycles/celllinux.c deleted file mode 100644 index 83a0c38a..00000000 --- a/src/libnacl/cpucycles/celllinux.c +++ /dev/null @@ -1,83 +0,0 @@ -#include -#include -#include -#include -#include -#include - -static long myround(double u) -{ - long result = u; - while (result + 0.5 < u) result += 1; - while (result - 0.5 > u) result -= 1; - return result; -} - -static long long microseconds(void) -{ - struct timeval t; - gettimeofday(&t,(struct timezone *) 0); - return t.tv_sec * (long long) 1000000 + t.tv_usec; -} - -static long long timebase(void) -{ - unsigned long long result; - result = -spu_read_decrementer(); - return 0xffffffff & result; -} - -static double cpufrequency = 0; -static long tbcycles = 0; - -static double guesstbcycles(void) -{ - long long tb0; long long us0; - long long tb1; long long us1; - - tb0 = timebase(); - us0 = microseconds(); - do { - tb1 = timebase(); - us1 = microseconds(); - } while (us1 - us0 < 10000 || tb1 - tb0 < 1000); - if (tb1 <= tb0) return 0; - tb1 -= tb0; - us1 -= us0; - return (cpufrequency * 0.000001 * (double) us1) / (double) tb1; -} - -static void init(void) -{ - int loop; - double guess1; - double guess2; - - spu_write_decrementer(0xffffffff); - - cpufrequency = 3192000000.0; - - for (loop = 0;loop < 100;++loop) { - guess1 = guesstbcycles(); - guess2 = guesstbcycles(); - tbcycles = myround(guess1); - if (guess1 - tbcycles > 0.1) continue; - if (tbcycles - guess1 > 0.1) continue; - if (guess2 - tbcycles > 0.1) continue; - if (tbcycles - guess2 > 0.1) continue; - return; - } - tbcycles = 0; -} - -long long cpucycles_celllinux(void) -{ - if (!tbcycles) init(); - return timebase() * tbcycles; -} - -long long cpucycles_celllinux_persecond(void) -{ - if (!tbcycles) init(); - return cpufrequency; -} diff --git a/src/libnacl/cpucycles/celllinux.h b/src/libnacl/cpucycles/celllinux.h deleted file mode 100644 index 75a5a3f2..00000000 --- a/src/libnacl/cpucycles/celllinux.h +++ /dev/null @@ -1,27 +0,0 @@ -/* -cpucycles celllinux.h version 20081201 -D. J. Bernstein -Public domain. -*/ - -#ifndef CPUCYCLES_celllinux_h -#define CPUCYCLES_celllinux_h - -#ifdef __cplusplus -extern "C" { -#endif - -extern long long cpucycles_celllinux(void); -extern long long cpucycles_celllinux_persecond(void); - -#ifdef __cplusplus -} -#endif - -#ifndef cpucycles_implementation -#define cpucycles_implementation "celllinux" -#define cpucycles cpucycles_celllinux -#define cpucycles_persecond cpucycles_celllinux_persecond -#endif - -#endif diff --git a/src/libnacl/cpucycles/cortex.c b/src/libnacl/cpucycles/cortex.c deleted file mode 100644 index ef1a42cd..00000000 --- a/src/libnacl/cpucycles/cortex.c +++ /dev/null @@ -1,73 +0,0 @@ -/* -cpucycles/cortex.c version 20101203 -D. J. Bernstein -Public domain. -*/ - -#define SCALE 1 -#include -#include -#include - -static int enabled = 0; - -static int prev[3]; -static unsigned long long prevcycles = 0; -static int now[3]; -static long long cyclespersec = 0; - -static void readticks(unsigned int *result) -{ - struct timeval t; - unsigned int cc; - if (!enabled) { - asm volatile("mcr p15, 0, %0, c9, c12, 0" :: "r"(17)); - asm volatile("mcr p15, 0, %0, c9, c12, 1" :: "r"(0x8000000f)); - asm volatile("mcr p15, 0, %0, c9, c12, 3" :: "r"(0x8000000f)); - enabled = 1; - } - asm volatile("mrc p15, 0, %0, c9, c13, 0" : "=r"(cc)); - gettimeofday(&t,(struct timezone *) 0); - result[0] = cc; - result[1] = t.tv_usec; - result[2] = t.tv_sec; -} - -long long cpucycles_cortex(void) -{ - unsigned long long delta4; - int deltan; - int deltas; - unsigned long long guesscycles; - - readticks(now); - delta4 = (unsigned int) (now[0] - prev[0]); /* unsigned change in number of cycles mod 2^32 */ - deltan = now[1] - prev[1]; /* signed change in number of nanoseconds mod 10^9 */ - deltas = now[2] - prev[2]; /* signed change in number of seconds */ - if ((deltas == 0 && deltan < 200000) || (deltas == 1 && deltan < -800000)) - return (prevcycles + delta4) * SCALE; - - prev[0] = now[0]; - prev[1] = now[1]; - prev[2] = now[2]; - - if ((deltas == 0 && deltan < 300000) || (deltas == 1 && deltan < -700000)) { - // actual number of cycles cannot have increased by 2^32 in <0.3ms - cyclespersec = 1000000 * (unsigned long long) delta4; - cyclespersec /= deltan + 1000000 * (long long) deltas; - } else { - guesscycles = deltas * cyclespersec; - guesscycles += (deltan * cyclespersec) / 1000000; - while (delta4 + 2147483648ULL < guesscycles) delta4 += 4294967296ULL; - /* XXX: could do longer-term extrapolation here */ - } - - prevcycles += delta4; - return prevcycles * SCALE; -} - -long long cpucycles_cortex_persecond(void) -{ - while (!cyclespersec) cpucycles_cortex(); - return cyclespersec * SCALE; -} diff --git a/src/libnacl/cpucycles/cortex.h b/src/libnacl/cpucycles/cortex.h deleted file mode 100644 index e622f132..00000000 --- a/src/libnacl/cpucycles/cortex.h +++ /dev/null @@ -1,27 +0,0 @@ -/* -cpucycles cortex.h version 20100912 -D. J. Bernstein -Public domain. -*/ - -#ifndef CPUCYCLES_cortex_h -#define CPUCYCLES_cortex_h - -#ifdef __cplusplus -extern "C" { -#endif - -extern long long cpucycles_cortex(void); -extern long long cpucycles_cortex_persecond(void); - -#ifdef __cplusplus -} -#endif - -#ifndef cpucycles_implementation -#define cpucycles_implementation "cortex" -#define cpucycles cpucycles_cortex -#define cpucycles_persecond cpucycles_cortex_persecond -#endif - -#endif diff --git a/src/libnacl/cpucycles/dev4ns.c b/src/libnacl/cpucycles/dev4ns.c deleted file mode 100644 index 08dd562b..00000000 --- a/src/libnacl/cpucycles/dev4ns.c +++ /dev/null @@ -1,62 +0,0 @@ -#include -#include -#include -#include -#include -#include - -static int fddev = -1; -static int prev[3]; -static unsigned long long prevcycles = 0; -static int now[3]; -static long long cyclespersec = 0; - -static void readdev(unsigned int *result) -{ - if (read(fddev,result,12) == 12) return; - result[0] = result[1] = result[2] = 0; -} - -long long cpucycles_dev4ns(void) -{ - unsigned long long delta4; - int deltan; - int deltas; - unsigned long long guesscycles; - - if (fddev == -1) { - fddev = open("/dev/cpucycles4ns",O_RDONLY); - readdev(prev); - } - - readdev(now); - delta4 = (unsigned int) (now[0] - prev[0]); /* unsigned change in number of cycles mod 2^32 */ - deltan = now[1] - prev[1]; /* signed change in number of nanoseconds mod 10^9 */ - deltas = now[2] - prev[2]; /* signed change in number of seconds */ - if ((deltas == 0 && deltan < 200000000) || (deltas == 1 && deltan < -800000000)) - return prevcycles + delta4; - - prev[0] = now[0]; - prev[1] = now[1]; - prev[2] = now[2]; - - if ((deltas == 0 && deltan < 300000000) || (deltas == 1 && deltan < -700000000)) { - // actual number of cycles cannot have increased by 2^32 in <0.3ms - cyclespersec = 1000000000 * (unsigned long long) delta4; - cyclespersec /= deltan + 1000000000 * (long long) deltas; - } else { - guesscycles = deltas * cyclespersec; - guesscycles += (deltan * cyclespersec) / 1000000000; - while (delta4 + 2147483648ULL < guesscycles) delta4 += 4294967296ULL; - /* XXX: could do longer-term extrapolation here */ - } - - prevcycles += delta4; - return prevcycles; -} - -long long cpucycles_dev4ns_persecond(void) -{ - while (!cyclespersec) cpucycles_dev4ns(); - return cyclespersec; -} diff --git a/src/libnacl/cpucycles/dev4ns.h b/src/libnacl/cpucycles/dev4ns.h deleted file mode 100644 index 1d99639a..00000000 --- a/src/libnacl/cpucycles/dev4ns.h +++ /dev/null @@ -1,27 +0,0 @@ -/* -cpucycles dev4ns.h version 20100803 -D. J. Bernstein -Public domain. -*/ - -#ifndef CPUCYCLES_dev4ns_h -#define CPUCYCLES_dev4ns_h - -#ifdef __cplusplus -extern "C" { -#endif - -extern long long cpucycles_dev4ns(void); -extern long long cpucycles_dev4ns_persecond(void); - -#ifdef __cplusplus -} -#endif - -#ifndef cpucycles_implementation -#define cpucycles_implementation "dev4ns" -#define cpucycles cpucycles_dev4ns -#define cpucycles_persecond cpucycles_dev4ns_persecond -#endif - -#endif diff --git a/src/libnacl/cpucycles/do b/src/libnacl/cpucycles/do deleted file mode 100755 index ee25b208..00000000 --- a/src/libnacl/cpucycles/do +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/sh -e - -okabi | ( - while read abi - do - - rm -f cpucycles.o cpucycles.h - - ( - echo monotoniccpuinfo - echo monotonic - echo gettimeofday - ) | ( - while read n - do - okc-$abi | ( - while read c - do - echo "=== `date` === Trying $n.c with $c..." >&2 - rm -f test cpucycles-impl.o cpucycles-impl.h cpucycles-impl.c - cp $n.c cpucycles-impl.c || continue - cp $n.h cpucycles-impl.h || continue - $c -c cpucycles-impl.c || continue - $c -o test test.c cpucycles-impl.o || continue - echo "=== `date` === Success. Using $n.c." >&2 - mkdir -p lib/$abi - mv cpucycles-impl.o lib/$abi/cpucycles.o - mkdir -p include/$abi - mv cpucycles-impl.h include/$abi/cpucycles.h - exit 0 - done - exit 111 - ) && exit 0 - done - exit 111 - ) || ( - echo ===== Giving up. >&2 - rm -f test cpucycles-impl.o cpucycles-impl.h cpucycles-impl.c - exit 111 - ) || exit 0 - - done - exit 0 -) || exit 111 diff --git a/src/libnacl/cpucycles/gettimeofday.c b/src/libnacl/cpucycles/gettimeofday.c deleted file mode 100644 index 0bf5e03c..00000000 --- a/src/libnacl/cpucycles/gettimeofday.c +++ /dev/null @@ -1,32 +0,0 @@ -#include -#include -#include -#include -#include -#include "osfreq.c" - -static double cpufrequency = 0; - -static void init(void) -{ - cpufrequency = osfreq(); -} - -long long cpucycles_gettimeofday(void) -{ - double result; - struct timeval t; - if (!cpufrequency) init(); - gettimeofday(&t,(struct timezone *) 0); - result = t.tv_usec; - result *= 0.000001; - result += (double) t.tv_sec; - result *= cpufrequency; - return result; -} - -long long cpucycles_gettimeofday_persecond(void) -{ - if (!cpufrequency) init(); - return cpufrequency; -} diff --git a/src/libnacl/cpucycles/gettimeofday.h b/src/libnacl/cpucycles/gettimeofday.h deleted file mode 100644 index 147b127b..00000000 --- a/src/libnacl/cpucycles/gettimeofday.h +++ /dev/null @@ -1,27 +0,0 @@ -/* -cpucycles gettimeofday.h version 20060318 -D. J. Bernstein -Public domain. -*/ - -#ifndef CPUCYCLES_gettimeofday_h -#define CPUCYCLES_gettimeofday_h - -#ifdef __cplusplus -extern "C" { -#endif - -extern long long cpucycles_gettimeofday(void); -extern long long cpucycles_gettimeofday_persecond(void); - -#ifdef __cplusplus -} -#endif - -#ifndef cpucycles_implementation -#define cpucycles_implementation "gettimeofday" -#define cpucycles cpucycles_gettimeofday -#define cpucycles_persecond cpucycles_gettimeofday_persecond -#endif - -#endif diff --git a/src/libnacl/cpucycles/hppapstat.c b/src/libnacl/cpucycles/hppapstat.c deleted file mode 100644 index 5ae1e843..00000000 --- a/src/libnacl/cpucycles/hppapstat.c +++ /dev/null @@ -1,26 +0,0 @@ -#include -#include -#include -#include -#include -#include - -long long cpucycles_hppapstat(void) -{ - register long long result; - _MFCTL(16,result); - return result; -} - -long long cpucycles_hppapstat_persecond(void) -{ - struct pst_processor pst; - union pstun pu; - double result; - - pu.pst_processor = &pst; - if (pstat(PSTAT_PROCESSOR,pu,sizeof(pst),1,0) < 0) return 0; - result = pst.psp_iticksperclktick; - result *= (double) sysconf(_SC_CLK_TCK); - return result; -} diff --git a/src/libnacl/cpucycles/hppapstat.h b/src/libnacl/cpucycles/hppapstat.h deleted file mode 100644 index 721814bb..00000000 --- a/src/libnacl/cpucycles/hppapstat.h +++ /dev/null @@ -1,27 +0,0 @@ -/* -cpucycles hppapstat.h version 20060319 -D. J. Bernstein -Public domain. -*/ - -#ifndef CPUCYCLES_hppapstat_h -#define CPUCYCLES_hppapstat_h - -#ifdef __cplusplus -extern "C" { -#endif - -extern long long cpucycles_hppapstat(void); -extern long long cpucycles_hppapstat_persecond(void); - -#ifdef __cplusplus -} -#endif - -#ifndef cpucycles_implementation -#define cpucycles_implementation "hppapstat" -#define cpucycles cpucycles_hppapstat -#define cpucycles_persecond cpucycles_hppapstat_persecond -#endif - -#endif diff --git a/src/libnacl/cpucycles/ia64cpuinfo.c b/src/libnacl/cpucycles/ia64cpuinfo.c deleted file mode 100644 index 580c6cee..00000000 --- a/src/libnacl/cpucycles/ia64cpuinfo.c +++ /dev/null @@ -1,15 +0,0 @@ -#include -#include -#include "osfreq.c" - -long long cpucycles_ia64cpuinfo(void) -{ - long long result; - asm volatile("mov %0=ar.itc" : "=r"(result)); - return result; -} - -long long cpucycles_ia64cpuinfo_persecond(void) -{ - return osfreq(); -} diff --git a/src/libnacl/cpucycles/ia64cpuinfo.h b/src/libnacl/cpucycles/ia64cpuinfo.h deleted file mode 100644 index a6bcf47d..00000000 --- a/src/libnacl/cpucycles/ia64cpuinfo.h +++ /dev/null @@ -1,27 +0,0 @@ -/* -cpucycles ia64cpuinfo.h version 20100803 -D. J. Bernstein -Public domain. -*/ - -#ifndef CPUCYCLES_ia64cpuinfo_h -#define CPUCYCLES_ia64cpuinfo_h - -#ifdef __cplusplus -extern "C" { -#endif - -extern long long cpucycles_ia64cpuinfo(void); -extern long long cpucycles_ia64cpuinfo_persecond(void); - -#ifdef __cplusplus -} -#endif - -#ifndef cpucycles_implementation -#define cpucycles_implementation "ia64cpuinfo" -#define cpucycles cpucycles_ia64cpuinfo -#define cpucycles_persecond cpucycles_ia64cpuinfo_persecond -#endif - -#endif diff --git a/src/libnacl/cpucycles/mips.c b/src/libnacl/cpucycles/mips.c deleted file mode 100644 index d9736f00..00000000 --- a/src/libnacl/cpucycles/mips.c +++ /dev/null @@ -1,65 +0,0 @@ -/* -cpucycles/mips.c version 20100803 -D. J. Bernstein -Public domain. -*/ - -#define SCALE 2 -#include -#include -#include - -static int prev[3]; -static unsigned long long prevcycles = 0; -static int now[3]; -static long long cyclespersec = 0; - -static void readticks(unsigned int *result) -{ - struct timeval t; - unsigned int cc; - asm volatile(".byte 59; .byte 16; .byte 2; .byte 124; move %0,$2" : "=r"(cc) : : "$2"); - gettimeofday(&t,(struct timezone *) 0); - result[0] = cc; - result[1] = t.tv_usec; - result[2] = t.tv_sec; -} - -long long cpucycles_mips(void) -{ - unsigned long long delta4; - int deltan; - int deltas; - unsigned long long guesscycles; - - readticks(now); - delta4 = (unsigned int) (now[0] - prev[0]); /* unsigned change in number of cycles mod 2^32 */ - deltan = now[1] - prev[1]; /* signed change in number of nanoseconds mod 10^9 */ - deltas = now[2] - prev[2]; /* signed change in number of seconds */ - if ((deltas == 0 && deltan < 200000) || (deltas == 1 && deltan < -800000)) - return (prevcycles + delta4) * SCALE; - - prev[0] = now[0]; - prev[1] = now[1]; - prev[2] = now[2]; - - if ((deltas == 0 && deltan < 300000) || (deltas == 1 && deltan < -700000)) { - // actual number of cycles cannot have increased by 2^32 in <0.3ms - cyclespersec = 1000000 * (unsigned long long) delta4; - cyclespersec /= deltan + 1000000 * (long long) deltas; - } else { - guesscycles = deltas * cyclespersec; - guesscycles += (deltan * cyclespersec) / 1000000; - while (delta4 + 2147483648ULL < guesscycles) delta4 += 4294967296ULL; - /* XXX: could do longer-term extrapolation here */ - } - - prevcycles += delta4; - return prevcycles * SCALE; -} - -long long cpucycles_mips_persecond(void) -{ - while (!cyclespersec) cpucycles_mips(); - return cyclespersec * SCALE; -} diff --git a/src/libnacl/cpucycles/mips.h b/src/libnacl/cpucycles/mips.h deleted file mode 100644 index 6f1b26c3..00000000 --- a/src/libnacl/cpucycles/mips.h +++ /dev/null @@ -1,27 +0,0 @@ -/* -cpucycles mips.h version 20100802 -D. J. Bernstein -Public domain. -*/ - -#ifndef CPUCYCLES_mips_h -#define CPUCYCLES_mips_h - -#ifdef __cplusplus -extern "C" { -#endif - -extern long long cpucycles_mips(void); -extern long long cpucycles_mips_persecond(void); - -#ifdef __cplusplus -} -#endif - -#ifndef cpucycles_implementation -#define cpucycles_implementation "mips" -#define cpucycles cpucycles_mips -#define cpucycles_persecond cpucycles_mips_persecond -#endif - -#endif diff --git a/src/libnacl/cpucycles/monotonic.c b/src/libnacl/cpucycles/monotonic.c deleted file mode 100644 index 321afd9a..00000000 --- a/src/libnacl/cpucycles/monotonic.c +++ /dev/null @@ -1,35 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include - -static double cpufrequency = 0; - -static void init(void) -{ - long result = 0; size_t resultlen = sizeof(long); - sysctlbyname("machdep.tsc_freq",&result,&resultlen,0,0); - cpufrequency = result; -} - -long long cpucycles_monotonic(void) -{ - double result; - struct timespec t; - if (!cpufrequency) init(); - clock_gettime(CLOCK_MONOTONIC,&t); - result = t.tv_nsec; - result *= 0.000000001; - result += (double) t.tv_sec; - result *= cpufrequency; - return result; -} - -long long cpucycles_monotonic_persecond(void) -{ - if (!cpufrequency) init(); - return cpufrequency; -} diff --git a/src/libnacl/cpucycles/monotonic.h b/src/libnacl/cpucycles/monotonic.h deleted file mode 100644 index 9070860b..00000000 --- a/src/libnacl/cpucycles/monotonic.h +++ /dev/null @@ -1,27 +0,0 @@ -/* -cpucycles monotonic.h version 20100803 -D. J. Bernstein -Public domain. -*/ - -#ifndef CPUCYCLES_monotonic_h -#define CPUCYCLES_monotonic_h - -#ifdef __cplusplus -extern "C" { -#endif - -extern long long cpucycles_monotonic(void); -extern long long cpucycles_monotonic_persecond(void); - -#ifdef __cplusplus -} -#endif - -#ifndef cpucycles_implementation -#define cpucycles_implementation "monotonic" -#define cpucycles cpucycles_monotonic -#define cpucycles_persecond cpucycles_monotonic_persecond -#endif - -#endif diff --git a/src/libnacl/cpucycles/monotoniccpuinfo.c b/src/libnacl/cpucycles/monotoniccpuinfo.c deleted file mode 100644 index 890e6b24..00000000 --- a/src/libnacl/cpucycles/monotoniccpuinfo.c +++ /dev/null @@ -1,34 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include "osfreq.c" - -static double cpufrequency = 0; - -static void init(void) -{ - cpufrequency = osfreq(); -} - -long long cpucycles_monotoniccpuinfo(void) -{ - double result; - struct timespec t; - if (!cpufrequency) init(); - clock_gettime(CLOCK_MONOTONIC,&t); - result = t.tv_nsec; - result *= 0.000000001; - result += (double) t.tv_sec; - result *= cpufrequency; - return result; -} - -long long cpucycles_monotoniccpuinfo_persecond(void) -{ - if (!cpufrequency) init(); - return cpufrequency; -} diff --git a/src/libnacl/cpucycles/monotoniccpuinfo.h b/src/libnacl/cpucycles/monotoniccpuinfo.h deleted file mode 100644 index d4ba7ea8..00000000 --- a/src/libnacl/cpucycles/monotoniccpuinfo.h +++ /dev/null @@ -1,27 +0,0 @@ -/* -cpucycles monotoniccpuinfo.h version 20100804 -D. J. Bernstein -Public domain. -*/ - -#ifndef CPUCYCLES_monotoniccpuinfo_h -#define CPUCYCLES_monotoniccpuinfo_h - -#ifdef __cplusplus -extern "C" { -#endif - -extern long long cpucycles_monotoniccpuinfo(void); -extern long long cpucycles_monotoniccpuinfo_persecond(void); - -#ifdef __cplusplus -} -#endif - -#ifndef cpucycles_implementation -#define cpucycles_implementation "monotoniccpuinfo" -#define cpucycles cpucycles_monotoniccpuinfo -#define cpucycles_persecond cpucycles_monotoniccpuinfo_persecond -#endif - -#endif diff --git a/src/libnacl/cpucycles/osfreq.c b/src/libnacl/cpucycles/osfreq.c deleted file mode 100644 index 4e106a23..00000000 --- a/src/libnacl/cpucycles/osfreq.c +++ /dev/null @@ -1,65 +0,0 @@ -static double osfreq(void) -{ - FILE *f; - double result; - int s; - - f = fopen("/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq", "r"); - if (f) { - s = fscanf(f,"%lf",&result); - fclose(f); - if (s > 0) return 1000.0 * result; - } - - f = fopen("/sys/devices/system/cpu/cpu0/clock_tick", "r"); - if (f) { - s = fscanf(f,"%lf",&result); - fclose(f); - if (s > 0) return result; - } - - f = fopen("/proc/cpuinfo","r"); - if (f) { - for (;;) { - s = fscanf(f,"cpu MHz : %lf",&result); - if (s > 0) break; - if (s == 0) s = fscanf(f,"%*[^\n]\n"); - if (s < 0) { result = 0; break; } - } - fclose(f); - if (result) return 1000000.0 * result; - } - - f = fopen("/proc/cpuinfo","r"); - if (f) { - for (;;) { - s = fscanf(f,"clock : %lf",&result); - if (s > 0) break; - if (s == 0) s = fscanf(f,"%*[^\n]\n"); - if (s < 0) { result = 0; break; } - } - fclose(f); - if (result) return 1000000.0 * result; - } - - f = popen("/usr/sbin/lsattr -E -l proc0 -a frequency 2>/dev/null","r"); - if (f) { - s = fscanf(f,"frequency %lf",&result); - pclose(f); - if (s > 0) return result; - } - - f = popen("/usr/sbin/psrinfo -v 2>/dev/null","r"); - if (f) { - for (;;) { - s = fscanf(f," The %*s processor operates at %lf MHz",&result); - if (s > 0) break; - if (s == 0) s = fscanf(f,"%*[^\n]\n"); - if (s < 0) { result = 0; break; } - } - pclose(f); - if (result) return 1000000.0 * result; - } - - return 0; -} diff --git a/src/libnacl/cpucycles/powerpccpuinfo.c b/src/libnacl/cpucycles/powerpccpuinfo.c deleted file mode 100644 index b70c745a..00000000 --- a/src/libnacl/cpucycles/powerpccpuinfo.c +++ /dev/null @@ -1,95 +0,0 @@ -#include -#include -#include -#include -#include -#include "osfreq.c" - -static long myround(double u) -{ - long result = u; - while (result + 0.5 < u) result += 1; - while (result - 0.5 > u) result -= 1; - return result; -} - -static long long microseconds(void) -{ - struct timeval t; - gettimeofday(&t,(struct timezone *) 0); - return t.tv_sec * (long long) 1000000 + t.tv_usec; -} - -static int tbshift = 0; - -static long long timebase(void) -{ - unsigned long high; - unsigned long low; - unsigned long newhigh; - unsigned long long result; - asm volatile( - "7:mftbu %0;mftb %1;mftbu %2;cmpw %0,%2;bne 7b" - : "=r" (high), "=r" (low), "=r" (newhigh) - ); - result = high; - result <<= 32; - result |= low; - return result >> tbshift; -} - -static double cpufrequency = 0; -static long tbcycles = 0; - -static double guesstbcycles(void) -{ - long long tb0; long long us0; - long long tb1; long long us1; - - tb0 = timebase(); - us0 = microseconds(); - do { - tb1 = timebase(); - us1 = microseconds(); - } while (us1 - us0 < 10000 || tb1 - tb0 < 1000); - if (tb1 <= tb0) return 0; - tb1 -= tb0; - us1 -= us0; - return (cpufrequency * 0.000001 * (double) us1) / (double) tb1; -} - -static void init(void) -{ - int loop; - double guess1; - double guess2; - - cpufrequency = osfreq(); - if (!cpufrequency) return; - - for (tbshift = 0;tbshift < 10;++tbshift) { - for (loop = 0;loop < 100;++loop) { - guess1 = guesstbcycles(); - guess2 = guesstbcycles(); - tbcycles = myround(guess1); - if (guess1 - tbcycles > 0.1) continue; - if (tbcycles - guess1 > 0.1) continue; - if (guess2 - tbcycles > 0.1) continue; - if (tbcycles - guess2 > 0.1) continue; - return; - } - } - tbcycles = 0; -} - -long long cpucycles_powerpccpuinfo(void) -{ - if (!tbcycles) init(); - return timebase() * tbcycles; -} - -long long cpucycles_powerpccpuinfo_persecond(void) -{ - if (!tbcycles) init(); - return cpufrequency; -} diff --git a/src/libnacl/cpucycles/powerpccpuinfo.h b/src/libnacl/cpucycles/powerpccpuinfo.h deleted file mode 100644 index c763a1b4..00000000 --- a/src/libnacl/cpucycles/powerpccpuinfo.h +++ /dev/null @@ -1,27 +0,0 @@ -/* -cpucycles powerpccpuinfo.h version 20100803 -D. J. Bernstein -Public domain. -*/ - -#ifndef CPUCYCLES_powerpccpuinfo_h -#define CPUCYCLES_powerpccpuinfo_h - -#ifdef __cplusplus -extern "C" { -#endif - -extern long long cpucycles_powerpccpuinfo(void); -extern long long cpucycles_powerpccpuinfo_persecond(void); - -#ifdef __cplusplus -} -#endif - -#ifndef cpucycles_implementation -#define cpucycles_implementation "powerpccpuinfo" -#define cpucycles cpucycles_powerpccpuinfo -#define cpucycles_persecond cpucycles_powerpccpuinfo_persecond -#endif - -#endif diff --git a/src/libnacl/cpucycles/powerpcmacos.c b/src/libnacl/cpucycles/powerpcmacos.c deleted file mode 100644 index f855b276..00000000 --- a/src/libnacl/cpucycles/powerpcmacos.c +++ /dev/null @@ -1,43 +0,0 @@ -#include -#include -#include -#include - -#define timebase mach_absolute_time - -static int cpumib[2] = { CTL_HW, HW_CPU_FREQ } ; -static int tbmib[2] = { CTL_HW, HW_TB_FREQ } ; - -static long myround(double u) -{ - long result = u; - while (result + 0.5 < u) result += 1; - while (result - 0.5 > u) result -= 1; - return result; -} - -static long tbcycles = 0; - -static void init(void) -{ - unsigned int cpufrequency = 0; size_t cpufrequencylen = sizeof(unsigned int); - unsigned int tbfrequency = 0; size_t tbfrequencylen = sizeof(unsigned int); - sysctl(cpumib,2,&cpufrequency,&cpufrequencylen,0,0); - sysctl(tbmib,2,&tbfrequency,&tbfrequencylen,0,0); - if (tbfrequency > 0) - tbcycles = myround((double) (unsigned long long) cpufrequency - / (double) (unsigned long long) tbfrequency); -} - -long long cpucycles_powerpcmacos(void) -{ - if (!tbcycles) init(); - return timebase() * tbcycles; -} - -long long cpucycles_powerpcmacos_persecond(void) -{ - unsigned int result = 0; size_t resultlen = sizeof(unsigned int); - sysctl(cpumib,2,&result,&resultlen,0,0); - return (unsigned long long) result; -} diff --git a/src/libnacl/cpucycles/powerpcmacos.h b/src/libnacl/cpucycles/powerpcmacos.h deleted file mode 100644 index f66c0e36..00000000 --- a/src/libnacl/cpucycles/powerpcmacos.h +++ /dev/null @@ -1,27 +0,0 @@ -/* -cpucycles powerpcmacos.h version 20060319 -D. J. Bernstein -Public domain. -*/ - -#ifndef CPUCYCLES_powerpcmacos_h -#define CPUCYCLES_powerpcmacos_h - -#ifdef __cplusplus -extern "C" { -#endif - -extern long long cpucycles_powerpcmacos(void); -extern long long cpucycles_powerpcmacos_persecond(void); - -#ifdef __cplusplus -} -#endif - -#ifndef cpucycles_implementation -#define cpucycles_implementation "powerpcmacos" -#define cpucycles cpucycles_powerpcmacos -#define cpucycles_persecond cpucycles_powerpcmacos_persecond -#endif - -#endif diff --git a/src/libnacl/cpucycles/sgi.c b/src/libnacl/cpucycles/sgi.c deleted file mode 100644 index c0e731f6..00000000 --- a/src/libnacl/cpucycles/sgi.c +++ /dev/null @@ -1,39 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include - -static double cpufrequency = 0; - -static void init(void) -{ - FILE *f; - - f = popen("hinv -c processor | awk '{if ($3==\"MHZ\") print $2*1000000}'","r"); - if (!f) return; - if (fscanf(f,"%lf",&cpufrequency) < 1) cpufrequency = 0; - pclose(f); - if (!cpufrequency) return; -} - -long long cpucycles_sgi(void) -{ - double result; - struct timespec t; - if (!cpufrequency) init(); - clock_gettime(CLOCK_SGI_CYCLE,&t); - result = t.tv_nsec; - result *= 0.000000001; - result += (double) t.tv_sec; - result *= cpufrequency; - return result; -} - -long long cpucycles_sgi_persecond(void) -{ - if (!cpufrequency) init(); - return cpufrequency; -} diff --git a/src/libnacl/cpucycles/sgi.h b/src/libnacl/cpucycles/sgi.h deleted file mode 100644 index 56bad976..00000000 --- a/src/libnacl/cpucycles/sgi.h +++ /dev/null @@ -1,27 +0,0 @@ -/* -cpucycles sgi.h version 20070916 -D. J. Bernstein -Public domain. -*/ - -#ifndef CPUCYCLES_sgi_h -#define CPUCYCLES_sgi_h - -#ifdef __cplusplus -extern "C" { -#endif - -extern long long cpucycles_sgi(void); -extern long long cpucycles_sgi_persecond(void); - -#ifdef __cplusplus -} -#endif - -#ifndef cpucycles_implementation -#define cpucycles_implementation "sgi" -#define cpucycles cpucycles_sgi -#define cpucycles_persecond cpucycles_sgi_persecond -#endif - -#endif diff --git a/src/libnacl/cpucycles/sparc32cpuinfo.c b/src/libnacl/cpucycles/sparc32cpuinfo.c deleted file mode 100644 index 1fc53d06..00000000 --- a/src/libnacl/cpucycles/sparc32cpuinfo.c +++ /dev/null @@ -1,16 +0,0 @@ -#include -#include -#include "osfreq.c" - -long long cpucycles_sparc32cpuinfo(void) -{ - long long result; - asm volatile(".word 2202075136; .word 2570088480; srl %%g1,0,%L0; mov %%o4,%H0" - : "=r" (result) : : "g1","o4"); - return result; -} - -long long cpucycles_sparc32cpuinfo_persecond(void) -{ - return osfreq(); -} diff --git a/src/libnacl/cpucycles/sparc32cpuinfo.h b/src/libnacl/cpucycles/sparc32cpuinfo.h deleted file mode 100644 index 9d39dc65..00000000 --- a/src/libnacl/cpucycles/sparc32cpuinfo.h +++ /dev/null @@ -1,27 +0,0 @@ -/* -cpucycles sparc32cpuinfo.h version 20100804 -D. J. Bernstein -Public domain. -*/ - -#ifndef CPUCYCLES_sparc32cpuinfo_h -#define CPUCYCLES_sparc32cpuinfo_h - -#ifdef __cplusplus -extern "C" { -#endif - -extern long long cpucycles_sparc32cpuinfo(void); -extern long long cpucycles_sparc32cpuinfo_persecond(void); - -#ifdef __cplusplus -} -#endif - -#ifndef cpucycles_implementation -#define cpucycles_implementation "sparc32cpuinfo" -#define cpucycles cpucycles_sparc32cpuinfo -#define cpucycles_persecond cpucycles_sparc32cpuinfo_persecond -#endif - -#endif diff --git a/src/libnacl/cpucycles/sparccpuinfo.c b/src/libnacl/cpucycles/sparccpuinfo.c deleted file mode 100644 index d07aafec..00000000 --- a/src/libnacl/cpucycles/sparccpuinfo.c +++ /dev/null @@ -1,15 +0,0 @@ -#include -#include -#include "osfreq.c" - -long long cpucycles_sparccpuinfo(void) -{ - long long result; - asm volatile("rd %%tick,%0" : "=r" (result)); - return result; -} - -long long cpucycles_sparccpuinfo_persecond(void) -{ - return osfreq(); -} diff --git a/src/libnacl/cpucycles/sparccpuinfo.h b/src/libnacl/cpucycles/sparccpuinfo.h deleted file mode 100644 index badb2144..00000000 --- a/src/libnacl/cpucycles/sparccpuinfo.h +++ /dev/null @@ -1,27 +0,0 @@ -/* -cpucycles sparccpuinfo.h version 20100803 -D. J. Bernstein -Public domain. -*/ - -#ifndef CPUCYCLES_sparccpuinfo_h -#define CPUCYCLES_sparccpuinfo_h - -#ifdef __cplusplus -extern "C" { -#endif - -extern long long cpucycles_sparccpuinfo(void); -extern long long cpucycles_sparccpuinfo_persecond(void); - -#ifdef __cplusplus -} -#endif - -#ifndef cpucycles_implementation -#define cpucycles_implementation "sparccpuinfo" -#define cpucycles cpucycles_sparccpuinfo -#define cpucycles_persecond cpucycles_sparccpuinfo_persecond -#endif - -#endif diff --git a/src/libnacl/cpucycles/test.c b/src/libnacl/cpucycles/test.c deleted file mode 100644 index 30a37230..00000000 --- a/src/libnacl/cpucycles/test.c +++ /dev/null @@ -1,27 +0,0 @@ -#include -#include -#include -#include -#include "cpucycles-impl.h" - -static long long tod(void) -{ - struct timeval t; - gettimeofday(&t,(struct timezone *) 0); - return t.tv_sec * (long long) 1000000 + t.tv_usec; -} - -long long todstart; -long long todend; -long long cpustart; -long long cpuend; - -long long cyclespersecond; -long long cyclespertod; - -long long t[1001]; - -int main() -{ - return 0; -} diff --git a/src/libnacl/cpucycles/x86cpuinfo.c b/src/libnacl/cpucycles/x86cpuinfo.c deleted file mode 100644 index 3fb0a1b0..00000000 --- a/src/libnacl/cpucycles/x86cpuinfo.c +++ /dev/null @@ -1,15 +0,0 @@ -#include -#include -#include "osfreq.c" - -long long cpucycles_x86cpuinfo(void) -{ - long long result; - asm volatile(".byte 15;.byte 49" : "=A" (result)); - return result; -} - -long long cpucycles_x86cpuinfo_persecond(void) -{ - return osfreq(); -} diff --git a/src/libnacl/cpucycles/x86cpuinfo.h b/src/libnacl/cpucycles/x86cpuinfo.h deleted file mode 100644 index 88f151dd..00000000 --- a/src/libnacl/cpucycles/x86cpuinfo.h +++ /dev/null @@ -1,27 +0,0 @@ -/* -cpucycles x86cpuinfo.h version 20100803 -D. J. Bernstein -Public domain. -*/ - -#ifndef CPUCYCLES_x86cpuinfo_h -#define CPUCYCLES_x86cpuinfo_h - -#ifdef __cplusplus -extern "C" { -#endif - -extern long long cpucycles_x86cpuinfo(void); -extern long long cpucycles_x86cpuinfo_persecond(void); - -#ifdef __cplusplus -} -#endif - -#ifndef cpucycles_implementation -#define cpucycles_implementation "x86cpuinfo" -#define cpucycles cpucycles_x86cpuinfo -#define cpucycles_persecond cpucycles_x86cpuinfo_persecond -#endif - -#endif diff --git a/src/libnacl/cpucycles/x86cpuspeed.c b/src/libnacl/cpucycles/x86cpuspeed.c deleted file mode 100644 index 34222565..00000000 --- a/src/libnacl/cpucycles/x86cpuspeed.c +++ /dev/null @@ -1,24 +0,0 @@ -#include -#include -#include -#include - -long long cpucycles_x86cpuspeed(void) -{ - long long result; - asm volatile(".byte 15;.byte 49" : "=A" (result)); - return result; -} - -long long cpucycles_x86cpuspeed_persecond(void) -{ - int oid[2]; - int val; - size_t size; - oid[0] = CTL_HW; - oid[1] = HW_CPUSPEED; - size = sizeof val; - if (sysctl(oid,2,&val,&size,0,0) == -1) return 0; - if (size != sizeof val) return 0; - return val * 1000000LL; -} diff --git a/src/libnacl/cpucycles/x86cpuspeed.h b/src/libnacl/cpucycles/x86cpuspeed.h deleted file mode 100644 index 43005cda..00000000 --- a/src/libnacl/cpucycles/x86cpuspeed.h +++ /dev/null @@ -1,27 +0,0 @@ -/* -cpucycles x86cpuspeed.h version 20090716 -Matthew Dempsky -Public domain. -*/ - -#ifndef CPUCYCLES_x86cpuspeed_h -#define CPUCYCLES_x86cpuspeed_h - -#ifdef __cplusplus -extern "C" { -#endif - -extern long long cpucycles_x86cpuspeed(void); -extern long long cpucycles_x86cpuspeed_persecond(void); - -#ifdef __cplusplus -} -#endif - -#ifndef cpucycles_implementation -#define cpucycles_implementation "x86cpuspeed" -#define cpucycles cpucycles_x86cpuspeed -#define cpucycles_persecond cpucycles_x86cpuspeed_persecond -#endif - -#endif diff --git a/src/libnacl/cpucycles/x86estimate.c b/src/libnacl/cpucycles/x86estimate.c deleted file mode 100644 index cd8e1c4b..00000000 --- a/src/libnacl/cpucycles/x86estimate.c +++ /dev/null @@ -1,60 +0,0 @@ -#include -#include -#include -#include -#include - -long long cpucycles_x86estimate(void) -{ - long long result; - asm volatile(".byte 15;.byte 49" : "=A" (result)); - return result; -} - -static long long microseconds(void) -{ - struct timeval t; - gettimeofday(&t,(struct timezone *) 0); - return t.tv_sec * (long long) 1000000 + t.tv_usec; -} - -static double guessfreq(void) -{ - long long tb0; long long us0; - long long tb1; long long us1; - - tb0 = cpucycles_x86estimate(); - us0 = microseconds(); - do { - tb1 = cpucycles_x86estimate(); - us1 = microseconds(); - } while (us1 - us0 < 10000 || tb1 - tb0 < 1000); - if (tb1 <= tb0) return 0; - tb1 -= tb0; - us1 -= us0; - return ((double) tb1) / (0.000001 * (double) us1); -} - -static double cpufrequency = 0; - -static void init(void) -{ - double guess1; - double guess2; - int loop; - - for (loop = 0;loop < 100;++loop) { - guess1 = guessfreq(); - guess2 = guessfreq(); - if (guess1 > 1.01 * guess2) continue; - if (guess2 > 1.01 * guess1) continue; - cpufrequency = 0.5 * (guess1 + guess2); - break; - } -} - -long long cpucycles_x86estimate_persecond(void) -{ - if (!cpufrequency) init(); - return cpufrequency; -} diff --git a/src/libnacl/cpucycles/x86estimate.h b/src/libnacl/cpucycles/x86estimate.h deleted file mode 100644 index 98f2dd15..00000000 --- a/src/libnacl/cpucycles/x86estimate.h +++ /dev/null @@ -1,27 +0,0 @@ -/* -cpucycles x86estimate.h version 20070121 -D. J. Bernstein -Public domain. -*/ - -#ifndef CPUCYCLES_x86estimate_h -#define CPUCYCLES_x86estimate_h - -#ifdef __cplusplus -extern "C" { -#endif - -extern long long cpucycles_x86estimate(void); -extern long long cpucycles_x86estimate_persecond(void); - -#ifdef __cplusplus -} -#endif - -#ifndef cpucycles_implementation -#define cpucycles_implementation "x86estimate" -#define cpucycles cpucycles_x86estimate -#define cpucycles_persecond cpucycles_x86estimate_persecond -#endif - -#endif diff --git a/src/libnacl/cpucycles/x86tscfreq.c b/src/libnacl/cpucycles/x86tscfreq.c deleted file mode 100644 index 400da941..00000000 --- a/src/libnacl/cpucycles/x86tscfreq.c +++ /dev/null @@ -1,18 +0,0 @@ -#include -#include -#include - -long long cpucycles_x86tscfreq(void) -{ - long long result; - asm volatile(".byte 15;.byte 49" : "=A" (result)); - return result; -} - -long long cpucycles_x86tscfreq_persecond(void) -{ - long result = 0; - size_t resultlen = sizeof(long); - sysctlbyname("machdep.tsc_freq",&result,&resultlen,0,0); - return result; -} diff --git a/src/libnacl/cpucycles/x86tscfreq.h b/src/libnacl/cpucycles/x86tscfreq.h deleted file mode 100644 index abf616e5..00000000 --- a/src/libnacl/cpucycles/x86tscfreq.h +++ /dev/null @@ -1,27 +0,0 @@ -/* -cpucycles x86tscfreq.h version 20060318 -D. J. Bernstein -Public domain. -*/ - -#ifndef CPUCYCLES_x86tscfreq_h -#define CPUCYCLES_x86tscfreq_h - -#ifdef __cplusplus -extern "C" { -#endif - -extern long long cpucycles_x86tscfreq(void); -extern long long cpucycles_x86tscfreq_persecond(void); - -#ifdef __cplusplus -} -#endif - -#ifndef cpucycles_implementation -#define cpucycles_implementation "x86tscfreq" -#define cpucycles cpucycles_x86tscfreq -#define cpucycles_persecond cpucycles_x86tscfreq_persecond -#endif - -#endif diff --git a/src/libnacl/cpuid/cbytes.c b/src/libnacl/cpuid/cbytes.c deleted file mode 100644 index bd5d1444..00000000 --- a/src/libnacl/cpuid/cbytes.c +++ /dev/null @@ -1,16 +0,0 @@ -#include - -int main() -{ - char ch; - int loop = 0; - while (scanf("%c",&ch) == 1) { - printf("0x%02x,",255 & (int) ch); - if (++loop == 16) { - loop = 0; - printf("\n"); - } - } - printf("0x00\n"); - return 0; -} diff --git a/src/libnacl/cpuid/cpuid.c b/src/libnacl/cpuid/cpuid.c deleted file mode 100644 index 1a5c6b8e..00000000 --- a/src/libnacl/cpuid/cpuid.c +++ /dev/null @@ -1,41 +0,0 @@ -#include -#include -#include -#include - -void nope() -{ - exit(1); -} - -int main() -{ - unsigned long x[4]; - unsigned long y[4]; - int i; - int j; - char c; - - signal(SIGILL,nope); - - x[0] = 0; - x[1] = 0; - x[2] = 0; - x[3] = 0; - - asm volatile(".byte 15;.byte 162" : "=a"(x[0]),"=b"(x[1]),"=c"(x[3]),"=d"(x[2]) : "0"(0) ); - if (!x[0]) return 0; - asm volatile(".byte 15;.byte 162" : "=a"(y[0]),"=b"(y[1]),"=c"(y[2]),"=d"(y[3]) : "0"(1) ); - - for (i = 1;i < 4;++i) - for (j = 0;j < 4;++j) { - c = x[i] >> (8 * j); - if (c < 32) c = 32; - if (c > 126) c = 126; - putchar(c); - } - - printf("-%08x-%08x\n",y[0],y[3]); - - return 0; -} diff --git a/src/libnacl/cpuid/do b/src/libnacl/cpuid/do deleted file mode 100755 index 8a3a6f7b..00000000 --- a/src/libnacl/cpuid/do +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/sh -e - -mkdir include - -( - echo x86 - echo unknown -) | ( - while read n - do - okabi | ( - while read abi - do - okc-$abi | ( - while read c - do - echo "=== `date` === Trying $n.c with $c..." >&2 - rm -f cpuid.c - cp $n.c cpuid.c || continue - $c -o cpuid cpuid.c || continue - $c -o cbytes cbytes.c || continue - ./cpuid > cpuid.out || continue - echo 'static const char cpuid[] = {' > cpuid.h || continue - ./cbytes < cpuid.out >> cpuid.h || continue - echo '} ;' >> cpuid.h || continue - cp cpuid.h include/cpuid.h || continue - cat cpuid.out - exit 0 - done - exit 111 - ) && exit 0 - done - exit 111 - ) && exit 0 - done - exit 111 -) diff --git a/src/libnacl/cpuid/unknown.c b/src/libnacl/cpuid/unknown.c deleted file mode 100644 index 786a5e72..00000000 --- a/src/libnacl/cpuid/unknown.c +++ /dev/null @@ -1,7 +0,0 @@ -#include - -main() -{ - printf("unknown CPU ID\n"); - return 0; -} diff --git a/src/libnacl/cpuid/x86.c b/src/libnacl/cpuid/x86.c deleted file mode 100644 index 99e6a0c4..00000000 --- a/src/libnacl/cpuid/x86.c +++ /dev/null @@ -1,41 +0,0 @@ -#include -#include -#include -#include - -void nope() -{ - exit(1); -} - -int main() -{ - unsigned long x[4]; - unsigned long y[4]; - int i; - int j; - char c; - - signal(SIGILL,nope); - - x[0] = 0; - x[1] = 0; - x[2] = 0; - x[3] = 0; - - asm volatile(".byte 15;.byte 162" : "=a"(x[0]),"=b"(x[1]),"=c"(x[3]),"=d"(x[2]) : "0"(0) ); - if (!x[0]) return 0; - asm volatile(".byte 15;.byte 162" : "=a"(y[0]),"=b"(y[1]),"=c"(y[2]),"=d"(y[3]) : "0"(1) ); - - for (i = 1;i < 4;++i) - for (j = 0;j < 4;++j) { - c = x[i] >> (8 * j); - if (c < 32) c = 32; - if (c > 126) c = 126; - putchar(c); - } - - printf("-%08x-%08x\n",(unsigned int) y[0],(unsigned int) y[3]); - - return 0; -} diff --git a/src/libnacl/crypto_auth/hmacsha256/checksum b/src/libnacl/crypto_auth/hmacsha256/checksum deleted file mode 100644 index 2fa9604b..00000000 --- a/src/libnacl/crypto_auth/hmacsha256/checksum +++ /dev/null @@ -1 +0,0 @@ -3bd7abd4f4dce04396f2ac7cb1cff70607f692411c49a1563b037d31e1662632 diff --git a/src/libnacl/crypto_auth/hmacsha256/ref/api.h b/src/libnacl/crypto_auth/hmacsha256/ref/api.h deleted file mode 100644 index c224d9d5..00000000 --- a/src/libnacl/crypto_auth/hmacsha256/ref/api.h +++ /dev/null @@ -1,2 +0,0 @@ -#define CRYPTO_BYTES 32 -#define CRYPTO_KEYBYTES 32 diff --git a/src/libnacl/crypto_auth/hmacsha256/ref/hmac.c b/src/libnacl/crypto_auth/hmacsha256/ref/hmac.c deleted file mode 100644 index 8ab30bb4..00000000 --- a/src/libnacl/crypto_auth/hmacsha256/ref/hmac.c +++ /dev/null @@ -1,83 +0,0 @@ -/* - * 20080913 - * D. J. Bernstein - * Public domain. - * */ - -#include "crypto_hashblocks_sha256.h" -#include "crypto_auth.h" - -#define blocks crypto_hashblocks_sha256 - -typedef unsigned int uint32; - -static const char iv[32] = { - 0x6a,0x09,0xe6,0x67, - 0xbb,0x67,0xae,0x85, - 0x3c,0x6e,0xf3,0x72, - 0xa5,0x4f,0xf5,0x3a, - 0x51,0x0e,0x52,0x7f, - 0x9b,0x05,0x68,0x8c, - 0x1f,0x83,0xd9,0xab, - 0x5b,0xe0,0xcd,0x19, -} ; - -int crypto_auth(unsigned char *out,const unsigned char *in,unsigned long long inlen,const unsigned char *k) -{ - unsigned char h[32]; - unsigned char padded[128]; - int i; - unsigned long long bits = 512 + (inlen << 3); - - for (i = 0;i < 32;++i) h[i] = iv[i]; - - for (i = 0;i < 32;++i) padded[i] = k[i] ^ 0x36; - for (i = 32;i < 64;++i) padded[i] = 0x36; - - blocks(h,padded,64); - blocks(h,in,inlen); - in += inlen; - inlen &= 63; - in -= inlen; - - for (i = 0;i < inlen;++i) padded[i] = in[i]; - padded[inlen] = 0x80; - - if (inlen < 56) { - for (i = inlen + 1;i < 56;++i) padded[i] = 0; - padded[56] = bits >> 56; - padded[57] = bits >> 48; - padded[58] = bits >> 40; - padded[59] = bits >> 32; - padded[60] = bits >> 24; - padded[61] = bits >> 16; - padded[62] = bits >> 8; - padded[63] = bits; - blocks(h,padded,64); - } else { - for (i = inlen + 1;i < 120;++i) padded[i] = 0; - padded[120] = bits >> 56; - padded[121] = bits >> 48; - padded[122] = bits >> 40; - padded[123] = bits >> 32; - padded[124] = bits >> 24; - padded[125] = bits >> 16; - padded[126] = bits >> 8; - padded[127] = bits; - blocks(h,padded,128); - } - - for (i = 0;i < 32;++i) padded[i] = k[i] ^ 0x5c; - for (i = 32;i < 64;++i) padded[i] = 0x5c; - for (i = 0;i < 32;++i) padded[64 + i] = h[i]; - - for (i = 0;i < 32;++i) out[i] = iv[i]; - - for (i = 32;i < 64;++i) padded[64 + i] = 0; - padded[64 + 32] = 0x80; - padded[64 + 62] = 3; - - blocks(out,padded,128); - - return 0; -} diff --git a/src/libnacl/crypto_auth/hmacsha256/ref/verify.c b/src/libnacl/crypto_auth/hmacsha256/ref/verify.c deleted file mode 100644 index 96ff0ea8..00000000 --- a/src/libnacl/crypto_auth/hmacsha256/ref/verify.c +++ /dev/null @@ -1,9 +0,0 @@ -#include "crypto_verify_32.h" -#include "crypto_auth.h" - -int crypto_auth_verify(const unsigned char *h,const unsigned char *in,unsigned long long inlen,const unsigned char *k) -{ - unsigned char correct[32]; - crypto_auth(correct,in,inlen,k); - return crypto_verify_32(h,correct); -} diff --git a/src/libnacl/crypto_auth/hmacsha256/used b/src/libnacl/crypto_auth/hmacsha256/used deleted file mode 100644 index e69de29b..00000000 diff --git a/src/libnacl/crypto_auth/hmacsha512256/checksum b/src/libnacl/crypto_auth/hmacsha512256/checksum deleted file mode 100644 index 1c037f2d..00000000 --- a/src/libnacl/crypto_auth/hmacsha512256/checksum +++ /dev/null @@ -1 +0,0 @@ -2f5e8a6a0cac012d8d001351d7d583e69f91390df46305c3608e0c2893491886 diff --git a/src/libnacl/crypto_auth/hmacsha512256/ref/api.h b/src/libnacl/crypto_auth/hmacsha512256/ref/api.h deleted file mode 100644 index c224d9d5..00000000 --- a/src/libnacl/crypto_auth/hmacsha512256/ref/api.h +++ /dev/null @@ -1,2 +0,0 @@ -#define CRYPTO_BYTES 32 -#define CRYPTO_KEYBYTES 32 diff --git a/src/libnacl/crypto_auth/hmacsha512256/ref/hmac.c b/src/libnacl/crypto_auth/hmacsha512256/ref/hmac.c deleted file mode 100644 index 56ebfa6b..00000000 --- a/src/libnacl/crypto_auth/hmacsha512256/ref/hmac.c +++ /dev/null @@ -1,86 +0,0 @@ -/* - * 20080913 - * D. J. Bernstein - * Public domain. - * */ - -#include "crypto_hashblocks_sha512.h" -#include "crypto_auth.h" - -#define blocks crypto_hashblocks_sha512 - -typedef unsigned long long uint64; - -static const unsigned char iv[64] = { - 0x6a,0x09,0xe6,0x67,0xf3,0xbc,0xc9,0x08, - 0xbb,0x67,0xae,0x85,0x84,0xca,0xa7,0x3b, - 0x3c,0x6e,0xf3,0x72,0xfe,0x94,0xf8,0x2b, - 0xa5,0x4f,0xf5,0x3a,0x5f,0x1d,0x36,0xf1, - 0x51,0x0e,0x52,0x7f,0xad,0xe6,0x82,0xd1, - 0x9b,0x05,0x68,0x8c,0x2b,0x3e,0x6c,0x1f, - 0x1f,0x83,0xd9,0xab,0xfb,0x41,0xbd,0x6b, - 0x5b,0xe0,0xcd,0x19,0x13,0x7e,0x21,0x79 -} ; - -int crypto_auth(unsigned char *out,const unsigned char *in,unsigned long long inlen,const unsigned char *k) -{ - unsigned char h[64]; - unsigned char padded[256]; - int i; - unsigned long long bytes = 128 + inlen; - - for (i = 0;i < 64;++i) h[i] = iv[i]; - - for (i = 0;i < 32;++i) padded[i] = k[i] ^ 0x36; - for (i = 32;i < 128;++i) padded[i] = 0x36; - - blocks(h,padded,128); - blocks(h,in,inlen); - in += inlen; - inlen &= 127; - in -= inlen; - - for (i = 0;i < inlen;++i) padded[i] = in[i]; - padded[inlen] = 0x80; - - if (inlen < 112) { - for (i = inlen + 1;i < 119;++i) padded[i] = 0; - padded[119] = bytes >> 61; - padded[120] = bytes >> 53; - padded[121] = bytes >> 45; - padded[122] = bytes >> 37; - padded[123] = bytes >> 29; - padded[124] = bytes >> 21; - padded[125] = bytes >> 13; - padded[126] = bytes >> 5; - padded[127] = bytes << 3; - blocks(h,padded,128); - } else { - for (i = inlen + 1;i < 247;++i) padded[i] = 0; - padded[247] = bytes >> 61; - padded[248] = bytes >> 53; - padded[249] = bytes >> 45; - padded[250] = bytes >> 37; - padded[251] = bytes >> 29; - padded[252] = bytes >> 21; - padded[253] = bytes >> 13; - padded[254] = bytes >> 5; - padded[255] = bytes << 3; - blocks(h,padded,256); - } - - for (i = 0;i < 32;++i) padded[i] = k[i] ^ 0x5c; - for (i = 32;i < 128;++i) padded[i] = 0x5c; - - for (i = 0;i < 64;++i) padded[128 + i] = h[i]; - for (i = 0;i < 64;++i) h[i] = iv[i]; - - for (i = 64;i < 128;++i) padded[128 + i] = 0; - padded[128 + 64] = 0x80; - padded[128 + 126] = 6; - - blocks(h,padded,256); - for (i = 0;i < 32;++i) out[i] = h[i]; - - return 0; -} diff --git a/src/libnacl/crypto_auth/hmacsha512256/ref/verify.c b/src/libnacl/crypto_auth/hmacsha512256/ref/verify.c deleted file mode 100644 index 96ff0ea8..00000000 --- a/src/libnacl/crypto_auth/hmacsha512256/ref/verify.c +++ /dev/null @@ -1,9 +0,0 @@ -#include "crypto_verify_32.h" -#include "crypto_auth.h" - -int crypto_auth_verify(const unsigned char *h,const unsigned char *in,unsigned long long inlen,const unsigned char *k) -{ - unsigned char correct[32]; - crypto_auth(correct,in,inlen,k); - return crypto_verify_32(h,correct); -} diff --git a/src/libnacl/crypto_auth/hmacsha512256/selected b/src/libnacl/crypto_auth/hmacsha512256/selected deleted file mode 100644 index e69de29b..00000000 diff --git a/src/libnacl/crypto_auth/hmacsha512256/used b/src/libnacl/crypto_auth/hmacsha512256/used deleted file mode 100644 index e69de29b..00000000 diff --git a/src/libnacl/crypto_auth/measure.c b/src/libnacl/crypto_auth/measure.c deleted file mode 100644 index e5209903..00000000 --- a/src/libnacl/crypto_auth/measure.c +++ /dev/null @@ -1,69 +0,0 @@ -#include "crypto_auth.h" -#include "randombytes.h" -#include "cpucycles.h" - -extern void printentry(long long,const char *,long long *,long long); -extern unsigned char *alignedcalloc(unsigned long long); -extern const char *primitiveimplementation; -extern const char *implementationversion; -extern const char *sizenames[]; -extern const long long sizes[]; -extern void allocate(void); -extern void measure(void); - -const char *primitiveimplementation = crypto_auth_IMPLEMENTATION; -const char *implementationversion = crypto_auth_VERSION; -const char *sizenames[] = { "outputbytes", "keybytes", 0 }; -const long long sizes[] = { crypto_auth_BYTES, crypto_auth_KEYBYTES }; - -#define MAXTEST_BYTES 4096 -#ifdef SUPERCOP -#define MGAP 8192 -#else -#define MGAP 8 -#endif - -static unsigned char *k; -static unsigned char *m; -static unsigned char *h; - -void preallocate(void) -{ -} - -void allocate(void) -{ - k = alignedcalloc(crypto_auth_KEYBYTES); - m = alignedcalloc(MAXTEST_BYTES); - h = alignedcalloc(crypto_auth_BYTES); -} - -#define TIMINGS 15 -static long long cycles[TIMINGS + 1]; - -void measure(void) -{ - int i; - int loop; - int mlen; - - for (loop = 0;loop < LOOPS;++loop) { - for (mlen = 0;mlen <= MAXTEST_BYTES;mlen += 1 + mlen / MGAP) { - randombytes(k,crypto_auth_KEYBYTES); - randombytes(m,mlen); - randombytes(h,crypto_auth_BYTES); - for (i = 0;i <= TIMINGS;++i) { - cycles[i] = cpucycles(); - crypto_auth(h,m,mlen,k); - } - for (i = 0;i < TIMINGS;++i) cycles[i] = cycles[i + 1] - cycles[i]; - printentry(mlen,"cycles",cycles,TIMINGS); - for (i = 0;i <= TIMINGS;++i) { - cycles[i] = cpucycles(); - crypto_auth_verify(h,m,mlen,k); - } - for (i = 0;i < TIMINGS;++i) cycles[i] = cycles[i + 1] - cycles[i]; - printentry(mlen,"verify_cycles",cycles,TIMINGS); - } - } -} diff --git a/src/libnacl/crypto_auth/try.c b/src/libnacl/crypto_auth/try.c deleted file mode 100644 index 0ea1f7ba..00000000 --- a/src/libnacl/crypto_auth/try.c +++ /dev/null @@ -1,121 +0,0 @@ -/* - * crypto_auth/try.c version 20090118 - * D. J. Bernstein - * Public domain. - */ - -#include -#include "crypto_hash_sha256.h" -#include "crypto_auth.h" -#include "windows/windows-quirks.h" - -extern unsigned char *alignedcalloc(unsigned long long); - -const char *primitiveimplementation = crypto_auth_IMPLEMENTATION; - -#define MAXTEST_BYTES 10000 -#define CHECKSUM_BYTES 4096 -#define TUNE_BYTES 1536 - -static unsigned char *h; -static unsigned char *m; -static unsigned char *k; -static unsigned char *h2; -static unsigned char *m2; -static unsigned char *k2; - -void preallocate(void) -{ -} - -void allocate(void) -{ - h = alignedcalloc(crypto_auth_BYTES); - m = alignedcalloc(MAXTEST_BYTES); - k = alignedcalloc(crypto_auth_KEYBYTES); - h2 = alignedcalloc(crypto_auth_BYTES); - m2 = alignedcalloc(MAXTEST_BYTES + crypto_auth_BYTES); - k2 = alignedcalloc(crypto_auth_KEYBYTES + crypto_auth_BYTES); -} - -void predoit(void) -{ -} - -void doit(void) -{ - crypto_auth(h,m,TUNE_BYTES,k); - crypto_auth_verify(h,m,TUNE_BYTES,k); -} - -char checksum[crypto_auth_BYTES * 2 + 1]; - -const char *checksum_compute(void) -{ - long long i; - long long j; - - for (i = 0;i < CHECKSUM_BYTES;++i) { - long long mlen = i; - long long klen = crypto_auth_KEYBYTES; - long long hlen = crypto_auth_BYTES; - - for (j = -16;j < 0;++j) h[j] = random(); - for (j = -16;j < 0;++j) k[j] = random(); - for (j = -16;j < 0;++j) m[j] = random(); - for (j = hlen;j < hlen + 16;++j) h[j] = random(); - for (j = klen;j < klen + 16;++j) k[j] = random(); - for (j = mlen;j < mlen + 16;++j) m[j] = random(); - for (j = -16;j < hlen + 16;++j) h2[j] = h[j]; - for (j = -16;j < klen + 16;++j) k2[j] = k[j]; - for (j = -16;j < mlen + 16;++j) m2[j] = m[j]; - - if (crypto_auth(h,m,mlen,k) != 0) return "crypto_auth returns nonzero"; - - for (j = -16;j < klen + 16;++j) if (k[j] != k2[j]) return "crypto_auth overwrites k"; - for (j = -16;j < mlen + 16;++j) if (m[j] != m2[j]) return "crypto_auth overwrites m"; - for (j = -16;j < 0;++j) if (h[j] != h2[j]) return "crypto_auth writes before output"; - for (j = hlen;j < hlen + 16;++j) if (h[j] != h2[j]) return "crypto_auth writes after output"; - - for (j = -16;j < 0;++j) h[j] = random(); - for (j = -16;j < 0;++j) k[j] = random(); - for (j = -16;j < 0;++j) m[j] = random(); - for (j = hlen;j < hlen + 16;++j) h[j] = random(); - for (j = klen;j < klen + 16;++j) k[j] = random(); - for (j = mlen;j < mlen + 16;++j) m[j] = random(); - for (j = -16;j < hlen + 16;++j) h2[j] = h[j]; - for (j = -16;j < klen + 16;++j) k2[j] = k[j]; - for (j = -16;j < mlen + 16;++j) m2[j] = m[j]; - - if (crypto_auth(m2,m2,mlen,k) != 0) return "crypto_auth returns nonzero"; - for (j = 0;j < hlen;++j) if (m2[j] != h[j]) return "crypto_auth does not handle m overlap"; - for (j = 0;j < hlen;++j) m2[j] = m[j]; - if (crypto_auth(k2,m2,mlen,k2) != 0) return "crypto_auth returns nonzero"; - for (j = 0;j < hlen;++j) if (k2[j] != h[j]) return "crypto_auth does not handle k overlap"; - for (j = 0;j < hlen;++j) k2[j] = k[j]; - - if (crypto_auth_verify(h,m,mlen,k) != 0) return "crypto_auth_verify returns nonzero"; - - for (j = -16;j < hlen + 16;++j) if (h[j] != h2[j]) return "crypto_auth overwrites h"; - for (j = -16;j < klen + 16;++j) if (k[j] != k2[j]) return "crypto_auth overwrites k"; - for (j = -16;j < mlen + 16;++j) if (m[j] != m2[j]) return "crypto_auth overwrites m"; - - crypto_hash_sha256(h2,h,hlen); - for (j = 0;j < klen;++j) k[j] ^= h2[j % 32]; - if (crypto_auth(h,m,mlen,k) != 0) return "crypto_auth returns nonzero"; - if (crypto_auth_verify(h,m,mlen,k) != 0) return "crypto_auth_verify returns nonzero"; - - crypto_hash_sha256(h2,h,hlen); - for (j = 0;j < mlen;++j) m[j] ^= h2[j % 32]; - m[mlen] = h2[0]; - } - if (crypto_auth(h,m,CHECKSUM_BYTES,k) != 0) return "crypto_auth returns nonzero"; - if (crypto_auth_verify(h,m,CHECKSUM_BYTES,k) != 0) return "crypto_auth_verify returns nonzero"; - - for (i = 0;i < crypto_auth_BYTES;++i) { - checksum[2 * i] = "0123456789abcdef"[15 & (h[i] >> 4)]; - checksum[2 * i + 1] = "0123456789abcdef"[15 & h[i]]; - } - checksum[2 * i] = 0; - return 0; -} diff --git a/src/libnacl/crypto_box/curve25519xsalsa20poly1305/checksum b/src/libnacl/crypto_box/curve25519xsalsa20poly1305/checksum deleted file mode 100644 index 56a20083..00000000 --- a/src/libnacl/crypto_box/curve25519xsalsa20poly1305/checksum +++ /dev/null @@ -1 +0,0 @@ -5fac7400caabc14a99c5c0bc13fb1df5e468e870382a3a1c diff --git a/src/libnacl/crypto_box/curve25519xsalsa20poly1305/ref/after.c b/src/libnacl/crypto_box/curve25519xsalsa20poly1305/ref/after.c deleted file mode 100644 index eb243e22..00000000 --- a/src/libnacl/crypto_box/curve25519xsalsa20poly1305/ref/after.c +++ /dev/null @@ -1,22 +0,0 @@ -#include "crypto_secretbox_xsalsa20poly1305.h" -#include "crypto_box.h" - -int crypto_box_afternm( - unsigned char *c, - const unsigned char *m,unsigned long long mlen, - const unsigned char *n, - const unsigned char *k -) -{ - return crypto_secretbox_xsalsa20poly1305(c,m,mlen,n,k); -} - -int crypto_box_open_afternm( - unsigned char *m, - const unsigned char *c,unsigned long long clen, - const unsigned char *n, - const unsigned char *k -) -{ - return crypto_secretbox_xsalsa20poly1305_open(m,c,clen,n,k); -} diff --git a/src/libnacl/crypto_box/curve25519xsalsa20poly1305/ref/api.h b/src/libnacl/crypto_box/curve25519xsalsa20poly1305/ref/api.h deleted file mode 100644 index ce7762df..00000000 --- a/src/libnacl/crypto_box/curve25519xsalsa20poly1305/ref/api.h +++ /dev/null @@ -1,6 +0,0 @@ -#define CRYPTO_PUBLICKEYBYTES 32 -#define CRYPTO_SECRETKEYBYTES 32 -#define CRYPTO_BEFORENMBYTES 32 -#define CRYPTO_NONCEBYTES 24 -#define CRYPTO_ZEROBYTES 32 -#define CRYPTO_BOXZEROBYTES 16 diff --git a/src/libnacl/crypto_box/curve25519xsalsa20poly1305/ref/before.c b/src/libnacl/crypto_box/curve25519xsalsa20poly1305/ref/before.c deleted file mode 100644 index 279bb12a..00000000 --- a/src/libnacl/crypto_box/curve25519xsalsa20poly1305/ref/before.c +++ /dev/null @@ -1,17 +0,0 @@ -#include "crypto_core_hsalsa20.h" -#include "crypto_scalarmult_curve25519.h" -#include "crypto_box.h" - -static const unsigned char sigma[16] = "expand 32-byte k"; -static const unsigned char n[16] = {0}; - -int crypto_box_beforenm( - unsigned char *k, - const unsigned char *pk, - const unsigned char *sk -) -{ - unsigned char s[32]; - crypto_scalarmult_curve25519(s,sk,pk); - return crypto_core_hsalsa20(k,n,s,sigma); -} diff --git a/src/libnacl/crypto_box/curve25519xsalsa20poly1305/ref/box.c b/src/libnacl/crypto_box/curve25519xsalsa20poly1305/ref/box.c deleted file mode 100644 index 81ff72e2..00000000 --- a/src/libnacl/crypto_box/curve25519xsalsa20poly1305/ref/box.c +++ /dev/null @@ -1,27 +0,0 @@ -#include "crypto_box.h" - -int crypto_box( - unsigned char *c, - const unsigned char *m,unsigned long long mlen, - const unsigned char *n, - const unsigned char *pk, - const unsigned char *sk -) -{ - unsigned char k[crypto_box_BEFORENMBYTES]; - crypto_box_beforenm(k,pk,sk); - return crypto_box_afternm(c,m,mlen,n,k); -} - -int crypto_box_open( - unsigned char *m, - const unsigned char *c,unsigned long long clen, - const unsigned char *n, - const unsigned char *pk, - const unsigned char *sk -) -{ - unsigned char k[crypto_box_BEFORENMBYTES]; - crypto_box_beforenm(k,pk,sk); - return crypto_box_open_afternm(m,c,clen,n,k); -} diff --git a/src/libnacl/crypto_box/curve25519xsalsa20poly1305/ref/keypair.c b/src/libnacl/crypto_box/curve25519xsalsa20poly1305/ref/keypair.c deleted file mode 100644 index 233bc950..00000000 --- a/src/libnacl/crypto_box/curve25519xsalsa20poly1305/ref/keypair.c +++ /dev/null @@ -1,12 +0,0 @@ -#include "crypto_scalarmult_curve25519.h" -#include "crypto_box.h" -#include "randombytes.h" - -int crypto_box_keypair( - unsigned char *pk, - unsigned char *sk -) -{ - randombytes(sk,32); - return crypto_scalarmult_curve25519_base(pk,sk); -} diff --git a/src/libnacl/crypto_box/curve25519xsalsa20poly1305/selected b/src/libnacl/crypto_box/curve25519xsalsa20poly1305/selected deleted file mode 100644 index e69de29b..00000000 diff --git a/src/libnacl/crypto_box/curve25519xsalsa20poly1305/used b/src/libnacl/crypto_box/curve25519xsalsa20poly1305/used deleted file mode 100644 index e69de29b..00000000 diff --git a/src/libnacl/crypto_box/measure.c b/src/libnacl/crypto_box/measure.c deleted file mode 100644 index 08df1e39..00000000 --- a/src/libnacl/crypto_box/measure.c +++ /dev/null @@ -1,137 +0,0 @@ -#include -#include "randombytes.h" -#include "cpucycles.h" -#include "crypto_box.h" - -extern void printentry(long long,const char *,long long *,long long); -extern unsigned char *alignedcalloc(unsigned long long); -extern const char *primitiveimplementation; -extern const char *implementationversion; -extern const char *sizenames[]; -extern const long long sizes[]; -extern void allocate(void); -extern void measure(void); - -const char *primitiveimplementation = crypto_box_IMPLEMENTATION; -const char *implementationversion = crypto_box_VERSION; -const char *sizenames[] = { "publickeybytes", "secretkeybytes", "beforenmbytes", "noncebytes", "zerobytes", "boxzerobytes", 0 }; -const long long sizes[] = { crypto_box_PUBLICKEYBYTES, crypto_box_SECRETKEYBYTES, crypto_box_BEFORENMBYTES, crypto_box_NONCEBYTES, crypto_box_ZEROBYTES, crypto_box_BOXZEROBYTES }; - -#define MAXTEST_BYTES 4096 - -static unsigned char *ska; -static unsigned char *pka; -static unsigned char *skb; -static unsigned char *pkb; -static unsigned char *n; -static unsigned char *m; -static unsigned char *c; -static unsigned char *sa; -static unsigned char *sb; - -void preallocate(void) -{ -} - -void allocate(void) -{ - ska = alignedcalloc(crypto_box_SECRETKEYBYTES); - pka = alignedcalloc(crypto_box_PUBLICKEYBYTES); - skb = alignedcalloc(crypto_box_SECRETKEYBYTES); - pkb = alignedcalloc(crypto_box_PUBLICKEYBYTES); - n = alignedcalloc(crypto_box_NONCEBYTES); - m = alignedcalloc(MAXTEST_BYTES + crypto_box_ZEROBYTES); - c = alignedcalloc(MAXTEST_BYTES + crypto_box_ZEROBYTES); - sa = alignedcalloc(crypto_box_BEFORENMBYTES); - sb = alignedcalloc(crypto_box_BEFORENMBYTES); -} - -#define TIMINGS 15 -static long long cycles[TIMINGS + 1]; - -void measure(void) -{ - int i; - int loop; - int mlen; - - for (loop = 0;loop < LOOPS;++loop) { - for (i = 0;i <= TIMINGS;++i) { - cycles[i] = cpucycles(); - crypto_box_keypair(pka,ska); - } - for (i = 0;i < TIMINGS;++i) cycles[i] = cycles[i + 1] - cycles[i]; - printentry(-1,"keypair_cycles",cycles,TIMINGS); - - for (i = 0;i <= TIMINGS;++i) { - cycles[i] = cpucycles(); - crypto_box_keypair(pkb,skb); - } - for (i = 0;i < TIMINGS;++i) cycles[i] = cycles[i + 1] - cycles[i]; - printentry(-1,"keypair_cycles",cycles,TIMINGS); - - for (i = 0;i <= TIMINGS;++i) { - cycles[i] = cpucycles(); - crypto_box_beforenm(sa,pkb,ska); - } - for (i = 0;i < TIMINGS;++i) cycles[i] = cycles[i + 1] - cycles[i]; - printentry(-1,"beforenm_cycles",cycles,TIMINGS); - - for (i = 0;i <= TIMINGS;++i) { - cycles[i] = cpucycles(); - crypto_box_beforenm(sb,pka,skb); - } - for (i = 0;i < TIMINGS;++i) cycles[i] = cycles[i + 1] - cycles[i]; - printentry(-1,"beforenm_cycles",cycles,TIMINGS); - - for (mlen = 0;mlen <= MAXTEST_BYTES;mlen += 1 + mlen / 8) { - randombytes(n,crypto_box_NONCEBYTES); - randombytes(m + crypto_box_ZEROBYTES,mlen); - randombytes(c,mlen + crypto_box_ZEROBYTES); - - for (i = 0;i <= TIMINGS;++i) { - cycles[i] = cpucycles(); - crypto_box(c,m,mlen + crypto_box_ZEROBYTES,n,pka,skb); - } - for (i = 0;i < TIMINGS;++i) cycles[i] = cycles[i + 1] - cycles[i]; - printentry(mlen,"cycles",cycles,TIMINGS); - - for (i = 0;i <= TIMINGS;++i) { - cycles[i] = cpucycles(); - crypto_box_open(m,c,mlen + crypto_box_ZEROBYTES,n,pkb,ska); - } - for (i = 0;i < TIMINGS;++i) cycles[i] = cycles[i + 1] - cycles[i]; - printentry(mlen,"open_cycles",cycles,TIMINGS); - - ++c[crypto_box_ZEROBYTES]; - for (i = 0;i <= TIMINGS;++i) { - cycles[i] = cpucycles(); - crypto_box_open(m,c,mlen + crypto_box_ZEROBYTES,n,pkb,ska); - } - for (i = 0;i < TIMINGS;++i) cycles[i] = cycles[i + 1] - cycles[i]; - printentry(mlen,"forgery_open_cycles",cycles,TIMINGS); - - for (i = 0;i <= TIMINGS;++i) { - cycles[i] = cpucycles(); - crypto_box_afternm(c,m,mlen + crypto_box_ZEROBYTES,n,sb); - } - for (i = 0;i < TIMINGS;++i) cycles[i] = cycles[i + 1] - cycles[i]; - printentry(mlen,"afternm_cycles",cycles,TIMINGS); - - for (i = 0;i <= TIMINGS;++i) { - cycles[i] = cpucycles(); - crypto_box_open_afternm(m,c,mlen + crypto_box_ZEROBYTES,n,sa); - } - for (i = 0;i < TIMINGS;++i) cycles[i] = cycles[i + 1] - cycles[i]; - printentry(mlen,"open_afternm_cycles",cycles,TIMINGS); - - ++c[crypto_box_ZEROBYTES]; - for (i = 0;i <= TIMINGS;++i) { - cycles[i] = cpucycles(); - crypto_box_open_afternm(m,c,mlen + crypto_box_ZEROBYTES,n,sa); - } - for (i = 0;i < TIMINGS;++i) cycles[i] = cycles[i + 1] - cycles[i]; - printentry(mlen,"forgery_open_afternm_cycles",cycles,TIMINGS); - } - } -} diff --git a/src/libnacl/crypto_box/try.c b/src/libnacl/crypto_box/try.c deleted file mode 100644 index 9e1e5079..00000000 --- a/src/libnacl/crypto_box/try.c +++ /dev/null @@ -1,197 +0,0 @@ -/* - * crypto_box/try.c version 20090118 - * D. J. Bernstein - * Public domain. - */ - -#include -#include "crypto_box.h" -#include "windows/windows-quirks.h" - -extern unsigned char *alignedcalloc(unsigned long long); - -const char *primitiveimplementation = crypto_box_IMPLEMENTATION; - -#define MAXTEST_BYTES 10000 -#define CHECKSUM_BYTES 4096 -#define TUNE_BYTES 1536 - -static unsigned char *ska; -static unsigned char *pka; -static unsigned char *skb; -static unsigned char *pkb; -static unsigned char *s; -static unsigned char *n; -static unsigned char *m; -static unsigned char *c; -static unsigned char *t; -static unsigned char *ska2; -static unsigned char *pka2; -static unsigned char *skb2; -static unsigned char *pkb2; -static unsigned char *s2; -static unsigned char *n2; -static unsigned char *m2; -static unsigned char *c2; -static unsigned char *t2; - -#define sklen crypto_box_SECRETKEYBYTES -#define pklen crypto_box_PUBLICKEYBYTES -#define nlen crypto_box_NONCEBYTES -#define slen crypto_box_BEFORENMBYTES - -void preallocate(void) -{ -} - -void allocate(void) -{ - ska = alignedcalloc(sklen); - pka = alignedcalloc(pklen); - skb = alignedcalloc(sklen); - pkb = alignedcalloc(pklen); - n = alignedcalloc(nlen); - m = alignedcalloc(MAXTEST_BYTES + crypto_box_ZEROBYTES); - c = alignedcalloc(MAXTEST_BYTES + crypto_box_ZEROBYTES); - t = alignedcalloc(MAXTEST_BYTES + crypto_box_ZEROBYTES); - s = alignedcalloc(slen); - ska2 = alignedcalloc(sklen); - pka2 = alignedcalloc(pklen); - skb2 = alignedcalloc(sklen); - pkb2 = alignedcalloc(pklen); - n2 = alignedcalloc(nlen); - m2 = alignedcalloc(MAXTEST_BYTES + crypto_box_ZEROBYTES); - c2 = alignedcalloc(MAXTEST_BYTES + crypto_box_ZEROBYTES); - t2 = alignedcalloc(MAXTEST_BYTES + crypto_box_ZEROBYTES); - s2 = alignedcalloc(slen); -} - -void predoit(void) -{ -} - -void doit(void) -{ - crypto_box(c,m,TUNE_BYTES + crypto_box_ZEROBYTES,n,pka,skb); - crypto_box_open(t,c,TUNE_BYTES + crypto_box_ZEROBYTES,n,pkb,ska); -} - -char checksum[nlen * 2 + 1]; - -const char *checksum_compute(void) -{ - long long i; - long long j; - - if (crypto_box_keypair(pka,ska) != 0) return "crypto_box_keypair returns nonzero"; - if (crypto_box_keypair(pkb,skb) != 0) return "crypto_box_keypair returns nonzero"; - - for (j = 0;j < crypto_box_ZEROBYTES;++j) m[j] = 0; - - for (i = 0;i < CHECKSUM_BYTES;++i) { - long long mlen = i + crypto_box_ZEROBYTES; - long long tlen = i + crypto_box_ZEROBYTES; - long long clen = i + crypto_box_ZEROBYTES; - - for (j = -16;j < 0;++j) ska[j] = random(); - for (j = -16;j < 0;++j) skb[j] = random(); - for (j = -16;j < 0;++j) pka[j] = random(); - for (j = -16;j < 0;++j) pkb[j] = random(); - for (j = -16;j < 0;++j) m[j] = random(); - for (j = -16;j < 0;++j) n[j] = random(); - - for (j = sklen;j < sklen + 16;++j) ska[j] = random(); - for (j = sklen;j < sklen + 16;++j) skb[j] = random(); - for (j = pklen;j < pklen + 16;++j) pka[j] = random(); - for (j = pklen;j < pklen + 16;++j) pkb[j] = random(); - for (j = mlen;j < mlen + 16;++j) m[j] = random(); - for (j = nlen;j < nlen + 16;++j) n[j] = random(); - - for (j = -16;j < sklen + 16;++j) ska2[j] = ska[j]; - for (j = -16;j < sklen + 16;++j) skb2[j] = skb[j]; - for (j = -16;j < pklen + 16;++j) pka2[j] = pka[j]; - for (j = -16;j < pklen + 16;++j) pkb2[j] = pkb[j]; - for (j = -16;j < mlen + 16;++j) m2[j] = m[j]; - for (j = -16;j < nlen + 16;++j) n2[j] = n[j]; - for (j = -16;j < clen + 16;++j) c2[j] = c[j] = random(); - - if (crypto_box(c,m,mlen,n,pkb,ska) != 0) return "crypto_box returns nonzero"; - - for (j = -16;j < mlen + 16;++j) if (m2[j] != m[j]) return "crypto_box overwrites m"; - for (j = -16;j < nlen + 16;++j) if (n2[j] != n[j]) return "crypto_box overwrites n"; - for (j = -16;j < 0;++j) if (c2[j] != c[j]) return "crypto_box writes before output"; - for (j = clen;j < clen + 16;++j) if (c2[j] != c[j]) return "crypto_box writes after output"; - for (j = 0;j < crypto_box_BOXZEROBYTES;++j) - if (c[j] != 0) return "crypto_box does not clear extra bytes"; - - for (j = -16;j < sklen + 16;++j) if (ska2[j] != ska[j]) return "crypto_box overwrites ska"; - for (j = -16;j < sklen + 16;++j) if (skb2[j] != skb[j]) return "crypto_box overwrites skb"; - for (j = -16;j < pklen + 16;++j) if (pka2[j] != pka[j]) return "crypto_box overwrites pka"; - for (j = -16;j < pklen + 16;++j) if (pkb2[j] != pkb[j]) return "crypto_box overwrites pkb"; - - for (j = -16;j < 0;++j) c[j] = random(); - for (j = clen;j < clen + 16;++j) c[j] = random(); - for (j = -16;j < clen + 16;++j) c2[j] = c[j]; - for (j = -16;j < tlen + 16;++j) t2[j] = t[j] = random(); - - if (crypto_box_open(t,c,clen,n,pka,skb) != 0) return "crypto_box_open returns nonzero"; - - for (j = -16;j < clen + 16;++j) if (c2[j] != c[j]) return "crypto_box_open overwrites c"; - for (j = -16;j < nlen + 16;++j) if (n2[j] != n[j]) return "crypto_box_open overwrites n"; - for (j = -16;j < 0;++j) if (t2[j] != t[j]) return "crypto_box_open writes before output"; - for (j = tlen;j < tlen + 16;++j) if (t2[j] != t[j]) return "crypto_box_open writes after output"; - for (j = 0;j < crypto_box_ZEROBYTES;++j) - if (t[j] != 0) return "crypto_box_open does not clear extra bytes"; - - for (j = -16;j < sklen + 16;++j) if (ska2[j] != ska[j]) return "crypto_box_open overwrites ska"; - for (j = -16;j < sklen + 16;++j) if (skb2[j] != skb[j]) return "crypto_box_open overwrites skb"; - for (j = -16;j < pklen + 16;++j) if (pka2[j] != pka[j]) return "crypto_box_open overwrites pka"; - for (j = -16;j < pklen + 16;++j) if (pkb2[j] != pkb[j]) return "crypto_box_open overwrites pkb"; - - for (j = 0;j < mlen;++j) if (t[j] != m[j]) return "plaintext does not match"; - - for (j = -16;j < slen + 16;++j) s2[j] = s[j] = random(); - if (crypto_box_beforenm(s,pkb,ska) != 0) return "crypto_box_beforenm returns nonzero"; - for (j = -16;j < pklen + 16;++j) if (pka2[j] != pka[j]) return "crypto_box_open overwrites pk"; - for (j = -16;j < sklen + 16;++j) if (skb2[j] != skb[j]) return "crypto_box_open overwrites sk"; - for (j = -16;j < 0;++j) if (s2[j] != s[j]) return "crypto_box_beforenm writes before output"; - for (j = slen;j < slen + 16;++j) if (s2[j] != s[j]) return "crypto_box_beforenm writes after output"; - - for (j = -16;j < slen + 16;++j) s2[j] = s[j]; - for (j = -16;j < tlen + 16;++j) t2[j] = t[j] = random(); - if (crypto_box_afternm(t,m,mlen,n,s) != 0) return "crypto_box_afternm returns nonzero"; - for (j = -16;j < slen + 16;++j) if (s2[j] != s[j]) return "crypto_box_afternm overwrites s"; - for (j = -16;j < mlen + 16;++j) if (m2[j] != m[j]) return "crypto_box_afternm overwrites m"; - for (j = -16;j < nlen + 16;++j) if (n2[j] != n[j]) return "crypto_box_afternm overwrites n"; - for (j = -16;j < 0;++j) if (t2[j] != t[j]) return "crypto_box_afternm writes before output"; - for (j = tlen;j < tlen + 16;++j) if (t2[j] != t[j]) return "crypto_box_afternm writes after output"; - for (j = 0;j < crypto_box_BOXZEROBYTES;++j) - if (t[j] != 0) return "crypto_box_afternm does not clear extra bytes"; - for (j = 0;j < mlen;++j) if (t[j] != c[j]) return "crypto_box_afternm does not match crypto_box"; - - if (crypto_box_beforenm(s,pka,skb) != 0) return "crypto_box_beforenm returns nonzero"; - - for (j = -16;j < tlen + 16;++j) t2[j] = t[j] = random(); - if (crypto_box_open_afternm(t,c,clen,n,s) != 0) return "crypto_box_open_afternm returns nonzero"; - for (j = -16;j < slen + 16;++j) if (s2[j] != s[j]) return "crypto_box_open_afternm overwrites s"; - for (j = -16;j < mlen + 16;++j) if (m2[j] != m[j]) return "crypto_box_open_afternm overwrites m"; - for (j = -16;j < nlen + 16;++j) if (n2[j] != n[j]) return "crypto_box_open_afternm overwrites n"; - for (j = -16;j < 0;++j) if (t2[j] != t[j]) return "crypto_box_open_afternm writes before output"; - for (j = tlen;j < tlen + 16;++j) if (t2[j] != t[j]) return "crypto_box_open_afternm writes after output"; - for (j = 0;j < crypto_box_ZEROBYTES;++j) - if (t[j] != 0) return "crypto_box_open_afternm does not clear extra bytes"; - for (j = 0;j < mlen;++j) if (t[j] != m[j]) return "crypto_box_open_afternm does not match crypto_box_open"; - - for (j = 0;j < i;++j) n[j % nlen] ^= c[j + crypto_box_BOXZEROBYTES]; - if (i == 0) m[crypto_box_ZEROBYTES] = 0; - m[i + crypto_box_ZEROBYTES] = m[crypto_box_ZEROBYTES]; - for (j = 0;j < i;++j) m[j + crypto_box_ZEROBYTES] ^= c[j + crypto_box_BOXZEROBYTES]; - } - - for (i = 0;i < nlen;++i) { - checksum[2 * i] = "0123456789abcdef"[15 & (n[i] >> 4)]; - checksum[2 * i + 1] = "0123456789abcdef"[15 & n[i]]; - } - checksum[2 * i] = 0; - return 0; -} diff --git a/src/libnacl/crypto_core/hsalsa20/checksum b/src/libnacl/crypto_core/hsalsa20/checksum deleted file mode 100644 index f67bb2e2..00000000 --- a/src/libnacl/crypto_core/hsalsa20/checksum +++ /dev/null @@ -1 +0,0 @@ -28ebe700b5878570702a68740aa131e6fa907e58a3f6915cd183c6db3f7afd7a diff --git a/src/libnacl/crypto_core/hsalsa20/ref/api.h b/src/libnacl/crypto_core/hsalsa20/ref/api.h deleted file mode 100644 index 73bd8541..00000000 --- a/src/libnacl/crypto_core/hsalsa20/ref/api.h +++ /dev/null @@ -1,4 +0,0 @@ -#define CRYPTO_OUTPUTBYTES 32 -#define CRYPTO_INPUTBYTES 16 -#define CRYPTO_KEYBYTES 32 -#define CRYPTO_CONSTBYTES 16 diff --git a/src/libnacl/crypto_core/hsalsa20/ref/core.c b/src/libnacl/crypto_core/hsalsa20/ref/core.c deleted file mode 100644 index 36118da0..00000000 --- a/src/libnacl/crypto_core/hsalsa20/ref/core.c +++ /dev/null @@ -1,135 +0,0 @@ -/* -version 20080912 -D. J. Bernstein -Public domain. -*/ - -#include "crypto_core.h" - -#define ROUNDS 20 - -typedef unsigned int uint32; - -static uint32 rotate(uint32 u,int c) -{ - return (u << c) | (u >> (32 - c)); -} - -static uint32 load_littleendian(const unsigned char *x) -{ - return - (uint32) (x[0]) \ - | (((uint32) (x[1])) << 8) \ - | (((uint32) (x[2])) << 16) \ - | (((uint32) (x[3])) << 24) - ; -} - -static void store_littleendian(unsigned char *x,uint32 u) -{ - x[0] = u; u >>= 8; - x[1] = u; u >>= 8; - x[2] = u; u >>= 8; - x[3] = u; -} - -int crypto_core( - unsigned char *out, - const unsigned char *in, - const unsigned char *k, - const unsigned char *c -) -{ - uint32 x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15; - uint32 j0, j1, j2, j3, j4, j5, j6, j7, j8, j9, j10, j11, j12, j13, j14, j15; - int i; - - j0 = x0 = load_littleendian(c + 0); - j1 = x1 = load_littleendian(k + 0); - j2 = x2 = load_littleendian(k + 4); - j3 = x3 = load_littleendian(k + 8); - j4 = x4 = load_littleendian(k + 12); - j5 = x5 = load_littleendian(c + 4); - j6 = x6 = load_littleendian(in + 0); - j7 = x7 = load_littleendian(in + 4); - j8 = x8 = load_littleendian(in + 8); - j9 = x9 = load_littleendian(in + 12); - j10 = x10 = load_littleendian(c + 8); - j11 = x11 = load_littleendian(k + 16); - j12 = x12 = load_littleendian(k + 20); - j13 = x13 = load_littleendian(k + 24); - j14 = x14 = load_littleendian(k + 28); - j15 = x15 = load_littleendian(c + 12); - - for (i = ROUNDS;i > 0;i -= 2) { - x4 ^= rotate( x0+x12, 7); - x8 ^= rotate( x4+ x0, 9); - x12 ^= rotate( x8+ x4,13); - x0 ^= rotate(x12+ x8,18); - x9 ^= rotate( x5+ x1, 7); - x13 ^= rotate( x9+ x5, 9); - x1 ^= rotate(x13+ x9,13); - x5 ^= rotate( x1+x13,18); - x14 ^= rotate(x10+ x6, 7); - x2 ^= rotate(x14+x10, 9); - x6 ^= rotate( x2+x14,13); - x10 ^= rotate( x6+ x2,18); - x3 ^= rotate(x15+x11, 7); - x7 ^= rotate( x3+x15, 9); - x11 ^= rotate( x7+ x3,13); - x15 ^= rotate(x11+ x7,18); - x1 ^= rotate( x0+ x3, 7); - x2 ^= rotate( x1+ x0, 9); - x3 ^= rotate( x2+ x1,13); - x0 ^= rotate( x3+ x2,18); - x6 ^= rotate( x5+ x4, 7); - x7 ^= rotate( x6+ x5, 9); - x4 ^= rotate( x7+ x6,13); - x5 ^= rotate( x4+ x7,18); - x11 ^= rotate(x10+ x9, 7); - x8 ^= rotate(x11+x10, 9); - x9 ^= rotate( x8+x11,13); - x10 ^= rotate( x9+ x8,18); - x12 ^= rotate(x15+x14, 7); - x13 ^= rotate(x12+x15, 9); - x14 ^= rotate(x13+x12,13); - x15 ^= rotate(x14+x13,18); - } - - x0 += j0; - x1 += j1; - x2 += j2; - x3 += j3; - x4 += j4; - x5 += j5; - x6 += j6; - x7 += j7; - x8 += j8; - x9 += j9; - x10 += j10; - x11 += j11; - x12 += j12; - x13 += j13; - x14 += j14; - x15 += j15; - - x0 -= load_littleendian(c + 0); - x5 -= load_littleendian(c + 4); - x10 -= load_littleendian(c + 8); - x15 -= load_littleendian(c + 12); - x6 -= load_littleendian(in + 0); - x7 -= load_littleendian(in + 4); - x8 -= load_littleendian(in + 8); - x9 -= load_littleendian(in + 12); - - store_littleendian(out + 0,x0); - store_littleendian(out + 4,x5); - store_littleendian(out + 8,x10); - store_littleendian(out + 12,x15); - store_littleendian(out + 16,x6); - store_littleendian(out + 20,x7); - store_littleendian(out + 24,x8); - store_littleendian(out + 28,x9); - - return 0; -} diff --git a/src/libnacl/crypto_core/hsalsa20/ref/implementors b/src/libnacl/crypto_core/hsalsa20/ref/implementors deleted file mode 100644 index f6fb3c73..00000000 --- a/src/libnacl/crypto_core/hsalsa20/ref/implementors +++ /dev/null @@ -1 +0,0 @@ -Daniel J. Bernstein diff --git a/src/libnacl/crypto_core/hsalsa20/ref2/api.h b/src/libnacl/crypto_core/hsalsa20/ref2/api.h deleted file mode 100644 index 73bd8541..00000000 --- a/src/libnacl/crypto_core/hsalsa20/ref2/api.h +++ /dev/null @@ -1,4 +0,0 @@ -#define CRYPTO_OUTPUTBYTES 32 -#define CRYPTO_INPUTBYTES 16 -#define CRYPTO_KEYBYTES 32 -#define CRYPTO_CONSTBYTES 16 diff --git a/src/libnacl/crypto_core/hsalsa20/ref2/core.c b/src/libnacl/crypto_core/hsalsa20/ref2/core.c deleted file mode 100644 index 9a9a8c7c..00000000 --- a/src/libnacl/crypto_core/hsalsa20/ref2/core.c +++ /dev/null @@ -1,108 +0,0 @@ -/* -version 20080912 -D. J. Bernstein -Public domain. -*/ - -#include "crypto_core.h" - -#define ROUNDS 20 - -typedef unsigned int uint32; - -static uint32 rotate(uint32 u,int c) -{ - return (u << c) | (u >> (32 - c)); -} - -static uint32 load_littleendian(const unsigned char *x) -{ - return - (uint32) (x[0]) \ - | (((uint32) (x[1])) << 8) \ - | (((uint32) (x[2])) << 16) \ - | (((uint32) (x[3])) << 24) - ; -} - -static void store_littleendian(unsigned char *x,uint32 u) -{ - x[0] = u; u >>= 8; - x[1] = u; u >>= 8; - x[2] = u; u >>= 8; - x[3] = u; -} - -int crypto_core( - unsigned char *out, - const unsigned char *in, - const unsigned char *k, - const unsigned char *c -) -{ - uint32 x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15; - int i; - - x0 = load_littleendian(c + 0); - x1 = load_littleendian(k + 0); - x2 = load_littleendian(k + 4); - x3 = load_littleendian(k + 8); - x4 = load_littleendian(k + 12); - x5 = load_littleendian(c + 4); - x6 = load_littleendian(in + 0); - x7 = load_littleendian(in + 4); - x8 = load_littleendian(in + 8); - x9 = load_littleendian(in + 12); - x10 = load_littleendian(c + 8); - x11 = load_littleendian(k + 16); - x12 = load_littleendian(k + 20); - x13 = load_littleendian(k + 24); - x14 = load_littleendian(k + 28); - x15 = load_littleendian(c + 12); - - for (i = ROUNDS;i > 0;i -= 2) { - x4 ^= rotate( x0+x12, 7); - x8 ^= rotate( x4+ x0, 9); - x12 ^= rotate( x8+ x4,13); - x0 ^= rotate(x12+ x8,18); - x9 ^= rotate( x5+ x1, 7); - x13 ^= rotate( x9+ x5, 9); - x1 ^= rotate(x13+ x9,13); - x5 ^= rotate( x1+x13,18); - x14 ^= rotate(x10+ x6, 7); - x2 ^= rotate(x14+x10, 9); - x6 ^= rotate( x2+x14,13); - x10 ^= rotate( x6+ x2,18); - x3 ^= rotate(x15+x11, 7); - x7 ^= rotate( x3+x15, 9); - x11 ^= rotate( x7+ x3,13); - x15 ^= rotate(x11+ x7,18); - x1 ^= rotate( x0+ x3, 7); - x2 ^= rotate( x1+ x0, 9); - x3 ^= rotate( x2+ x1,13); - x0 ^= rotate( x3+ x2,18); - x6 ^= rotate( x5+ x4, 7); - x7 ^= rotate( x6+ x5, 9); - x4 ^= rotate( x7+ x6,13); - x5 ^= rotate( x4+ x7,18); - x11 ^= rotate(x10+ x9, 7); - x8 ^= rotate(x11+x10, 9); - x9 ^= rotate( x8+x11,13); - x10 ^= rotate( x9+ x8,18); - x12 ^= rotate(x15+x14, 7); - x13 ^= rotate(x12+x15, 9); - x14 ^= rotate(x13+x12,13); - x15 ^= rotate(x14+x13,18); - } - - store_littleendian(out + 0,x0); - store_littleendian(out + 4,x5); - store_littleendian(out + 8,x10); - store_littleendian(out + 12,x15); - store_littleendian(out + 16,x6); - store_littleendian(out + 20,x7); - store_littleendian(out + 24,x8); - store_littleendian(out + 28,x9); - - return 0; -} diff --git a/src/libnacl/crypto_core/hsalsa20/ref2/implementors b/src/libnacl/crypto_core/hsalsa20/ref2/implementors deleted file mode 100644 index f6fb3c73..00000000 --- a/src/libnacl/crypto_core/hsalsa20/ref2/implementors +++ /dev/null @@ -1 +0,0 @@ -Daniel J. Bernstein diff --git a/src/libnacl/crypto_core/hsalsa20/used b/src/libnacl/crypto_core/hsalsa20/used deleted file mode 100644 index e69de29b..00000000 diff --git a/src/libnacl/crypto_core/measure.c b/src/libnacl/crypto_core/measure.c deleted file mode 100644 index dd7bac81..00000000 --- a/src/libnacl/crypto_core/measure.c +++ /dev/null @@ -1,18 +0,0 @@ -#include "crypto_core.h" - -const char *primitiveimplementation = crypto_core_IMPLEMENTATION; -const char *implementationversion = crypto_core_VERSION; -const char *sizenames[] = { "outputbytes", "inputbytes", "keybytes", "constbytes", 0 }; -const long long sizes[] = { crypto_core_OUTPUTBYTES, crypto_core_INPUTBYTES, crypto_core_KEYBYTES, crypto_core_CONSTBYTES }; - -void preallocate(void) -{ -} - -void allocate(void) -{ -} - -void measure(void) -{ -} diff --git a/src/libnacl/crypto_core/salsa20/checksum b/src/libnacl/crypto_core/salsa20/checksum deleted file mode 100644 index fcf56186..00000000 --- a/src/libnacl/crypto_core/salsa20/checksum +++ /dev/null @@ -1 +0,0 @@ -9d1ee8d84b974e648507ffd93829376c5b4420751710e44f6593abd8769378011d85ecda51ceb8f43661d3c65ef5b57c4f5bf8df76c8202784c8df8def61e6a6 diff --git a/src/libnacl/crypto_core/salsa20/ref/api.h b/src/libnacl/crypto_core/salsa20/ref/api.h deleted file mode 100644 index 2a387b6d..00000000 --- a/src/libnacl/crypto_core/salsa20/ref/api.h +++ /dev/null @@ -1,4 +0,0 @@ -#define CRYPTO_OUTPUTBYTES 64 -#define CRYPTO_INPUTBYTES 16 -#define CRYPTO_KEYBYTES 32 -#define CRYPTO_CONSTBYTES 16 diff --git a/src/libnacl/crypto_core/salsa20/ref/core.c b/src/libnacl/crypto_core/salsa20/ref/core.c deleted file mode 100644 index 910a0056..00000000 --- a/src/libnacl/crypto_core/salsa20/ref/core.c +++ /dev/null @@ -1,134 +0,0 @@ -/* -version 20080912 -D. J. Bernstein -Public domain. -*/ - -#include "crypto_core.h" - -#define ROUNDS 20 - -typedef unsigned int uint32; - -static uint32 rotate(uint32 u,int c) -{ - return (u << c) | (u >> (32 - c)); -} - -static uint32 load_littleendian(const unsigned char *x) -{ - return - (uint32) (x[0]) \ - | (((uint32) (x[1])) << 8) \ - | (((uint32) (x[2])) << 16) \ - | (((uint32) (x[3])) << 24) - ; -} - -static void store_littleendian(unsigned char *x,uint32 u) -{ - x[0] = u; u >>= 8; - x[1] = u; u >>= 8; - x[2] = u; u >>= 8; - x[3] = u; -} - -int crypto_core( - unsigned char *out, - const unsigned char *in, - const unsigned char *k, - const unsigned char *c -) -{ - uint32 x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15; - uint32 j0, j1, j2, j3, j4, j5, j6, j7, j8, j9, j10, j11, j12, j13, j14, j15; - int i; - - j0 = x0 = load_littleendian(c + 0); - j1 = x1 = load_littleendian(k + 0); - j2 = x2 = load_littleendian(k + 4); - j3 = x3 = load_littleendian(k + 8); - j4 = x4 = load_littleendian(k + 12); - j5 = x5 = load_littleendian(c + 4); - j6 = x6 = load_littleendian(in + 0); - j7 = x7 = load_littleendian(in + 4); - j8 = x8 = load_littleendian(in + 8); - j9 = x9 = load_littleendian(in + 12); - j10 = x10 = load_littleendian(c + 8); - j11 = x11 = load_littleendian(k + 16); - j12 = x12 = load_littleendian(k + 20); - j13 = x13 = load_littleendian(k + 24); - j14 = x14 = load_littleendian(k + 28); - j15 = x15 = load_littleendian(c + 12); - - for (i = ROUNDS;i > 0;i -= 2) { - x4 ^= rotate( x0+x12, 7); - x8 ^= rotate( x4+ x0, 9); - x12 ^= rotate( x8+ x4,13); - x0 ^= rotate(x12+ x8,18); - x9 ^= rotate( x5+ x1, 7); - x13 ^= rotate( x9+ x5, 9); - x1 ^= rotate(x13+ x9,13); - x5 ^= rotate( x1+x13,18); - x14 ^= rotate(x10+ x6, 7); - x2 ^= rotate(x14+x10, 9); - x6 ^= rotate( x2+x14,13); - x10 ^= rotate( x6+ x2,18); - x3 ^= rotate(x15+x11, 7); - x7 ^= rotate( x3+x15, 9); - x11 ^= rotate( x7+ x3,13); - x15 ^= rotate(x11+ x7,18); - x1 ^= rotate( x0+ x3, 7); - x2 ^= rotate( x1+ x0, 9); - x3 ^= rotate( x2+ x1,13); - x0 ^= rotate( x3+ x2,18); - x6 ^= rotate( x5+ x4, 7); - x7 ^= rotate( x6+ x5, 9); - x4 ^= rotate( x7+ x6,13); - x5 ^= rotate( x4+ x7,18); - x11 ^= rotate(x10+ x9, 7); - x8 ^= rotate(x11+x10, 9); - x9 ^= rotate( x8+x11,13); - x10 ^= rotate( x9+ x8,18); - x12 ^= rotate(x15+x14, 7); - x13 ^= rotate(x12+x15, 9); - x14 ^= rotate(x13+x12,13); - x15 ^= rotate(x14+x13,18); - } - - x0 += j0; - x1 += j1; - x2 += j2; - x3 += j3; - x4 += j4; - x5 += j5; - x6 += j6; - x7 += j7; - x8 += j8; - x9 += j9; - x10 += j10; - x11 += j11; - x12 += j12; - x13 += j13; - x14 += j14; - x15 += j15; - - store_littleendian(out + 0,x0); - store_littleendian(out + 4,x1); - store_littleendian(out + 8,x2); - store_littleendian(out + 12,x3); - store_littleendian(out + 16,x4); - store_littleendian(out + 20,x5); - store_littleendian(out + 24,x6); - store_littleendian(out + 28,x7); - store_littleendian(out + 32,x8); - store_littleendian(out + 36,x9); - store_littleendian(out + 40,x10); - store_littleendian(out + 44,x11); - store_littleendian(out + 48,x12); - store_littleendian(out + 52,x13); - store_littleendian(out + 56,x14); - store_littleendian(out + 60,x15); - - return 0; -} diff --git a/src/libnacl/crypto_core/salsa20/ref/implementors b/src/libnacl/crypto_core/salsa20/ref/implementors deleted file mode 100644 index f6fb3c73..00000000 --- a/src/libnacl/crypto_core/salsa20/ref/implementors +++ /dev/null @@ -1 +0,0 @@ -Daniel J. Bernstein diff --git a/src/libnacl/crypto_core/salsa20/used b/src/libnacl/crypto_core/salsa20/used deleted file mode 100644 index e69de29b..00000000 diff --git a/src/libnacl/crypto_core/salsa2012/checksum b/src/libnacl/crypto_core/salsa2012/checksum deleted file mode 100644 index 2f99a8d6..00000000 --- a/src/libnacl/crypto_core/salsa2012/checksum +++ /dev/null @@ -1 +0,0 @@ -f36d643f798efc0fca888d3ac4bdcc54c98a968c2da16bd5b8bfe9fe9025a6ca3a207e9362dc7cf17ddfc7477ee754d3f521b1df91640093754f7275b1a54293 diff --git a/src/libnacl/crypto_core/salsa2012/ref/api.h b/src/libnacl/crypto_core/salsa2012/ref/api.h deleted file mode 100644 index 2a387b6d..00000000 --- a/src/libnacl/crypto_core/salsa2012/ref/api.h +++ /dev/null @@ -1,4 +0,0 @@ -#define CRYPTO_OUTPUTBYTES 64 -#define CRYPTO_INPUTBYTES 16 -#define CRYPTO_KEYBYTES 32 -#define CRYPTO_CONSTBYTES 16 diff --git a/src/libnacl/crypto_core/salsa2012/ref/core.c b/src/libnacl/crypto_core/salsa2012/ref/core.c deleted file mode 100644 index d4b59e48..00000000 --- a/src/libnacl/crypto_core/salsa2012/ref/core.c +++ /dev/null @@ -1,134 +0,0 @@ -/* -version 20080913 -D. J. Bernstein -Public domain. -*/ - -#include "crypto_core.h" - -#define ROUNDS 12 - -typedef unsigned int uint32; - -static uint32 rotate(uint32 u,int c) -{ - return (u << c) | (u >> (32 - c)); -} - -static uint32 load_littleendian(const unsigned char *x) -{ - return - (uint32) (x[0]) \ - | (((uint32) (x[1])) << 8) \ - | (((uint32) (x[2])) << 16) \ - | (((uint32) (x[3])) << 24) - ; -} - -static void store_littleendian(unsigned char *x,uint32 u) -{ - x[0] = u; u >>= 8; - x[1] = u; u >>= 8; - x[2] = u; u >>= 8; - x[3] = u; -} - -int crypto_core( - unsigned char *out, - const unsigned char *in, - const unsigned char *k, - const unsigned char *c -) -{ - uint32 x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15; - uint32 j0, j1, j2, j3, j4, j5, j6, j7, j8, j9, j10, j11, j12, j13, j14, j15; - int i; - - j0 = x0 = load_littleendian(c + 0); - j1 = x1 = load_littleendian(k + 0); - j2 = x2 = load_littleendian(k + 4); - j3 = x3 = load_littleendian(k + 8); - j4 = x4 = load_littleendian(k + 12); - j5 = x5 = load_littleendian(c + 4); - j6 = x6 = load_littleendian(in + 0); - j7 = x7 = load_littleendian(in + 4); - j8 = x8 = load_littleendian(in + 8); - j9 = x9 = load_littleendian(in + 12); - j10 = x10 = load_littleendian(c + 8); - j11 = x11 = load_littleendian(k + 16); - j12 = x12 = load_littleendian(k + 20); - j13 = x13 = load_littleendian(k + 24); - j14 = x14 = load_littleendian(k + 28); - j15 = x15 = load_littleendian(c + 12); - - for (i = ROUNDS;i > 0;i -= 2) { - x4 ^= rotate( x0+x12, 7); - x8 ^= rotate( x4+ x0, 9); - x12 ^= rotate( x8+ x4,13); - x0 ^= rotate(x12+ x8,18); - x9 ^= rotate( x5+ x1, 7); - x13 ^= rotate( x9+ x5, 9); - x1 ^= rotate(x13+ x9,13); - x5 ^= rotate( x1+x13,18); - x14 ^= rotate(x10+ x6, 7); - x2 ^= rotate(x14+x10, 9); - x6 ^= rotate( x2+x14,13); - x10 ^= rotate( x6+ x2,18); - x3 ^= rotate(x15+x11, 7); - x7 ^= rotate( x3+x15, 9); - x11 ^= rotate( x7+ x3,13); - x15 ^= rotate(x11+ x7,18); - x1 ^= rotate( x0+ x3, 7); - x2 ^= rotate( x1+ x0, 9); - x3 ^= rotate( x2+ x1,13); - x0 ^= rotate( x3+ x2,18); - x6 ^= rotate( x5+ x4, 7); - x7 ^= rotate( x6+ x5, 9); - x4 ^= rotate( x7+ x6,13); - x5 ^= rotate( x4+ x7,18); - x11 ^= rotate(x10+ x9, 7); - x8 ^= rotate(x11+x10, 9); - x9 ^= rotate( x8+x11,13); - x10 ^= rotate( x9+ x8,18); - x12 ^= rotate(x15+x14, 7); - x13 ^= rotate(x12+x15, 9); - x14 ^= rotate(x13+x12,13); - x15 ^= rotate(x14+x13,18); - } - - x0 += j0; - x1 += j1; - x2 += j2; - x3 += j3; - x4 += j4; - x5 += j5; - x6 += j6; - x7 += j7; - x8 += j8; - x9 += j9; - x10 += j10; - x11 += j11; - x12 += j12; - x13 += j13; - x14 += j14; - x15 += j15; - - store_littleendian(out + 0,x0); - store_littleendian(out + 4,x1); - store_littleendian(out + 8,x2); - store_littleendian(out + 12,x3); - store_littleendian(out + 16,x4); - store_littleendian(out + 20,x5); - store_littleendian(out + 24,x6); - store_littleendian(out + 28,x7); - store_littleendian(out + 32,x8); - store_littleendian(out + 36,x9); - store_littleendian(out + 40,x10); - store_littleendian(out + 44,x11); - store_littleendian(out + 48,x12); - store_littleendian(out + 52,x13); - store_littleendian(out + 56,x14); - store_littleendian(out + 60,x15); - - return 0; -} diff --git a/src/libnacl/crypto_core/salsa2012/ref/implementors b/src/libnacl/crypto_core/salsa2012/ref/implementors deleted file mode 100644 index f6fb3c73..00000000 --- a/src/libnacl/crypto_core/salsa2012/ref/implementors +++ /dev/null @@ -1 +0,0 @@ -Daniel J. Bernstein diff --git a/src/libnacl/crypto_core/salsa2012/used b/src/libnacl/crypto_core/salsa2012/used deleted file mode 100644 index e69de29b..00000000 diff --git a/src/libnacl/crypto_core/salsa208/checksum b/src/libnacl/crypto_core/salsa208/checksum deleted file mode 100644 index a16cb52f..00000000 --- a/src/libnacl/crypto_core/salsa208/checksum +++ /dev/null @@ -1 +0,0 @@ -1e13ea9e74cb36989f7cbf4abc80b29154e1a8b150bd5244951318abea002a93ae9fe2abbcf7217526ac2a85b66c256ba9374b1257eda0c01816da328edfa11a diff --git a/src/libnacl/crypto_core/salsa208/ref/api.h b/src/libnacl/crypto_core/salsa208/ref/api.h deleted file mode 100644 index 2a387b6d..00000000 --- a/src/libnacl/crypto_core/salsa208/ref/api.h +++ /dev/null @@ -1,4 +0,0 @@ -#define CRYPTO_OUTPUTBYTES 64 -#define CRYPTO_INPUTBYTES 16 -#define CRYPTO_KEYBYTES 32 -#define CRYPTO_CONSTBYTES 16 diff --git a/src/libnacl/crypto_core/salsa208/ref/core.c b/src/libnacl/crypto_core/salsa208/ref/core.c deleted file mode 100644 index 921e7a86..00000000 --- a/src/libnacl/crypto_core/salsa208/ref/core.c +++ /dev/null @@ -1,134 +0,0 @@ -/* -version 20080913 -D. J. Bernstein -Public domain. -*/ - -#include "crypto_core.h" - -#define ROUNDS 8 - -typedef unsigned int uint32; - -static uint32 rotate(uint32 u,int c) -{ - return (u << c) | (u >> (32 - c)); -} - -static uint32 load_littleendian(const unsigned char *x) -{ - return - (uint32) (x[0]) \ - | (((uint32) (x[1])) << 8) \ - | (((uint32) (x[2])) << 16) \ - | (((uint32) (x[3])) << 24) - ; -} - -static void store_littleendian(unsigned char *x,uint32 u) -{ - x[0] = u; u >>= 8; - x[1] = u; u >>= 8; - x[2] = u; u >>= 8; - x[3] = u; -} - -int crypto_core( - unsigned char *out, - const unsigned char *in, - const unsigned char *k, - const unsigned char *c -) -{ - uint32 x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15; - uint32 j0, j1, j2, j3, j4, j5, j6, j7, j8, j9, j10, j11, j12, j13, j14, j15; - int i; - - j0 = x0 = load_littleendian(c + 0); - j1 = x1 = load_littleendian(k + 0); - j2 = x2 = load_littleendian(k + 4); - j3 = x3 = load_littleendian(k + 8); - j4 = x4 = load_littleendian(k + 12); - j5 = x5 = load_littleendian(c + 4); - j6 = x6 = load_littleendian(in + 0); - j7 = x7 = load_littleendian(in + 4); - j8 = x8 = load_littleendian(in + 8); - j9 = x9 = load_littleendian(in + 12); - j10 = x10 = load_littleendian(c + 8); - j11 = x11 = load_littleendian(k + 16); - j12 = x12 = load_littleendian(k + 20); - j13 = x13 = load_littleendian(k + 24); - j14 = x14 = load_littleendian(k + 28); - j15 = x15 = load_littleendian(c + 12); - - for (i = ROUNDS;i > 0;i -= 2) { - x4 ^= rotate( x0+x12, 7); - x8 ^= rotate( x4+ x0, 9); - x12 ^= rotate( x8+ x4,13); - x0 ^= rotate(x12+ x8,18); - x9 ^= rotate( x5+ x1, 7); - x13 ^= rotate( x9+ x5, 9); - x1 ^= rotate(x13+ x9,13); - x5 ^= rotate( x1+x13,18); - x14 ^= rotate(x10+ x6, 7); - x2 ^= rotate(x14+x10, 9); - x6 ^= rotate( x2+x14,13); - x10 ^= rotate( x6+ x2,18); - x3 ^= rotate(x15+x11, 7); - x7 ^= rotate( x3+x15, 9); - x11 ^= rotate( x7+ x3,13); - x15 ^= rotate(x11+ x7,18); - x1 ^= rotate( x0+ x3, 7); - x2 ^= rotate( x1+ x0, 9); - x3 ^= rotate( x2+ x1,13); - x0 ^= rotate( x3+ x2,18); - x6 ^= rotate( x5+ x4, 7); - x7 ^= rotate( x6+ x5, 9); - x4 ^= rotate( x7+ x6,13); - x5 ^= rotate( x4+ x7,18); - x11 ^= rotate(x10+ x9, 7); - x8 ^= rotate(x11+x10, 9); - x9 ^= rotate( x8+x11,13); - x10 ^= rotate( x9+ x8,18); - x12 ^= rotate(x15+x14, 7); - x13 ^= rotate(x12+x15, 9); - x14 ^= rotate(x13+x12,13); - x15 ^= rotate(x14+x13,18); - } - - x0 += j0; - x1 += j1; - x2 += j2; - x3 += j3; - x4 += j4; - x5 += j5; - x6 += j6; - x7 += j7; - x8 += j8; - x9 += j9; - x10 += j10; - x11 += j11; - x12 += j12; - x13 += j13; - x14 += j14; - x15 += j15; - - store_littleendian(out + 0,x0); - store_littleendian(out + 4,x1); - store_littleendian(out + 8,x2); - store_littleendian(out + 12,x3); - store_littleendian(out + 16,x4); - store_littleendian(out + 20,x5); - store_littleendian(out + 24,x6); - store_littleendian(out + 28,x7); - store_littleendian(out + 32,x8); - store_littleendian(out + 36,x9); - store_littleendian(out + 40,x10); - store_littleendian(out + 44,x11); - store_littleendian(out + 48,x12); - store_littleendian(out + 52,x13); - store_littleendian(out + 56,x14); - store_littleendian(out + 60,x15); - - return 0; -} diff --git a/src/libnacl/crypto_core/salsa208/ref/implementors b/src/libnacl/crypto_core/salsa208/ref/implementors deleted file mode 100644 index f6fb3c73..00000000 --- a/src/libnacl/crypto_core/salsa208/ref/implementors +++ /dev/null @@ -1 +0,0 @@ -Daniel J. Bernstein diff --git a/src/libnacl/crypto_core/salsa208/used b/src/libnacl/crypto_core/salsa208/used deleted file mode 100644 index e69de29b..00000000 diff --git a/src/libnacl/crypto_core/try.c b/src/libnacl/crypto_core/try.c deleted file mode 100644 index 6f5534e7..00000000 --- a/src/libnacl/crypto_core/try.c +++ /dev/null @@ -1,117 +0,0 @@ -/* - * crypto_core/try.c version 20090118 - * D. J. Bernstein - * Public domain. - */ - -#include -#include "crypto_core.h" -#include "windows/windows-quirks.h" - -extern unsigned char *alignedcalloc(unsigned long long); - -const char *primitiveimplementation = crypto_core_IMPLEMENTATION; - -static unsigned char *h; -static unsigned char *n; -static unsigned char *k; -static unsigned char *c; -static unsigned char *h2; -static unsigned char *n2; -static unsigned char *k2; -static unsigned char *c2; - -#define hlen crypto_core_OUTPUTBYTES -#define nlen crypto_core_INPUTBYTES -#define klen crypto_core_KEYBYTES -#define clen crypto_core_CONSTBYTES - -void preallocate(void) -{ -} - -void allocate(void) -{ - h = alignedcalloc(hlen); - n = alignedcalloc(nlen); - k = alignedcalloc(klen); - c = alignedcalloc(clen); - h2 = alignedcalloc(hlen); - n2 = alignedcalloc(nlen + crypto_core_OUTPUTBYTES); - k2 = alignedcalloc(klen + crypto_core_OUTPUTBYTES); - c2 = alignedcalloc(clen + crypto_core_OUTPUTBYTES); -} - -void predoit(void) -{ -} - -void doit(void) -{ - crypto_core(h,n,k,c); -} - -static unsigned char newbyte(void) -{ - unsigned long long x; - long long j; - x = 8675309; - for (j = 0;j < hlen;++j) { x += h[j]; x *= x; x += (x >> 31); } - for (j = 0;j < nlen;++j) { x += n[j]; x *= x; x += (x >> 31); } - for (j = 0;j < klen;++j) { x += k[j]; x *= x; x += (x >> 31); } - for (j = 0;j < clen;++j) { x += c[j]; x *= x; x += (x >> 31); } - for (j = 0;j < 100;++j) { x += j ; x *= x; x += (x >> 31); } - return x; -} - -char checksum[hlen * 2 + 1]; - -const char *checksum_compute(void) -{ - long long i; - long long j; - - for (i = 0;i < 100;++i) { - for (j = -16;j < 0;++j) h[j] = random(); - for (j = hlen;j < hlen + 16;++j) h[j] = random(); - for (j = -16;j < hlen + 16;++j) h2[j] = h[j]; - for (j = -16;j < 0;++j) n[j] = random(); - for (j = nlen;j < nlen + 16;++j) n[j] = random(); - for (j = -16;j < nlen + 16;++j) n2[j] = n[j]; - for (j = -16;j < 0;++j) k[j] = random(); - for (j = klen;j < klen + 16;++j) k[j] = random(); - for (j = -16;j < klen + 16;++j) k2[j] = k[j]; - for (j = -16;j < 0;++j) c[j] = random(); - for (j = clen;j < clen + 16;++j) c[j] = random(); - for (j = -16;j < clen + 16;++j) c2[j] = c[j]; - if (crypto_core(h,n,k,c) != 0) return "crypto_core returns nonzero"; - for (j = -16;j < 0;++j) if (h2[j] != h[j]) return "crypto_core writes before output"; - for (j = hlen;j < hlen + 16;++j) if (h2[j] != h[j]) return "crypto_core writes after output"; - for (j = -16;j < klen + 16;++j) if (k2[j] != k[j]) return "crypto_core writes to k"; - for (j = -16;j < nlen + 16;++j) if (n2[j] != n[j]) return "crypto_core writes to n"; - for (j = -16;j < clen + 16;++j) if (c2[j] != c[j]) return "crypto_core writes to c"; - - if (crypto_core(n2,n2,k,c) != 0) return "crypto_core returns nonzero"; - for (j = 0;j < hlen;++j) if (h[j] != n2[j]) return "crypto_core does not handle n overlap"; - for (j = 0;j < hlen;++j) n2[j] = n[j]; - if (crypto_core(k2,n2,k2,c) != 0) return "crypto_core returns nonzero"; - for (j = 0;j < hlen;++j) if (h[j] != k2[j]) return "crypto_core does not handle k overlap"; - for (j = 0;j < hlen;++j) k2[j] = k[j]; - if (crypto_core(c2,n2,k2,c2) != 0) return "crypto_core returns nonzero"; - for (j = 0;j < hlen;++j) if (h[j] != c2[j]) return "crypto_core does not handle c overlap"; - for (j = 0;j < hlen;++j) c2[j] = c[j]; - - for (j = 0;j < nlen;++j) n[j] = newbyte(); - if (crypto_core(h,n,k,c) != 0) return "crypto_core returns nonzero"; - for (j = 0;j < klen;++j) k[j] = newbyte(); - if (crypto_core(h,n,k,c) != 0) return "crypto_core returns nonzero"; - for (j = 0;j < clen;++j) c[j] = newbyte(); - } - - for (i = 0;i < hlen;++i) { - checksum[2 * i] = "0123456789abcdef"[15 & (h[i] >> 4)]; - checksum[2 * i + 1] = "0123456789abcdef"[15 & h[i]]; - } - checksum[2 * i] = 0; - return 0; -} diff --git a/src/libnacl/crypto_hash/measure.c b/src/libnacl/crypto_hash/measure.c deleted file mode 100644 index cec0404d..00000000 --- a/src/libnacl/crypto_hash/measure.c +++ /dev/null @@ -1,66 +0,0 @@ -#include -#include "randombytes.h" -#include "cpucycles.h" -#include "crypto_hash.h" - -extern void printentry(long long,const char *,long long *,long long); -extern unsigned char *alignedcalloc(unsigned long long); -extern const char *primitiveimplementation; -extern const char *implementationversion; -extern const char *sizenames[]; -extern const long long sizes[]; -extern void allocate(void); -extern void measure(void); - -const char *primitiveimplementation = crypto_hash_IMPLEMENTATION; -const char *implementationversion = crypto_hash_VERSION; -const char *sizenames[] = { "outputbytes", 0 }; -const long long sizes[] = { crypto_hash_BYTES }; - -#define MAXTEST_BYTES 4096 -#ifdef SUPERCOP -#define MGAP 8192 -#else -#define MGAP 8 -#endif - -static unsigned char *h; -static unsigned char *m; - -void preallocate(void) -{ -} - -void allocate(void) -{ - h = alignedcalloc(crypto_hash_BYTES); - m = alignedcalloc(MAXTEST_BYTES); -} - -#define TIMINGS 15 -static long long cycles[TIMINGS + 1]; - -static void printcycles(long long mlen) -{ - int i; - for (i = 0;i < TIMINGS;++i) cycles[i] = cycles[i + 1] - cycles[i]; - printentry(mlen,"cycles",cycles,TIMINGS); -} - -void measure(void) -{ - int i; - int loop; - int mlen; - - for (loop = 0;loop < LOOPS;++loop) { - for (mlen = 0;mlen <= MAXTEST_BYTES;mlen += 1 + mlen / MGAP) { - randombytes(m,mlen); - for (i = 0;i <= TIMINGS;++i) { - cycles[i] = cpucycles(); - crypto_hash(h,m,mlen); - } - printcycles(mlen); - } - } -} diff --git a/src/libnacl/crypto_hash/sha256/checksum b/src/libnacl/crypto_hash/sha256/checksum deleted file mode 100644 index ee52aa30..00000000 --- a/src/libnacl/crypto_hash/sha256/checksum +++ /dev/null @@ -1 +0,0 @@ -86df8bd202b2a2b5fdc04a7f50a591e43a345849c12fef08d487109648a08e05 diff --git a/src/libnacl/crypto_hash/sha256/ref/api.h b/src/libnacl/crypto_hash/sha256/ref/api.h deleted file mode 100644 index ae8c7f6a..00000000 --- a/src/libnacl/crypto_hash/sha256/ref/api.h +++ /dev/null @@ -1 +0,0 @@ -#define CRYPTO_BYTES 32 diff --git a/src/libnacl/crypto_hash/sha256/ref/hash.c b/src/libnacl/crypto_hash/sha256/ref/hash.c deleted file mode 100644 index 21ce68a0..00000000 --- a/src/libnacl/crypto_hash/sha256/ref/hash.c +++ /dev/null @@ -1,69 +0,0 @@ -/* -20080913 -D. J. Bernstein -Public domain. -*/ - -#include "crypto_hashblocks_sha256.h" -#include "crypto_hash.h" - -#define blocks crypto_hashblocks_sha256 - -typedef unsigned int uint32; - -static const char iv[32] = { - 0x6a,0x09,0xe6,0x67, - 0xbb,0x67,0xae,0x85, - 0x3c,0x6e,0xf3,0x72, - 0xa5,0x4f,0xf5,0x3a, - 0x51,0x0e,0x52,0x7f, - 0x9b,0x05,0x68,0x8c, - 0x1f,0x83,0xd9,0xab, - 0x5b,0xe0,0xcd,0x19, -} ; - -int crypto_hash(unsigned char *out,const unsigned char *in,unsigned long long inlen) -{ - unsigned char h[32]; - unsigned char padded[128]; - int i; - unsigned long long bits = inlen << 3; - - for (i = 0;i < 32;++i) h[i] = iv[i]; - - blocks(h,in,inlen); - in += inlen; - inlen &= 63; - in -= inlen; - - for (i = 0;i < inlen;++i) padded[i] = in[i]; - padded[inlen] = 0x80; - - if (inlen < 56) { - for (i = inlen + 1;i < 56;++i) padded[i] = 0; - padded[56] = bits >> 56; - padded[57] = bits >> 48; - padded[58] = bits >> 40; - padded[59] = bits >> 32; - padded[60] = bits >> 24; - padded[61] = bits >> 16; - padded[62] = bits >> 8; - padded[63] = bits; - blocks(h,padded,64); - } else { - for (i = inlen + 1;i < 120;++i) padded[i] = 0; - padded[120] = bits >> 56; - padded[121] = bits >> 48; - padded[122] = bits >> 40; - padded[123] = bits >> 32; - padded[124] = bits >> 24; - padded[125] = bits >> 16; - padded[126] = bits >> 8; - padded[127] = bits; - blocks(h,padded,128); - } - - for (i = 0;i < 32;++i) out[i] = h[i]; - - return 0; -} diff --git a/src/libnacl/crypto_hash/sha256/ref/implementors b/src/libnacl/crypto_hash/sha256/ref/implementors deleted file mode 100644 index 962e7d8e..00000000 --- a/src/libnacl/crypto_hash/sha256/ref/implementors +++ /dev/null @@ -1 +0,0 @@ -Daniel J. Bernstein (wrapper around crypto_hashblocks/sha256) diff --git a/src/libnacl/crypto_hash/sha256/used b/src/libnacl/crypto_hash/sha256/used deleted file mode 100644 index e69de29b..00000000 diff --git a/src/libnacl/crypto_hash/sha512/checksum b/src/libnacl/crypto_hash/sha512/checksum deleted file mode 100644 index edf714e9..00000000 --- a/src/libnacl/crypto_hash/sha512/checksum +++ /dev/null @@ -1 +0,0 @@ -9a2a989e136a02c3362c98e6e1e0b52fab980a1dafbebe4dd5e44d15d061742e35fb686befd4e33c608d251c96e26c020f90d92bb7ec8a657f79bb8e0b00a473 diff --git a/src/libnacl/crypto_hash/sha512/ref/api.h b/src/libnacl/crypto_hash/sha512/ref/api.h deleted file mode 100644 index de9380d7..00000000 --- a/src/libnacl/crypto_hash/sha512/ref/api.h +++ /dev/null @@ -1 +0,0 @@ -#define CRYPTO_BYTES 64 diff --git a/src/libnacl/crypto_hash/sha512/ref/hash.c b/src/libnacl/crypto_hash/sha512/ref/hash.c deleted file mode 100644 index fc4347bb..00000000 --- a/src/libnacl/crypto_hash/sha512/ref/hash.c +++ /dev/null @@ -1,71 +0,0 @@ -/* -20080913 -D. J. Bernstein -Public domain. -*/ - -#include "crypto_hashblocks_sha512.h" -#include "crypto_hash.h" - -#define blocks crypto_hashblocks_sha512 - -static const unsigned char iv[64] = { - 0x6a,0x09,0xe6,0x67,0xf3,0xbc,0xc9,0x08, - 0xbb,0x67,0xae,0x85,0x84,0xca,0xa7,0x3b, - 0x3c,0x6e,0xf3,0x72,0xfe,0x94,0xf8,0x2b, - 0xa5,0x4f,0xf5,0x3a,0x5f,0x1d,0x36,0xf1, - 0x51,0x0e,0x52,0x7f,0xad,0xe6,0x82,0xd1, - 0x9b,0x05,0x68,0x8c,0x2b,0x3e,0x6c,0x1f, - 0x1f,0x83,0xd9,0xab,0xfb,0x41,0xbd,0x6b, - 0x5b,0xe0,0xcd,0x19,0x13,0x7e,0x21,0x79 -} ; - -typedef unsigned long long uint64; - -int crypto_hash(unsigned char *out,const unsigned char *in,unsigned long long inlen) -{ - unsigned char h[64]; - unsigned char padded[256]; - int i; - unsigned long long bytes = inlen; - - for (i = 0;i < 64;++i) h[i] = iv[i]; - - blocks(h,in,inlen); - in += inlen; - inlen &= 127; - in -= inlen; - - for (i = 0;i < inlen;++i) padded[i] = in[i]; - padded[inlen] = 0x80; - - if (inlen < 112) { - for (i = inlen + 1;i < 119;++i) padded[i] = 0; - padded[119] = bytes >> 61; - padded[120] = bytes >> 53; - padded[121] = bytes >> 45; - padded[122] = bytes >> 37; - padded[123] = bytes >> 29; - padded[124] = bytes >> 21; - padded[125] = bytes >> 13; - padded[126] = bytes >> 5; - padded[127] = bytes << 3; - blocks(h,padded,128); - } else { - for (i = inlen + 1;i < 247;++i) padded[i] = 0; - padded[247] = bytes >> 61; - padded[248] = bytes >> 53; - padded[249] = bytes >> 45; - padded[250] = bytes >> 37; - padded[251] = bytes >> 29; - padded[252] = bytes >> 21; - padded[253] = bytes >> 13; - padded[254] = bytes >> 5; - padded[255] = bytes << 3; - blocks(h,padded,256); - } - - for (i = 0;i < 64;++i) out[i] = h[i]; - - return 0; -} diff --git a/src/libnacl/crypto_hash/sha512/ref/implementors b/src/libnacl/crypto_hash/sha512/ref/implementors deleted file mode 100644 index 40afca09..00000000 --- a/src/libnacl/crypto_hash/sha512/ref/implementors +++ /dev/null @@ -1 +0,0 @@ -Daniel J. Bernstein (wrapper around crypto_hashblocks/sha512) diff --git a/src/libnacl/crypto_hash/sha512/selected b/src/libnacl/crypto_hash/sha512/selected deleted file mode 100644 index e69de29b..00000000 diff --git a/src/libnacl/crypto_hash/sha512/used b/src/libnacl/crypto_hash/sha512/used deleted file mode 100644 index e69de29b..00000000 diff --git a/src/libnacl/crypto_hash/try.c b/src/libnacl/crypto_hash/try.c deleted file mode 100644 index c98beacc..00000000 --- a/src/libnacl/crypto_hash/try.c +++ /dev/null @@ -1,78 +0,0 @@ -/* - * crypto_hash/try.c version 20090118 - * D. J. Bernstein - * Public domain. - */ - -#include -#include "crypto_hash.h" -#include "windows/windows-quirks.h" - -extern unsigned char *alignedcalloc(unsigned long long); - -const char *primitiveimplementation = crypto_hash_IMPLEMENTATION; - -#define MAXTEST_BYTES (10000 + crypto_hash_BYTES) -#define CHECKSUM_BYTES 4096 -#define TUNE_BYTES 1536 - -static unsigned char *h; -static unsigned char *h2; -static unsigned char *m; -static unsigned char *m2; - -void preallocate(void) -{ -} - -void allocate(void) -{ - h = alignedcalloc(crypto_hash_BYTES); - h2 = alignedcalloc(crypto_hash_BYTES); - m = alignedcalloc(MAXTEST_BYTES); - m2 = alignedcalloc(MAXTEST_BYTES); -} - -void predoit(void) -{ -} - -void doit(void) -{ - crypto_hash(h,m,TUNE_BYTES); -} - -char checksum[crypto_hash_BYTES * 2 + 1]; - -const char *checksum_compute(void) -{ - long long i; - long long j; - - for (i = 0;i < CHECKSUM_BYTES;++i) { - long long hlen = crypto_hash_BYTES; - long long mlen = i; - for (j = -16;j < 0;++j) h[j] = random(); - for (j = hlen;j < hlen + 16;++j) h[j] = random(); - for (j = -16;j < hlen + 16;++j) h2[j] = h[j]; - for (j = -16;j < 0;++j) m[j] = random(); - for (j = mlen;j < mlen + 16;++j) m[j] = random(); - for (j = -16;j < mlen + 16;++j) m2[j] = m[j]; - if (crypto_hash(h,m,mlen) != 0) return "crypto_hash returns nonzero"; - for (j = -16;j < mlen + 16;++j) if (m2[j] != m[j]) return "crypto_hash writes to input"; - for (j = -16;j < 0;++j) if (h2[j] != h[j]) return "crypto_hash writes before output"; - for (j = hlen;j < hlen + 16;++j) if (h2[j] != h[j]) return "crypto_hash writes after output"; - if (crypto_hash(m2,m2,mlen) != 0) return "crypto_hash returns nonzero"; - for (j = 0;j < hlen;++j) if (m2[j] != h[j]) return "crypto_hash does not handle overlap"; - for (j = 0;j < mlen;++j) m[j] ^= h[j % hlen]; - m[mlen] = h[0]; - } - if (crypto_hash(h,m,CHECKSUM_BYTES) != 0) return "crypto_hash returns nonzero"; - - for (i = 0;i < crypto_hash_BYTES;++i) { - checksum[2 * i] = "0123456789abcdef"[15 & (h[i] >> 4)]; - checksum[2 * i + 1] = "0123456789abcdef"[15 & h[i]]; - } - checksum[2 * i] = 0; - return 0; -} diff --git a/src/libnacl/crypto_hashblocks/measure.c b/src/libnacl/crypto_hashblocks/measure.c deleted file mode 100644 index 145fbbc4..00000000 --- a/src/libnacl/crypto_hashblocks/measure.c +++ /dev/null @@ -1,18 +0,0 @@ -#include "crypto_hashblocks.h" - -const char *primitiveimplementation = crypto_hashblocks_IMPLEMENTATION; -const char *implementationversion = crypto_hashblocks_VERSION; -const char *sizenames[] = { "statebytes", 0 }; -const long long sizes[] = { crypto_hashblocks_STATEBYTES }; - -void preallocate(void) -{ -} - -void allocate(void) -{ -} - -void measure(void) -{ -} diff --git a/src/libnacl/crypto_hashblocks/sha256/checksum b/src/libnacl/crypto_hashblocks/sha256/checksum deleted file mode 100644 index edde1d4f..00000000 --- a/src/libnacl/crypto_hashblocks/sha256/checksum +++ /dev/null @@ -1 +0,0 @@ -69a9dc2464f9593161e462d3dbb634b84f1d68d67d26df29aaa805f9dcd8f656 diff --git a/src/libnacl/crypto_hashblocks/sha256/inplace/api.h b/src/libnacl/crypto_hashblocks/sha256/inplace/api.h deleted file mode 100644 index 005a4f47..00000000 --- a/src/libnacl/crypto_hashblocks/sha256/inplace/api.h +++ /dev/null @@ -1,2 +0,0 @@ -#define CRYPTO_STATEBYTES 32 -#define CRYPTO_BLOCKBYTES 64 diff --git a/src/libnacl/crypto_hashblocks/sha256/inplace/blocks.c b/src/libnacl/crypto_hashblocks/sha256/inplace/blocks.c deleted file mode 100644 index 3364dc03..00000000 --- a/src/libnacl/crypto_hashblocks/sha256/inplace/blocks.c +++ /dev/null @@ -1,228 +0,0 @@ -#include "crypto_hashblocks.h" - -typedef unsigned int uint32; - -static uint32 load_bigendian(const unsigned char *x) -{ - return - (uint32) (x[3]) \ - | (((uint32) (x[2])) << 8) \ - | (((uint32) (x[1])) << 16) \ - | (((uint32) (x[0])) << 24) - ; -} - -static void store_bigendian(unsigned char *x,uint32 u) -{ - x[3] = u; u >>= 8; - x[2] = u; u >>= 8; - x[1] = u; u >>= 8; - x[0] = u; -} - -#define SHR(x,c) ((x) >> (c)) -#define ROTR(x,c) (((x) >> (c)) | ((x) << (32 - (c)))) - -#define Ch(x,y,z) ((x & y) ^ (~x & z)) -#define Maj(x,y,z) ((x & y) ^ (x & z) ^ (y & z)) -#define Sigma0(x) (ROTR(x, 2) ^ ROTR(x,13) ^ ROTR(x,22)) -#define Sigma1(x) (ROTR(x, 6) ^ ROTR(x,11) ^ ROTR(x,25)) -#define sigma0(x) (ROTR(x, 7) ^ ROTR(x,18) ^ SHR(x, 3)) -#define sigma1(x) (ROTR(x,17) ^ ROTR(x,19) ^ SHR(x,10)) - -#define M(w0,w14,w9,w1) w0 += sigma1(w14) + w9 + sigma0(w1); - -#define EXPAND \ - M(w0 ,w14,w9 ,w1 ) \ - M(w1 ,w15,w10,w2 ) \ - M(w2 ,w0 ,w11,w3 ) \ - M(w3 ,w1 ,w12,w4 ) \ - M(w4 ,w2 ,w13,w5 ) \ - M(w5 ,w3 ,w14,w6 ) \ - M(w6 ,w4 ,w15,w7 ) \ - M(w7 ,w5 ,w0 ,w8 ) \ - M(w8 ,w6 ,w1 ,w9 ) \ - M(w9 ,w7 ,w2 ,w10) \ - M(w10,w8 ,w3 ,w11) \ - M(w11,w9 ,w4 ,w12) \ - M(w12,w10,w5 ,w13) \ - M(w13,w11,w6 ,w14) \ - M(w14,w12,w7 ,w15) \ - M(w15,w13,w8 ,w0 ) - -#define F(r0,r1,r2,r3,r4,r5,r6,r7,w,k) \ - r7 += Sigma1(r4) + Ch(r4,r5,r6) + k + w; \ - r3 += r7; \ - r7 += Sigma0(r0) + Maj(r0,r1,r2); - -#define G(r0,r1,r2,r3,r4,r5,r6,r7,i) \ - F(r0,r1,r2,r3,r4,r5,r6,r7,w0 ,round[i + 0]) \ - F(r7,r0,r1,r2,r3,r4,r5,r6,w1 ,round[i + 1]) \ - F(r6,r7,r0,r1,r2,r3,r4,r5,w2 ,round[i + 2]) \ - F(r5,r6,r7,r0,r1,r2,r3,r4,w3 ,round[i + 3]) \ - F(r4,r5,r6,r7,r0,r1,r2,r3,w4 ,round[i + 4]) \ - F(r3,r4,r5,r6,r7,r0,r1,r2,w5 ,round[i + 5]) \ - F(r2,r3,r4,r5,r6,r7,r0,r1,w6 ,round[i + 6]) \ - F(r1,r2,r3,r4,r5,r6,r7,r0,w7 ,round[i + 7]) \ - F(r0,r1,r2,r3,r4,r5,r6,r7,w8 ,round[i + 8]) \ - F(r7,r0,r1,r2,r3,r4,r5,r6,w9 ,round[i + 9]) \ - F(r6,r7,r0,r1,r2,r3,r4,r5,w10,round[i + 10]) \ - F(r5,r6,r7,r0,r1,r2,r3,r4,w11,round[i + 11]) \ - F(r4,r5,r6,r7,r0,r1,r2,r3,w12,round[i + 12]) \ - F(r3,r4,r5,r6,r7,r0,r1,r2,w13,round[i + 13]) \ - F(r2,r3,r4,r5,r6,r7,r0,r1,w14,round[i + 14]) \ - F(r1,r2,r3,r4,r5,r6,r7,r0,w15,round[i + 15]) - -static const uint32 round[64] = { - 0x428a2f98 -, 0x71374491 -, 0xb5c0fbcf -, 0xe9b5dba5 -, 0x3956c25b -, 0x59f111f1 -, 0x923f82a4 -, 0xab1c5ed5 -, 0xd807aa98 -, 0x12835b01 -, 0x243185be -, 0x550c7dc3 -, 0x72be5d74 -, 0x80deb1fe -, 0x9bdc06a7 -, 0xc19bf174 -, 0xe49b69c1 -, 0xefbe4786 -, 0x0fc19dc6 -, 0x240ca1cc -, 0x2de92c6f -, 0x4a7484aa -, 0x5cb0a9dc -, 0x76f988da -, 0x983e5152 -, 0xa831c66d -, 0xb00327c8 -, 0xbf597fc7 -, 0xc6e00bf3 -, 0xd5a79147 -, 0x06ca6351 -, 0x14292967 -, 0x27b70a85 -, 0x2e1b2138 -, 0x4d2c6dfc -, 0x53380d13 -, 0x650a7354 -, 0x766a0abb -, 0x81c2c92e -, 0x92722c85 -, 0xa2bfe8a1 -, 0xa81a664b -, 0xc24b8b70 -, 0xc76c51a3 -, 0xd192e819 -, 0xd6990624 -, 0xf40e3585 -, 0x106aa070 -, 0x19a4c116 -, 0x1e376c08 -, 0x2748774c -, 0x34b0bcb5 -, 0x391c0cb3 -, 0x4ed8aa4a -, 0x5b9cca4f -, 0x682e6ff3 -, 0x748f82ee -, 0x78a5636f -, 0x84c87814 -, 0x8cc70208 -, 0x90befffa -, 0xa4506ceb -, 0xbef9a3f7 -, 0xc67178f2 -} ; - -int crypto_hashblocks(unsigned char *statebytes,const unsigned char *in,unsigned long long inlen) -{ - uint32 state[8]; - uint32 r0; - uint32 r1; - uint32 r2; - uint32 r3; - uint32 r4; - uint32 r5; - uint32 r6; - uint32 r7; - - r0 = load_bigendian(statebytes + 0); state[0] = r0; - r1 = load_bigendian(statebytes + 4); state[1] = r1; - r2 = load_bigendian(statebytes + 8); state[2] = r2; - r3 = load_bigendian(statebytes + 12); state[3] = r3; - r4 = load_bigendian(statebytes + 16); state[4] = r4; - r5 = load_bigendian(statebytes + 20); state[5] = r5; - r6 = load_bigendian(statebytes + 24); state[6] = r6; - r7 = load_bigendian(statebytes + 28); state[7] = r7; - - while (inlen >= 64) { - uint32 w0 = load_bigendian(in + 0); - uint32 w1 = load_bigendian(in + 4); - uint32 w2 = load_bigendian(in + 8); - uint32 w3 = load_bigendian(in + 12); - uint32 w4 = load_bigendian(in + 16); - uint32 w5 = load_bigendian(in + 20); - uint32 w6 = load_bigendian(in + 24); - uint32 w7 = load_bigendian(in + 28); - uint32 w8 = load_bigendian(in + 32); - uint32 w9 = load_bigendian(in + 36); - uint32 w10 = load_bigendian(in + 40); - uint32 w11 = load_bigendian(in + 44); - uint32 w12 = load_bigendian(in + 48); - uint32 w13 = load_bigendian(in + 52); - uint32 w14 = load_bigendian(in + 56); - uint32 w15 = load_bigendian(in + 60); - - G(r0,r1,r2,r3,r4,r5,r6,r7,0) - - EXPAND - - G(r0,r1,r2,r3,r4,r5,r6,r7,16) - - EXPAND - - G(r0,r1,r2,r3,r4,r5,r6,r7,32) - - EXPAND - - G(r0,r1,r2,r3,r4,r5,r6,r7,48) - - r0 += state[0]; - r1 += state[1]; - r2 += state[2]; - r3 += state[3]; - r4 += state[4]; - r5 += state[5]; - r6 += state[6]; - r7 += state[7]; - - state[0] = r0; - state[1] = r1; - state[2] = r2; - state[3] = r3; - state[4] = r4; - state[5] = r5; - state[6] = r6; - state[7] = r7; - - in += 64; - inlen -= 64; - } - - store_bigendian(statebytes + 0,state[0]); - store_bigendian(statebytes + 4,state[1]); - store_bigendian(statebytes + 8,state[2]); - store_bigendian(statebytes + 12,state[3]); - store_bigendian(statebytes + 16,state[4]); - store_bigendian(statebytes + 20,state[5]); - store_bigendian(statebytes + 24,state[6]); - store_bigendian(statebytes + 28,state[7]); - - return 0; -} diff --git a/src/libnacl/crypto_hashblocks/sha256/inplace/implementors b/src/libnacl/crypto_hashblocks/sha256/inplace/implementors deleted file mode 100644 index f6fb3c73..00000000 --- a/src/libnacl/crypto_hashblocks/sha256/inplace/implementors +++ /dev/null @@ -1 +0,0 @@ -Daniel J. Bernstein diff --git a/src/libnacl/crypto_hashblocks/sha256/ref/api.h b/src/libnacl/crypto_hashblocks/sha256/ref/api.h deleted file mode 100644 index 005a4f47..00000000 --- a/src/libnacl/crypto_hashblocks/sha256/ref/api.h +++ /dev/null @@ -1,2 +0,0 @@ -#define CRYPTO_STATEBYTES 32 -#define CRYPTO_BLOCKBYTES 64 diff --git a/src/libnacl/crypto_hashblocks/sha256/ref/blocks.c b/src/libnacl/crypto_hashblocks/sha256/ref/blocks.c deleted file mode 100644 index 95670754..00000000 --- a/src/libnacl/crypto_hashblocks/sha256/ref/blocks.c +++ /dev/null @@ -1,212 +0,0 @@ -#include "crypto_hashblocks.h" - -typedef unsigned int uint32; - -static uint32 load_bigendian(const unsigned char *x) -{ - return - (uint32) (x[3]) \ - | (((uint32) (x[2])) << 8) \ - | (((uint32) (x[1])) << 16) \ - | (((uint32) (x[0])) << 24) - ; -} - -static void store_bigendian(unsigned char *x,uint32 u) -{ - x[3] = u; u >>= 8; - x[2] = u; u >>= 8; - x[1] = u; u >>= 8; - x[0] = u; -} - -#define SHR(x,c) ((x) >> (c)) -#define ROTR(x,c) (((x) >> (c)) | ((x) << (32 - (c)))) - -#define Ch(x,y,z) ((x & y) ^ (~x & z)) -#define Maj(x,y,z) ((x & y) ^ (x & z) ^ (y & z)) -#define Sigma0(x) (ROTR(x, 2) ^ ROTR(x,13) ^ ROTR(x,22)) -#define Sigma1(x) (ROTR(x, 6) ^ ROTR(x,11) ^ ROTR(x,25)) -#define sigma0(x) (ROTR(x, 7) ^ ROTR(x,18) ^ SHR(x, 3)) -#define sigma1(x) (ROTR(x,17) ^ ROTR(x,19) ^ SHR(x,10)) - -#define M(w0,w14,w9,w1) w0 = sigma1(w14) + w9 + sigma0(w1) + w0; - -#define EXPAND \ - M(w0 ,w14,w9 ,w1 ) \ - M(w1 ,w15,w10,w2 ) \ - M(w2 ,w0 ,w11,w3 ) \ - M(w3 ,w1 ,w12,w4 ) \ - M(w4 ,w2 ,w13,w5 ) \ - M(w5 ,w3 ,w14,w6 ) \ - M(w6 ,w4 ,w15,w7 ) \ - M(w7 ,w5 ,w0 ,w8 ) \ - M(w8 ,w6 ,w1 ,w9 ) \ - M(w9 ,w7 ,w2 ,w10) \ - M(w10,w8 ,w3 ,w11) \ - M(w11,w9 ,w4 ,w12) \ - M(w12,w10,w5 ,w13) \ - M(w13,w11,w6 ,w14) \ - M(w14,w12,w7 ,w15) \ - M(w15,w13,w8 ,w0 ) - -#define F(w,k) \ - T1 = h + Sigma1(e) + Ch(e,f,g) + k + w; \ - T2 = Sigma0(a) + Maj(a,b,c); \ - h = g; \ - g = f; \ - f = e; \ - e = d + T1; \ - d = c; \ - c = b; \ - b = a; \ - a = T1 + T2; - -int crypto_hashblocks(unsigned char *statebytes,const unsigned char *in,unsigned long long inlen) -{ - uint32 state[8]; - uint32 a; - uint32 b; - uint32 c; - uint32 d; - uint32 e; - uint32 f; - uint32 g; - uint32 h; - uint32 T1; - uint32 T2; - - a = load_bigendian(statebytes + 0); state[0] = a; - b = load_bigendian(statebytes + 4); state[1] = b; - c = load_bigendian(statebytes + 8); state[2] = c; - d = load_bigendian(statebytes + 12); state[3] = d; - e = load_bigendian(statebytes + 16); state[4] = e; - f = load_bigendian(statebytes + 20); state[5] = f; - g = load_bigendian(statebytes + 24); state[6] = g; - h = load_bigendian(statebytes + 28); state[7] = h; - - while (inlen >= 64) { - uint32 w0 = load_bigendian(in + 0); - uint32 w1 = load_bigendian(in + 4); - uint32 w2 = load_bigendian(in + 8); - uint32 w3 = load_bigendian(in + 12); - uint32 w4 = load_bigendian(in + 16); - uint32 w5 = load_bigendian(in + 20); - uint32 w6 = load_bigendian(in + 24); - uint32 w7 = load_bigendian(in + 28); - uint32 w8 = load_bigendian(in + 32); - uint32 w9 = load_bigendian(in + 36); - uint32 w10 = load_bigendian(in + 40); - uint32 w11 = load_bigendian(in + 44); - uint32 w12 = load_bigendian(in + 48); - uint32 w13 = load_bigendian(in + 52); - uint32 w14 = load_bigendian(in + 56); - uint32 w15 = load_bigendian(in + 60); - - F(w0 ,0x428a2f98) - F(w1 ,0x71374491) - F(w2 ,0xb5c0fbcf) - F(w3 ,0xe9b5dba5) - F(w4 ,0x3956c25b) - F(w5 ,0x59f111f1) - F(w6 ,0x923f82a4) - F(w7 ,0xab1c5ed5) - F(w8 ,0xd807aa98) - F(w9 ,0x12835b01) - F(w10,0x243185be) - F(w11,0x550c7dc3) - F(w12,0x72be5d74) - F(w13,0x80deb1fe) - F(w14,0x9bdc06a7) - F(w15,0xc19bf174) - - EXPAND - - F(w0 ,0xe49b69c1) - F(w1 ,0xefbe4786) - F(w2 ,0x0fc19dc6) - F(w3 ,0x240ca1cc) - F(w4 ,0x2de92c6f) - F(w5 ,0x4a7484aa) - F(w6 ,0x5cb0a9dc) - F(w7 ,0x76f988da) - F(w8 ,0x983e5152) - F(w9 ,0xa831c66d) - F(w10,0xb00327c8) - F(w11,0xbf597fc7) - F(w12,0xc6e00bf3) - F(w13,0xd5a79147) - F(w14,0x06ca6351) - F(w15,0x14292967) - - EXPAND - - F(w0 ,0x27b70a85) - F(w1 ,0x2e1b2138) - F(w2 ,0x4d2c6dfc) - F(w3 ,0x53380d13) - F(w4 ,0x650a7354) - F(w5 ,0x766a0abb) - F(w6 ,0x81c2c92e) - F(w7 ,0x92722c85) - F(w8 ,0xa2bfe8a1) - F(w9 ,0xa81a664b) - F(w10,0xc24b8b70) - F(w11,0xc76c51a3) - F(w12,0xd192e819) - F(w13,0xd6990624) - F(w14,0xf40e3585) - F(w15,0x106aa070) - - EXPAND - - F(w0 ,0x19a4c116) - F(w1 ,0x1e376c08) - F(w2 ,0x2748774c) - F(w3 ,0x34b0bcb5) - F(w4 ,0x391c0cb3) - F(w5 ,0x4ed8aa4a) - F(w6 ,0x5b9cca4f) - F(w7 ,0x682e6ff3) - F(w8 ,0x748f82ee) - F(w9 ,0x78a5636f) - F(w10,0x84c87814) - F(w11,0x8cc70208) - F(w12,0x90befffa) - F(w13,0xa4506ceb) - F(w14,0xbef9a3f7) - F(w15,0xc67178f2) - - a += state[0]; - b += state[1]; - c += state[2]; - d += state[3]; - e += state[4]; - f += state[5]; - g += state[6]; - h += state[7]; - - state[0] = a; - state[1] = b; - state[2] = c; - state[3] = d; - state[4] = e; - state[5] = f; - state[6] = g; - state[7] = h; - - in += 64; - inlen -= 64; - } - - store_bigendian(statebytes + 0,state[0]); - store_bigendian(statebytes + 4,state[1]); - store_bigendian(statebytes + 8,state[2]); - store_bigendian(statebytes + 12,state[3]); - store_bigendian(statebytes + 16,state[4]); - store_bigendian(statebytes + 20,state[5]); - store_bigendian(statebytes + 24,state[6]); - store_bigendian(statebytes + 28,state[7]); - - return 0; -} diff --git a/src/libnacl/crypto_hashblocks/sha256/ref/implementors b/src/libnacl/crypto_hashblocks/sha256/ref/implementors deleted file mode 100644 index f6fb3c73..00000000 --- a/src/libnacl/crypto_hashblocks/sha256/ref/implementors +++ /dev/null @@ -1 +0,0 @@ -Daniel J. Bernstein diff --git a/src/libnacl/crypto_hashblocks/sha256/used b/src/libnacl/crypto_hashblocks/sha256/used deleted file mode 100644 index e69de29b..00000000 diff --git a/src/libnacl/crypto_hashblocks/sha512/checksum b/src/libnacl/crypto_hashblocks/sha512/checksum deleted file mode 100644 index ed5245ec..00000000 --- a/src/libnacl/crypto_hashblocks/sha512/checksum +++ /dev/null @@ -1 +0,0 @@ -f005c91634ae549f0dd4529ddbaf07038cb75a59b818cd1d4eb4e2b4019ab6733556131f320c4a145c735a22594581d454cccb15c18bf198ffcb2da29fe39456 diff --git a/src/libnacl/crypto_hashblocks/sha512/inplace/api.h b/src/libnacl/crypto_hashblocks/sha512/inplace/api.h deleted file mode 100644 index ac45d103..00000000 --- a/src/libnacl/crypto_hashblocks/sha512/inplace/api.h +++ /dev/null @@ -1,2 +0,0 @@ -#define CRYPTO_STATEBYTES 64 -#define CRYPTO_BLOCKBYTES 128 diff --git a/src/libnacl/crypto_hashblocks/sha512/inplace/blocks.c b/src/libnacl/crypto_hashblocks/sha512/inplace/blocks.c deleted file mode 100644 index edb9ab05..00000000 --- a/src/libnacl/crypto_hashblocks/sha512/inplace/blocks.c +++ /dev/null @@ -1,256 +0,0 @@ -#include "crypto_hashblocks.h" - -typedef unsigned long long uint64; - -static uint64 load_bigendian(const unsigned char *x) -{ - return - (uint64) (x[7]) \ - | (((uint64) (x[6])) << 8) \ - | (((uint64) (x[5])) << 16) \ - | (((uint64) (x[4])) << 24) \ - | (((uint64) (x[3])) << 32) \ - | (((uint64) (x[2])) << 40) \ - | (((uint64) (x[1])) << 48) \ - | (((uint64) (x[0])) << 56) - ; -} - -static void store_bigendian(unsigned char *x,uint64 u) -{ - x[7] = u; u >>= 8; - x[6] = u; u >>= 8; - x[5] = u; u >>= 8; - x[4] = u; u >>= 8; - x[3] = u; u >>= 8; - x[2] = u; u >>= 8; - x[1] = u; u >>= 8; - x[0] = u; -} - -#define SHR(x,c) ((x) >> (c)) -#define ROTR(x,c) (((x) >> (c)) | ((x) << (64 - (c)))) - -#define Ch(x,y,z) ((x & y) ^ (~x & z)) -#define Maj(x,y,z) ((x & y) ^ (x & z) ^ (y & z)) -#define Sigma0(x) (ROTR(x,28) ^ ROTR(x,34) ^ ROTR(x,39)) -#define Sigma1(x) (ROTR(x,14) ^ ROTR(x,18) ^ ROTR(x,41)) -#define sigma0(x) (ROTR(x, 1) ^ ROTR(x, 8) ^ SHR(x,7)) -#define sigma1(x) (ROTR(x,19) ^ ROTR(x,61) ^ SHR(x,6)) - -#define M(w0,w14,w9,w1) w0 = sigma1(w14) + w9 + sigma0(w1) + w0; - -#define EXPAND \ - M(w0 ,w14,w9 ,w1 ) \ - M(w1 ,w15,w10,w2 ) \ - M(w2 ,w0 ,w11,w3 ) \ - M(w3 ,w1 ,w12,w4 ) \ - M(w4 ,w2 ,w13,w5 ) \ - M(w5 ,w3 ,w14,w6 ) \ - M(w6 ,w4 ,w15,w7 ) \ - M(w7 ,w5 ,w0 ,w8 ) \ - M(w8 ,w6 ,w1 ,w9 ) \ - M(w9 ,w7 ,w2 ,w10) \ - M(w10,w8 ,w3 ,w11) \ - M(w11,w9 ,w4 ,w12) \ - M(w12,w10,w5 ,w13) \ - M(w13,w11,w6 ,w14) \ - M(w14,w12,w7 ,w15) \ - M(w15,w13,w8 ,w0 ) - -#define F(r0,r1,r2,r3,r4,r5,r6,r7,w,k) \ - r7 += Sigma1(r4) + Ch(r4,r5,r6) + k + w; \ - r3 += r7; \ - r7 += Sigma0(r0) + Maj(r0,r1,r2); - -#define G(r0,r1,r2,r3,r4,r5,r6,r7,i) \ - F(r0,r1,r2,r3,r4,r5,r6,r7,w0 ,round[i + 0]) \ - F(r7,r0,r1,r2,r3,r4,r5,r6,w1 ,round[i + 1]) \ - F(r6,r7,r0,r1,r2,r3,r4,r5,w2 ,round[i + 2]) \ - F(r5,r6,r7,r0,r1,r2,r3,r4,w3 ,round[i + 3]) \ - F(r4,r5,r6,r7,r0,r1,r2,r3,w4 ,round[i + 4]) \ - F(r3,r4,r5,r6,r7,r0,r1,r2,w5 ,round[i + 5]) \ - F(r2,r3,r4,r5,r6,r7,r0,r1,w6 ,round[i + 6]) \ - F(r1,r2,r3,r4,r5,r6,r7,r0,w7 ,round[i + 7]) \ - F(r0,r1,r2,r3,r4,r5,r6,r7,w8 ,round[i + 8]) \ - F(r7,r0,r1,r2,r3,r4,r5,r6,w9 ,round[i + 9]) \ - F(r6,r7,r0,r1,r2,r3,r4,r5,w10,round[i + 10]) \ - F(r5,r6,r7,r0,r1,r2,r3,r4,w11,round[i + 11]) \ - F(r4,r5,r6,r7,r0,r1,r2,r3,w12,round[i + 12]) \ - F(r3,r4,r5,r6,r7,r0,r1,r2,w13,round[i + 13]) \ - F(r2,r3,r4,r5,r6,r7,r0,r1,w14,round[i + 14]) \ - F(r1,r2,r3,r4,r5,r6,r7,r0,w15,round[i + 15]) - -static const uint64 round[80] = { - 0x428a2f98d728ae22ULL -, 0x7137449123ef65cdULL -, 0xb5c0fbcfec4d3b2fULL -, 0xe9b5dba58189dbbcULL -, 0x3956c25bf348b538ULL -, 0x59f111f1b605d019ULL -, 0x923f82a4af194f9bULL -, 0xab1c5ed5da6d8118ULL -, 0xd807aa98a3030242ULL -, 0x12835b0145706fbeULL -, 0x243185be4ee4b28cULL -, 0x550c7dc3d5ffb4e2ULL -, 0x72be5d74f27b896fULL -, 0x80deb1fe3b1696b1ULL -, 0x9bdc06a725c71235ULL -, 0xc19bf174cf692694ULL -, 0xe49b69c19ef14ad2ULL -, 0xefbe4786384f25e3ULL -, 0x0fc19dc68b8cd5b5ULL -, 0x240ca1cc77ac9c65ULL -, 0x2de92c6f592b0275ULL -, 0x4a7484aa6ea6e483ULL -, 0x5cb0a9dcbd41fbd4ULL -, 0x76f988da831153b5ULL -, 0x983e5152ee66dfabULL -, 0xa831c66d2db43210ULL -, 0xb00327c898fb213fULL -, 0xbf597fc7beef0ee4ULL -, 0xc6e00bf33da88fc2ULL -, 0xd5a79147930aa725ULL -, 0x06ca6351e003826fULL -, 0x142929670a0e6e70ULL -, 0x27b70a8546d22ffcULL -, 0x2e1b21385c26c926ULL -, 0x4d2c6dfc5ac42aedULL -, 0x53380d139d95b3dfULL -, 0x650a73548baf63deULL -, 0x766a0abb3c77b2a8ULL -, 0x81c2c92e47edaee6ULL -, 0x92722c851482353bULL -, 0xa2bfe8a14cf10364ULL -, 0xa81a664bbc423001ULL -, 0xc24b8b70d0f89791ULL -, 0xc76c51a30654be30ULL -, 0xd192e819d6ef5218ULL -, 0xd69906245565a910ULL -, 0xf40e35855771202aULL -, 0x106aa07032bbd1b8ULL -, 0x19a4c116b8d2d0c8ULL -, 0x1e376c085141ab53ULL -, 0x2748774cdf8eeb99ULL -, 0x34b0bcb5e19b48a8ULL -, 0x391c0cb3c5c95a63ULL -, 0x4ed8aa4ae3418acbULL -, 0x5b9cca4f7763e373ULL -, 0x682e6ff3d6b2b8a3ULL -, 0x748f82ee5defb2fcULL -, 0x78a5636f43172f60ULL -, 0x84c87814a1f0ab72ULL -, 0x8cc702081a6439ecULL -, 0x90befffa23631e28ULL -, 0xa4506cebde82bde9ULL -, 0xbef9a3f7b2c67915ULL -, 0xc67178f2e372532bULL -, 0xca273eceea26619cULL -, 0xd186b8c721c0c207ULL -, 0xeada7dd6cde0eb1eULL -, 0xf57d4f7fee6ed178ULL -, 0x06f067aa72176fbaULL -, 0x0a637dc5a2c898a6ULL -, 0x113f9804bef90daeULL -, 0x1b710b35131c471bULL -, 0x28db77f523047d84ULL -, 0x32caab7b40c72493ULL -, 0x3c9ebe0a15c9bebcULL -, 0x431d67c49c100d4cULL -, 0x4cc5d4becb3e42b6ULL -, 0x597f299cfc657e2aULL -, 0x5fcb6fab3ad6faecULL -, 0x6c44198c4a475817ULL -}; - -int crypto_hashblocks(unsigned char *statebytes,const unsigned char *in,unsigned long long inlen) -{ - uint64 state[8]; - uint64 r0; - uint64 r1; - uint64 r2; - uint64 r3; - uint64 r4; - uint64 r5; - uint64 r6; - uint64 r7; - - r0 = load_bigendian(statebytes + 0); state[0] = r0; - r1 = load_bigendian(statebytes + 8); state[1] = r1; - r2 = load_bigendian(statebytes + 16); state[2] = r2; - r3 = load_bigendian(statebytes + 24); state[3] = r3; - r4 = load_bigendian(statebytes + 32); state[4] = r4; - r5 = load_bigendian(statebytes + 40); state[5] = r5; - r6 = load_bigendian(statebytes + 48); state[6] = r6; - r7 = load_bigendian(statebytes + 56); state[7] = r7; - - while (inlen >= 128) { - uint64 w0 = load_bigendian(in + 0); - uint64 w1 = load_bigendian(in + 8); - uint64 w2 = load_bigendian(in + 16); - uint64 w3 = load_bigendian(in + 24); - uint64 w4 = load_bigendian(in + 32); - uint64 w5 = load_bigendian(in + 40); - uint64 w6 = load_bigendian(in + 48); - uint64 w7 = load_bigendian(in + 56); - uint64 w8 = load_bigendian(in + 64); - uint64 w9 = load_bigendian(in + 72); - uint64 w10 = load_bigendian(in + 80); - uint64 w11 = load_bigendian(in + 88); - uint64 w12 = load_bigendian(in + 96); - uint64 w13 = load_bigendian(in + 104); - uint64 w14 = load_bigendian(in + 112); - uint64 w15 = load_bigendian(in + 120); - - G(r0,r1,r2,r3,r4,r5,r6,r7,0) - - EXPAND - - G(r0,r1,r2,r3,r4,r5,r6,r7,16) - - EXPAND - - G(r0,r1,r2,r3,r4,r5,r6,r7,32) - - EXPAND - - G(r0,r1,r2,r3,r4,r5,r6,r7,48) - - EXPAND - - G(r0,r1,r2,r3,r4,r5,r6,r7,64) - - r0 += state[0]; - r1 += state[1]; - r2 += state[2]; - r3 += state[3]; - r4 += state[4]; - r5 += state[5]; - r6 += state[6]; - r7 += state[7]; - - state[0] = r0; - state[1] = r1; - state[2] = r2; - state[3] = r3; - state[4] = r4; - state[5] = r5; - state[6] = r6; - state[7] = r7; - - in += 128; - inlen -= 128; - } - - store_bigendian(statebytes + 0,state[0]); - store_bigendian(statebytes + 8,state[1]); - store_bigendian(statebytes + 16,state[2]); - store_bigendian(statebytes + 24,state[3]); - store_bigendian(statebytes + 32,state[4]); - store_bigendian(statebytes + 40,state[5]); - store_bigendian(statebytes + 48,state[6]); - store_bigendian(statebytes + 56,state[7]); - - return 0; -} diff --git a/src/libnacl/crypto_hashblocks/sha512/inplace/implementors b/src/libnacl/crypto_hashblocks/sha512/inplace/implementors deleted file mode 100644 index f6fb3c73..00000000 --- a/src/libnacl/crypto_hashblocks/sha512/inplace/implementors +++ /dev/null @@ -1 +0,0 @@ -Daniel J. Bernstein diff --git a/src/libnacl/crypto_hashblocks/sha512/ref/api.h b/src/libnacl/crypto_hashblocks/sha512/ref/api.h deleted file mode 100644 index ac45d103..00000000 --- a/src/libnacl/crypto_hashblocks/sha512/ref/api.h +++ /dev/null @@ -1,2 +0,0 @@ -#define CRYPTO_STATEBYTES 64 -#define CRYPTO_BLOCKBYTES 128 diff --git a/src/libnacl/crypto_hashblocks/sha512/ref/blocks.c b/src/libnacl/crypto_hashblocks/sha512/ref/blocks.c deleted file mode 100644 index a340afe5..00000000 --- a/src/libnacl/crypto_hashblocks/sha512/ref/blocks.c +++ /dev/null @@ -1,239 +0,0 @@ -#include "crypto_hashblocks.h" - -typedef unsigned long long uint64; - -static uint64 load_bigendian(const unsigned char *x) -{ - return - (uint64) (x[7]) \ - | (((uint64) (x[6])) << 8) \ - | (((uint64) (x[5])) << 16) \ - | (((uint64) (x[4])) << 24) \ - | (((uint64) (x[3])) << 32) \ - | (((uint64) (x[2])) << 40) \ - | (((uint64) (x[1])) << 48) \ - | (((uint64) (x[0])) << 56) - ; -} - -static void store_bigendian(unsigned char *x,uint64 u) -{ - x[7] = u; u >>= 8; - x[6] = u; u >>= 8; - x[5] = u; u >>= 8; - x[4] = u; u >>= 8; - x[3] = u; u >>= 8; - x[2] = u; u >>= 8; - x[1] = u; u >>= 8; - x[0] = u; -} - -#define SHR(x,c) ((x) >> (c)) -#define ROTR(x,c) (((x) >> (c)) | ((x) << (64 - (c)))) - -#define Ch(x,y,z) ((x & y) ^ (~x & z)) -#define Maj(x,y,z) ((x & y) ^ (x & z) ^ (y & z)) -#define Sigma0(x) (ROTR(x,28) ^ ROTR(x,34) ^ ROTR(x,39)) -#define Sigma1(x) (ROTR(x,14) ^ ROTR(x,18) ^ ROTR(x,41)) -#define sigma0(x) (ROTR(x, 1) ^ ROTR(x, 8) ^ SHR(x,7)) -#define sigma1(x) (ROTR(x,19) ^ ROTR(x,61) ^ SHR(x,6)) - -#define M(w0,w14,w9,w1) w0 = sigma1(w14) + w9 + sigma0(w1) + w0; - -#define EXPAND \ - M(w0 ,w14,w9 ,w1 ) \ - M(w1 ,w15,w10,w2 ) \ - M(w2 ,w0 ,w11,w3 ) \ - M(w3 ,w1 ,w12,w4 ) \ - M(w4 ,w2 ,w13,w5 ) \ - M(w5 ,w3 ,w14,w6 ) \ - M(w6 ,w4 ,w15,w7 ) \ - M(w7 ,w5 ,w0 ,w8 ) \ - M(w8 ,w6 ,w1 ,w9 ) \ - M(w9 ,w7 ,w2 ,w10) \ - M(w10,w8 ,w3 ,w11) \ - M(w11,w9 ,w4 ,w12) \ - M(w12,w10,w5 ,w13) \ - M(w13,w11,w6 ,w14) \ - M(w14,w12,w7 ,w15) \ - M(w15,w13,w8 ,w0 ) - -#define F(w,k) \ - T1 = h + Sigma1(e) + Ch(e,f,g) + k + w; \ - T2 = Sigma0(a) + Maj(a,b,c); \ - h = g; \ - g = f; \ - f = e; \ - e = d + T1; \ - d = c; \ - c = b; \ - b = a; \ - a = T1 + T2; - -int crypto_hashblocks(unsigned char *statebytes,const unsigned char *in,unsigned long long inlen) -{ - uint64 state[8]; - uint64 a; - uint64 b; - uint64 c; - uint64 d; - uint64 e; - uint64 f; - uint64 g; - uint64 h; - uint64 T1; - uint64 T2; - - a = load_bigendian(statebytes + 0); state[0] = a; - b = load_bigendian(statebytes + 8); state[1] = b; - c = load_bigendian(statebytes + 16); state[2] = c; - d = load_bigendian(statebytes + 24); state[3] = d; - e = load_bigendian(statebytes + 32); state[4] = e; - f = load_bigendian(statebytes + 40); state[5] = f; - g = load_bigendian(statebytes + 48); state[6] = g; - h = load_bigendian(statebytes + 56); state[7] = h; - - while (inlen >= 128) { - uint64 w0 = load_bigendian(in + 0); - uint64 w1 = load_bigendian(in + 8); - uint64 w2 = load_bigendian(in + 16); - uint64 w3 = load_bigendian(in + 24); - uint64 w4 = load_bigendian(in + 32); - uint64 w5 = load_bigendian(in + 40); - uint64 w6 = load_bigendian(in + 48); - uint64 w7 = load_bigendian(in + 56); - uint64 w8 = load_bigendian(in + 64); - uint64 w9 = load_bigendian(in + 72); - uint64 w10 = load_bigendian(in + 80); - uint64 w11 = load_bigendian(in + 88); - uint64 w12 = load_bigendian(in + 96); - uint64 w13 = load_bigendian(in + 104); - uint64 w14 = load_bigendian(in + 112); - uint64 w15 = load_bigendian(in + 120); - - F(w0 ,0x428a2f98d728ae22ULL) - F(w1 ,0x7137449123ef65cdULL) - F(w2 ,0xb5c0fbcfec4d3b2fULL) - F(w3 ,0xe9b5dba58189dbbcULL) - F(w4 ,0x3956c25bf348b538ULL) - F(w5 ,0x59f111f1b605d019ULL) - F(w6 ,0x923f82a4af194f9bULL) - F(w7 ,0xab1c5ed5da6d8118ULL) - F(w8 ,0xd807aa98a3030242ULL) - F(w9 ,0x12835b0145706fbeULL) - F(w10,0x243185be4ee4b28cULL) - F(w11,0x550c7dc3d5ffb4e2ULL) - F(w12,0x72be5d74f27b896fULL) - F(w13,0x80deb1fe3b1696b1ULL) - F(w14,0x9bdc06a725c71235ULL) - F(w15,0xc19bf174cf692694ULL) - - EXPAND - - F(w0 ,0xe49b69c19ef14ad2ULL) - F(w1 ,0xefbe4786384f25e3ULL) - F(w2 ,0x0fc19dc68b8cd5b5ULL) - F(w3 ,0x240ca1cc77ac9c65ULL) - F(w4 ,0x2de92c6f592b0275ULL) - F(w5 ,0x4a7484aa6ea6e483ULL) - F(w6 ,0x5cb0a9dcbd41fbd4ULL) - F(w7 ,0x76f988da831153b5ULL) - F(w8 ,0x983e5152ee66dfabULL) - F(w9 ,0xa831c66d2db43210ULL) - F(w10,0xb00327c898fb213fULL) - F(w11,0xbf597fc7beef0ee4ULL) - F(w12,0xc6e00bf33da88fc2ULL) - F(w13,0xd5a79147930aa725ULL) - F(w14,0x06ca6351e003826fULL) - F(w15,0x142929670a0e6e70ULL) - - EXPAND - - F(w0 ,0x27b70a8546d22ffcULL) - F(w1 ,0x2e1b21385c26c926ULL) - F(w2 ,0x4d2c6dfc5ac42aedULL) - F(w3 ,0x53380d139d95b3dfULL) - F(w4 ,0x650a73548baf63deULL) - F(w5 ,0x766a0abb3c77b2a8ULL) - F(w6 ,0x81c2c92e47edaee6ULL) - F(w7 ,0x92722c851482353bULL) - F(w8 ,0xa2bfe8a14cf10364ULL) - F(w9 ,0xa81a664bbc423001ULL) - F(w10,0xc24b8b70d0f89791ULL) - F(w11,0xc76c51a30654be30ULL) - F(w12,0xd192e819d6ef5218ULL) - F(w13,0xd69906245565a910ULL) - F(w14,0xf40e35855771202aULL) - F(w15,0x106aa07032bbd1b8ULL) - - EXPAND - - F(w0 ,0x19a4c116b8d2d0c8ULL) - F(w1 ,0x1e376c085141ab53ULL) - F(w2 ,0x2748774cdf8eeb99ULL) - F(w3 ,0x34b0bcb5e19b48a8ULL) - F(w4 ,0x391c0cb3c5c95a63ULL) - F(w5 ,0x4ed8aa4ae3418acbULL) - F(w6 ,0x5b9cca4f7763e373ULL) - F(w7 ,0x682e6ff3d6b2b8a3ULL) - F(w8 ,0x748f82ee5defb2fcULL) - F(w9 ,0x78a5636f43172f60ULL) - F(w10,0x84c87814a1f0ab72ULL) - F(w11,0x8cc702081a6439ecULL) - F(w12,0x90befffa23631e28ULL) - F(w13,0xa4506cebde82bde9ULL) - F(w14,0xbef9a3f7b2c67915ULL) - F(w15,0xc67178f2e372532bULL) - - EXPAND - - F(w0 ,0xca273eceea26619cULL) - F(w1 ,0xd186b8c721c0c207ULL) - F(w2 ,0xeada7dd6cde0eb1eULL) - F(w3 ,0xf57d4f7fee6ed178ULL) - F(w4 ,0x06f067aa72176fbaULL) - F(w5 ,0x0a637dc5a2c898a6ULL) - F(w6 ,0x113f9804bef90daeULL) - F(w7 ,0x1b710b35131c471bULL) - F(w8 ,0x28db77f523047d84ULL) - F(w9 ,0x32caab7b40c72493ULL) - F(w10,0x3c9ebe0a15c9bebcULL) - F(w11,0x431d67c49c100d4cULL) - F(w12,0x4cc5d4becb3e42b6ULL) - F(w13,0x597f299cfc657e2aULL) - F(w14,0x5fcb6fab3ad6faecULL) - F(w15,0x6c44198c4a475817ULL) - - a += state[0]; - b += state[1]; - c += state[2]; - d += state[3]; - e += state[4]; - f += state[5]; - g += state[6]; - h += state[7]; - - state[0] = a; - state[1] = b; - state[2] = c; - state[3] = d; - state[4] = e; - state[5] = f; - state[6] = g; - state[7] = h; - - in += 128; - inlen -= 128; - } - - store_bigendian(statebytes + 0,state[0]); - store_bigendian(statebytes + 8,state[1]); - store_bigendian(statebytes + 16,state[2]); - store_bigendian(statebytes + 24,state[3]); - store_bigendian(statebytes + 32,state[4]); - store_bigendian(statebytes + 40,state[5]); - store_bigendian(statebytes + 48,state[6]); - store_bigendian(statebytes + 56,state[7]); - - return 0; -} diff --git a/src/libnacl/crypto_hashblocks/sha512/ref/implementors b/src/libnacl/crypto_hashblocks/sha512/ref/implementors deleted file mode 100644 index f6fb3c73..00000000 --- a/src/libnacl/crypto_hashblocks/sha512/ref/implementors +++ /dev/null @@ -1 +0,0 @@ -Daniel J. Bernstein diff --git a/src/libnacl/crypto_hashblocks/sha512/selected b/src/libnacl/crypto_hashblocks/sha512/selected deleted file mode 100644 index e69de29b..00000000 diff --git a/src/libnacl/crypto_hashblocks/sha512/used b/src/libnacl/crypto_hashblocks/sha512/used deleted file mode 100644 index e69de29b..00000000 diff --git a/src/libnacl/crypto_hashblocks/try.c b/src/libnacl/crypto_hashblocks/try.c deleted file mode 100644 index 50744451..00000000 --- a/src/libnacl/crypto_hashblocks/try.c +++ /dev/null @@ -1,80 +0,0 @@ -/* - * crypto_hashblocks/try.c version 20090118 - * D. J. Bernstein - * Public domain. - */ - -#include -#include "crypto_hashblocks.h" -#include "windows/windows-quirks.h" - -extern unsigned char *alignedcalloc(unsigned long long); - -const char *primitiveimplementation = crypto_hashblocks_IMPLEMENTATION; - -#define MAXTEST_BYTES (10000 + crypto_hashblocks_STATEBYTES) -#define CHECKSUM_BYTES 4096 -#define TUNE_BYTES 1536 - -static unsigned char *h; -static unsigned char *h2; -static unsigned char *m; -static unsigned char *m2; - -void preallocate(void) -{ -} - -void allocate(void) -{ - h = alignedcalloc(crypto_hashblocks_STATEBYTES); - h2 = alignedcalloc(crypto_hashblocks_STATEBYTES); - m = alignedcalloc(MAXTEST_BYTES); - m2 = alignedcalloc(MAXTEST_BYTES); -} - -void predoit(void) -{ -} - -void doit(void) -{ - crypto_hashblocks(h,m,TUNE_BYTES); -} - -char checksum[crypto_hashblocks_STATEBYTES * 2 + 1]; - -const char *checksum_compute(void) -{ - long long i; - long long j; - - for (i = 0;i < CHECKSUM_BYTES;++i) { - long long hlen = crypto_hashblocks_STATEBYTES; - long long mlen = i; - for (j = -16;j < 0;++j) h[j] = random(); - for (j = hlen;j < hlen + 16;++j) h[j] = random(); - for (j = -16;j < hlen + 16;++j) h2[j] = h[j]; - for (j = -16;j < 0;++j) m[j] = random(); - for (j = mlen;j < mlen + 16;++j) m[j] = random(); - for (j = -16;j < mlen + 16;++j) m2[j] = m[j]; - if (crypto_hashblocks(h,m,mlen) != 0) return "crypto_hashblocks returns nonzero"; - for (j = -16;j < mlen + 16;++j) if (m2[j] != m[j]) return "crypto_hashblocks writes to input"; - for (j = -16;j < 0;++j) if (h2[j] != h[j]) return "crypto_hashblocks writes before output"; - for (j = hlen;j < hlen + 16;++j) if (h2[j] != h[j]) return "crypto_hashblocks writes after output"; - for (j = 0;j < hlen;++j) m2[j] = h2[j]; - if (crypto_hashblocks(h2,m2,mlen) != 0) return "crypto_hashblocks returns nonzero"; - if (crypto_hashblocks(m2,m2,mlen) != 0) return "crypto_hashblocks returns nonzero"; - for (j = 0;j < hlen;++j) if (m2[j] != h2[j]) return "crypto_hashblocks does not handle overlap"; - for (j = 0;j < mlen;++j) m[j] ^= h[j % hlen]; - m[mlen] = h[0]; - } - if (crypto_hashblocks(h,m,CHECKSUM_BYTES) != 0) return "crypto_hashblocks returns nonzero"; - - for (i = 0;i < crypto_hashblocks_STATEBYTES;++i) { - checksum[2 * i] = "0123456789abcdef"[15 & (h[i] >> 4)]; - checksum[2 * i + 1] = "0123456789abcdef"[15 & h[i]]; - } - checksum[2 * i] = 0; - return 0; -} diff --git a/src/libnacl/crypto_onetimeauth/measure.c b/src/libnacl/crypto_onetimeauth/measure.c deleted file mode 100644 index 6d3ddfd5..00000000 --- a/src/libnacl/crypto_onetimeauth/measure.c +++ /dev/null @@ -1,69 +0,0 @@ -#include "crypto_onetimeauth.h" -#include "randombytes.h" -#include "cpucycles.h" - -extern void printentry(long long,const char *,long long *,long long); -extern unsigned char *alignedcalloc(unsigned long long); -extern const char *primitiveimplementation; -extern const char *implementationversion; -extern const char *sizenames[]; -extern const long long sizes[]; -extern void allocate(void); -extern void measure(void); - -const char *primitiveimplementation = crypto_onetimeauth_IMPLEMENTATION; -const char *implementationversion = crypto_onetimeauth_VERSION; -const char *sizenames[] = { "outputbytes", "keybytes", 0 }; -const long long sizes[] = { crypto_onetimeauth_BYTES, crypto_onetimeauth_KEYBYTES }; - -#define MAXTEST_BYTES 4096 -#ifdef SUPERCOP -#define MGAP 8192 -#else -#define MGAP 8 -#endif - -static unsigned char *k; -static unsigned char *m; -static unsigned char *h; - -void preallocate(void) -{ -} - -void allocate(void) -{ - k = alignedcalloc(crypto_onetimeauth_KEYBYTES); - m = alignedcalloc(MAXTEST_BYTES); - h = alignedcalloc(crypto_onetimeauth_BYTES); -} - -#define TIMINGS 15 -static long long cycles[TIMINGS + 1]; - -void measure(void) -{ - int i; - int loop; - int mlen; - - for (loop = 0;loop < LOOPS;++loop) { - for (mlen = 0;mlen <= MAXTEST_BYTES;mlen += 1 + mlen / MGAP) { - randombytes(k,crypto_onetimeauth_KEYBYTES); - randombytes(m,mlen); - randombytes(h,crypto_onetimeauth_BYTES); - for (i = 0;i <= TIMINGS;++i) { - cycles[i] = cpucycles(); - crypto_onetimeauth(h,m,mlen,k); - } - for (i = 0;i < TIMINGS;++i) cycles[i] = cycles[i + 1] - cycles[i]; - printentry(mlen,"cycles",cycles,TIMINGS); - for (i = 0;i <= TIMINGS;++i) { - cycles[i] = cpucycles(); - crypto_onetimeauth_verify(h,m,mlen,k); - } - for (i = 0;i < TIMINGS;++i) cycles[i] = cycles[i + 1] - cycles[i]; - printentry(mlen,"verify_cycles",cycles,TIMINGS); - } - } -} diff --git a/src/libnacl/crypto_onetimeauth/poly1305/53/api.h b/src/libnacl/crypto_onetimeauth/poly1305/53/api.h deleted file mode 100644 index acc133ed..00000000 --- a/src/libnacl/crypto_onetimeauth/poly1305/53/api.h +++ /dev/null @@ -1,2 +0,0 @@ -#define CRYPTO_BYTES 16 -#define CRYPTO_KEYBYTES 32 diff --git a/src/libnacl/crypto_onetimeauth/poly1305/53/auth.c b/src/libnacl/crypto_onetimeauth/poly1305/53/auth.c deleted file mode 100644 index a4a9c3f6..00000000 --- a/src/libnacl/crypto_onetimeauth/poly1305/53/auth.c +++ /dev/null @@ -1,1616 +0,0 @@ -/* -20080910 -D. J. Bernstein -Public domain. -*/ - -#include "crypto_onetimeauth.h" - -typedef unsigned char uchar; -typedef int int32; -typedef unsigned int uint32; -typedef long long int64; -typedef unsigned long long uint64; - -static const double poly1305_53_constants[] = { - 0.00000000558793544769287109375 /* alpham80 = 3 2^(-29) */ -, 24.0 /* alpham48 = 3 2^3 */ -, 103079215104.0 /* alpham16 = 3 2^35 */ -, 6755399441055744.0 /* alpha0 = 3 2^51 */ -, 1770887431076116955136.0 /* alpha18 = 3 2^69 */ -, 29014219670751100192948224.0 /* alpha32 = 3 2^83 */ -, 7605903601369376408980219232256.0 /* alpha50 = 3 2^101 */ -, 124615124604835863084731911901282304.0 /* alpha64 = 3 2^115 */ -, 32667107224410092492483962313449748299776.0 /* alpha82 = 3 2^133 */ -, 535217884764734955396857238543560676143529984.0 /* alpha96 = 3 2^147 */ -, 35076039295941670036888435985190792471742381031424.0 /* alpha112 = 3 2^163 */ -, 9194973245195333150150082162901855101712434733101613056.0 /* alpha130 = 3 2^181 */ -, 0.0000000000000000000000000000000000000036734198463196484624023016788195177431833298649127735047148490821200539357960224151611328125 /* scale = 5 2^(-130) */ -, 6755408030990331.0 /* offset0 = alpha0 + 2^33 - 5 */ -, 29014256564239239022116864.0 /* offset1 = alpha32 + 2^65 - 2^33 */ -, 124615283061160854719918951570079744.0 /* offset2 = alpha64 + 2^97 - 2^65 */ -, 535219245894202480694386063513315216128475136.0 /* offset3 = alpha96 + 2^130 - 2^97 */ -} ; - -int crypto_onetimeauth(unsigned char *out,const unsigned char *m,unsigned long long l,const unsigned char *k) -{ - register const unsigned char *r = k; - register const unsigned char *s = k + 16; - double r0high_stack; - double r1high_stack; - double r1low_stack; - double sr1high_stack; - double r2low_stack; - double sr2high_stack; - double r0low_stack; - double sr1low_stack; - double r2high_stack; - double sr2low_stack; - double r3high_stack; - double sr3high_stack; - double r3low_stack; - double sr3low_stack; - int64 d0; - int64 d1; - int64 d2; - int64 d3; - register double scale; - register double alpha0; - register double alpha32; - register double alpha64; - register double alpha96; - register double alpha130; - register double h0; - register double h1; - register double h2; - register double h3; - register double h4; - register double h5; - register double h6; - register double h7; - register double y7; - register double y6; - register double y1; - register double y0; - register double y5; - register double y4; - register double x7; - register double x6; - register double x1; - register double x0; - register double y3; - register double y2; - register double r3low; - register double r0low; - register double r3high; - register double r0high; - register double sr1low; - register double x5; - register double r3lowx0; - register double sr1high; - register double x4; - register double r0lowx6; - register double r1low; - register double x3; - register double r3highx0; - register double r1high; - register double x2; - register double r0highx6; - register double sr2low; - register double r0lowx0; - register double sr2high; - register double sr1lowx6; - register double r2low; - register double r0highx0; - register double r2high; - register double sr1highx6; - register double sr3low; - register double r1lowx0; - register double sr3high; - register double sr2lowx6; - register double r1highx0; - register double sr2highx6; - register double r2lowx0; - register double sr3lowx6; - register double r2highx0; - register double sr3highx6; - register double r1highx4; - register double r1lowx4; - register double r0highx4; - register double r0lowx4; - register double sr3highx4; - register double sr3lowx4; - register double sr2highx4; - register double sr2lowx4; - register double r0lowx2; - register double r0highx2; - register double r1lowx2; - register double r1highx2; - register double r2lowx2; - register double r2highx2; - register double sr3lowx2; - register double sr3highx2; - register double z0; - register double z1; - register double z2; - register double z3; - register int64 r0; - register int64 r1; - register int64 r2; - register int64 r3; - register uint32 r00; - register uint32 r01; - register uint32 r02; - register uint32 r03; - register uint32 r10; - register uint32 r11; - register uint32 r12; - register uint32 r13; - register uint32 r20; - register uint32 r21; - register uint32 r22; - register uint32 r23; - register uint32 r30; - register uint32 r31; - register uint32 r32; - register uint32 r33; - register int64 m0; - register int64 m1; - register int64 m2; - register int64 m3; - register uint32 m00; - register uint32 m01; - register uint32 m02; - register uint32 m03; - register uint32 m10; - register uint32 m11; - register uint32 m12; - register uint32 m13; - register uint32 m20; - register uint32 m21; - register uint32 m22; - register uint32 m23; - register uint32 m30; - register uint32 m31; - register uint32 m32; - register uint64 m33; - register char *constants; - register int32 lbelow2; - register int32 lbelow3; - register int32 lbelow4; - register int32 lbelow5; - register int32 lbelow6; - register int32 lbelow7; - register int32 lbelow8; - register int32 lbelow9; - register int32 lbelow10; - register int32 lbelow11; - register int32 lbelow12; - register int32 lbelow13; - register int32 lbelow14; - register int32 lbelow15; - register double alpham80; - register double alpham48; - register double alpham16; - register double alpha18; - register double alpha50; - register double alpha82; - register double alpha112; - register double offset0; - register double offset1; - register double offset2; - register double offset3; - register uint32 s00; - register uint32 s01; - register uint32 s02; - register uint32 s03; - register uint32 s10; - register uint32 s11; - register uint32 s12; - register uint32 s13; - register uint32 s20; - register uint32 s21; - register uint32 s22; - register uint32 s23; - register uint32 s30; - register uint32 s31; - register uint32 s32; - register uint32 s33; - register uint64 bits32; - register uint64 f; - register uint64 f0; - register uint64 f1; - register uint64 f2; - register uint64 f3; - register uint64 f4; - register uint64 g; - register uint64 g0; - register uint64 g1; - register uint64 g2; - register uint64 g3; - register uint64 g4; - - r00 = *(uchar *) (r + 0); - constants = (char *) &poly1305_53_constants; - - r01 = *(uchar *) (r + 1); - - r02 = *(uchar *) (r + 2); - r0 = 2151; - - r03 = *(uchar *) (r + 3); r03 &= 15; - r0 <<= 51; - - r10 = *(uchar *) (r + 4); r10 &= 252; - r01 <<= 8; - r0 += r00; - - r11 = *(uchar *) (r + 5); - r02 <<= 16; - r0 += r01; - - r12 = *(uchar *) (r + 6); - r03 <<= 24; - r0 += r02; - - r13 = *(uchar *) (r + 7); r13 &= 15; - r1 = 2215; - r0 += r03; - - d0 = r0; - r1 <<= 51; - r2 = 2279; - - r20 = *(uchar *) (r + 8); r20 &= 252; - r11 <<= 8; - r1 += r10; - - r21 = *(uchar *) (r + 9); - r12 <<= 16; - r1 += r11; - - r22 = *(uchar *) (r + 10); - r13 <<= 24; - r1 += r12; - - r23 = *(uchar *) (r + 11); r23 &= 15; - r2 <<= 51; - r1 += r13; - - d1 = r1; - r21 <<= 8; - r2 += r20; - - r30 = *(uchar *) (r + 12); r30 &= 252; - r22 <<= 16; - r2 += r21; - - r31 = *(uchar *) (r + 13); - r23 <<= 24; - r2 += r22; - - r32 = *(uchar *) (r + 14); - r2 += r23; - r3 = 2343; - - d2 = r2; - r3 <<= 51; - alpha32 = *(double *) (constants + 40); - - r33 = *(uchar *) (r + 15); r33 &= 15; - r31 <<= 8; - r3 += r30; - - r32 <<= 16; - r3 += r31; - - r33 <<= 24; - r3 += r32; - - r3 += r33; - h0 = alpha32 - alpha32; - - d3 = r3; - h1 = alpha32 - alpha32; - - alpha0 = *(double *) (constants + 24); - h2 = alpha32 - alpha32; - - alpha64 = *(double *) (constants + 56); - h3 = alpha32 - alpha32; - - alpha18 = *(double *) (constants + 32); - h4 = alpha32 - alpha32; - - r0low = *(double *) &d0; - h5 = alpha32 - alpha32; - - r1low = *(double *) &d1; - h6 = alpha32 - alpha32; - - r2low = *(double *) &d2; - h7 = alpha32 - alpha32; - - alpha50 = *(double *) (constants + 48); - r0low -= alpha0; - - alpha82 = *(double *) (constants + 64); - r1low -= alpha32; - - scale = *(double *) (constants + 96); - r2low -= alpha64; - - alpha96 = *(double *) (constants + 72); - r0high = r0low + alpha18; - - r3low = *(double *) &d3; - - alpham80 = *(double *) (constants + 0); - r1high = r1low + alpha50; - sr1low = scale * r1low; - - alpham48 = *(double *) (constants + 8); - r2high = r2low + alpha82; - sr2low = scale * r2low; - - r0high -= alpha18; - r0high_stack = r0high; - - r3low -= alpha96; - - r1high -= alpha50; - r1high_stack = r1high; - - sr1high = sr1low + alpham80; - - alpha112 = *(double *) (constants + 80); - r0low -= r0high; - - alpham16 = *(double *) (constants + 16); - r2high -= alpha82; - sr3low = scale * r3low; - - alpha130 = *(double *) (constants + 88); - sr2high = sr2low + alpham48; - - r1low -= r1high; - r1low_stack = r1low; - - sr1high -= alpham80; - sr1high_stack = sr1high; - - r2low -= r2high; - r2low_stack = r2low; - - sr2high -= alpham48; - sr2high_stack = sr2high; - - r3high = r3low + alpha112; - r0low_stack = r0low; - - sr1low -= sr1high; - sr1low_stack = sr1low; - - sr3high = sr3low + alpham16; - r2high_stack = r2high; - - sr2low -= sr2high; - sr2low_stack = sr2low; - - r3high -= alpha112; - r3high_stack = r3high; - - - sr3high -= alpham16; - sr3high_stack = sr3high; - - - r3low -= r3high; - r3low_stack = r3low; - - - sr3low -= sr3high; - sr3low_stack = sr3low; - -if (l < 16) goto addatmost15bytes; - - m00 = *(uchar *) (m + 0); - m0 = 2151; - - m0 <<= 51; - m1 = 2215; - m01 = *(uchar *) (m + 1); - - m1 <<= 51; - m2 = 2279; - m02 = *(uchar *) (m + 2); - - m2 <<= 51; - m3 = 2343; - m03 = *(uchar *) (m + 3); - - m10 = *(uchar *) (m + 4); - m01 <<= 8; - m0 += m00; - - m11 = *(uchar *) (m + 5); - m02 <<= 16; - m0 += m01; - - m12 = *(uchar *) (m + 6); - m03 <<= 24; - m0 += m02; - - m13 = *(uchar *) (m + 7); - m3 <<= 51; - m0 += m03; - - m20 = *(uchar *) (m + 8); - m11 <<= 8; - m1 += m10; - - m21 = *(uchar *) (m + 9); - m12 <<= 16; - m1 += m11; - - m22 = *(uchar *) (m + 10); - m13 <<= 24; - m1 += m12; - - m23 = *(uchar *) (m + 11); - m1 += m13; - - m30 = *(uchar *) (m + 12); - m21 <<= 8; - m2 += m20; - - m31 = *(uchar *) (m + 13); - m22 <<= 16; - m2 += m21; - - m32 = *(uchar *) (m + 14); - m23 <<= 24; - m2 += m22; - - m33 = *(uchar *) (m + 15); - m2 += m23; - - d0 = m0; - m31 <<= 8; - m3 += m30; - - d1 = m1; - m32 <<= 16; - m3 += m31; - - d2 = m2; - m33 += 256; - - m33 <<= 24; - m3 += m32; - - m3 += m33; - d3 = m3; - - m += 16; - l -= 16; - - z0 = *(double *) &d0; - - z1 = *(double *) &d1; - - z2 = *(double *) &d2; - - z3 = *(double *) &d3; - - z0 -= alpha0; - - z1 -= alpha32; - - z2 -= alpha64; - - z3 -= alpha96; - - h0 += z0; - - h1 += z1; - - h3 += z2; - - h5 += z3; - -if (l < 16) goto multiplyaddatmost15bytes; - -multiplyaddatleast16bytes:; - - m2 = 2279; - m20 = *(uchar *) (m + 8); - y7 = h7 + alpha130; - - m2 <<= 51; - m3 = 2343; - m21 = *(uchar *) (m + 9); - y6 = h6 + alpha130; - - m3 <<= 51; - m0 = 2151; - m22 = *(uchar *) (m + 10); - y1 = h1 + alpha32; - - m0 <<= 51; - m1 = 2215; - m23 = *(uchar *) (m + 11); - y0 = h0 + alpha32; - - m1 <<= 51; - m30 = *(uchar *) (m + 12); - y7 -= alpha130; - - m21 <<= 8; - m2 += m20; - m31 = *(uchar *) (m + 13); - y6 -= alpha130; - - m22 <<= 16; - m2 += m21; - m32 = *(uchar *) (m + 14); - y1 -= alpha32; - - m23 <<= 24; - m2 += m22; - m33 = *(uchar *) (m + 15); - y0 -= alpha32; - - m2 += m23; - m00 = *(uchar *) (m + 0); - y5 = h5 + alpha96; - - m31 <<= 8; - m3 += m30; - m01 = *(uchar *) (m + 1); - y4 = h4 + alpha96; - - m32 <<= 16; - m02 = *(uchar *) (m + 2); - x7 = h7 - y7; - y7 *= scale; - - m33 += 256; - m03 = *(uchar *) (m + 3); - x6 = h6 - y6; - y6 *= scale; - - m33 <<= 24; - m3 += m31; - m10 = *(uchar *) (m + 4); - x1 = h1 - y1; - - m01 <<= 8; - m3 += m32; - m11 = *(uchar *) (m + 5); - x0 = h0 - y0; - - m3 += m33; - m0 += m00; - m12 = *(uchar *) (m + 6); - y5 -= alpha96; - - m02 <<= 16; - m0 += m01; - m13 = *(uchar *) (m + 7); - y4 -= alpha96; - - m03 <<= 24; - m0 += m02; - d2 = m2; - x1 += y7; - - m0 += m03; - d3 = m3; - x0 += y6; - - m11 <<= 8; - m1 += m10; - d0 = m0; - x7 += y5; - - m12 <<= 16; - m1 += m11; - x6 += y4; - - m13 <<= 24; - m1 += m12; - y3 = h3 + alpha64; - - m1 += m13; - d1 = m1; - y2 = h2 + alpha64; - - x0 += x1; - - x6 += x7; - - y3 -= alpha64; - r3low = r3low_stack; - - y2 -= alpha64; - r0low = r0low_stack; - - x5 = h5 - y5; - r3lowx0 = r3low * x0; - r3high = r3high_stack; - - x4 = h4 - y4; - r0lowx6 = r0low * x6; - r0high = r0high_stack; - - x3 = h3 - y3; - r3highx0 = r3high * x0; - sr1low = sr1low_stack; - - x2 = h2 - y2; - r0highx6 = r0high * x6; - sr1high = sr1high_stack; - - x5 += y3; - r0lowx0 = r0low * x0; - r1low = r1low_stack; - - h6 = r3lowx0 + r0lowx6; - sr1lowx6 = sr1low * x6; - r1high = r1high_stack; - - x4 += y2; - r0highx0 = r0high * x0; - sr2low = sr2low_stack; - - h7 = r3highx0 + r0highx6; - sr1highx6 = sr1high * x6; - sr2high = sr2high_stack; - - x3 += y1; - r1lowx0 = r1low * x0; - r2low = r2low_stack; - - h0 = r0lowx0 + sr1lowx6; - sr2lowx6 = sr2low * x6; - r2high = r2high_stack; - - x2 += y0; - r1highx0 = r1high * x0; - sr3low = sr3low_stack; - - h1 = r0highx0 + sr1highx6; - sr2highx6 = sr2high * x6; - sr3high = sr3high_stack; - - x4 += x5; - r2lowx0 = r2low * x0; - z2 = *(double *) &d2; - - h2 = r1lowx0 + sr2lowx6; - sr3lowx6 = sr3low * x6; - - x2 += x3; - r2highx0 = r2high * x0; - z3 = *(double *) &d3; - - h3 = r1highx0 + sr2highx6; - sr3highx6 = sr3high * x6; - - r1highx4 = r1high * x4; - z2 -= alpha64; - - h4 = r2lowx0 + sr3lowx6; - r1lowx4 = r1low * x4; - - r0highx4 = r0high * x4; - z3 -= alpha96; - - h5 = r2highx0 + sr3highx6; - r0lowx4 = r0low * x4; - - h7 += r1highx4; - sr3highx4 = sr3high * x4; - - h6 += r1lowx4; - sr3lowx4 = sr3low * x4; - - h5 += r0highx4; - sr2highx4 = sr2high * x4; - - h4 += r0lowx4; - sr2lowx4 = sr2low * x4; - - h3 += sr3highx4; - r0lowx2 = r0low * x2; - - h2 += sr3lowx4; - r0highx2 = r0high * x2; - - h1 += sr2highx4; - r1lowx2 = r1low * x2; - - h0 += sr2lowx4; - r1highx2 = r1high * x2; - - h2 += r0lowx2; - r2lowx2 = r2low * x2; - - h3 += r0highx2; - r2highx2 = r2high * x2; - - h4 += r1lowx2; - sr3lowx2 = sr3low * x2; - - h5 += r1highx2; - sr3highx2 = sr3high * x2; - alpha0 = *(double *) (constants + 24); - - m += 16; - h6 += r2lowx2; - - l -= 16; - h7 += r2highx2; - - z1 = *(double *) &d1; - h0 += sr3lowx2; - - z0 = *(double *) &d0; - h1 += sr3highx2; - - z1 -= alpha32; - - z0 -= alpha0; - - h5 += z3; - - h3 += z2; - - h1 += z1; - - h0 += z0; - -if (l >= 16) goto multiplyaddatleast16bytes; - -multiplyaddatmost15bytes:; - - y7 = h7 + alpha130; - - y6 = h6 + alpha130; - - y1 = h1 + alpha32; - - y0 = h0 + alpha32; - - y7 -= alpha130; - - y6 -= alpha130; - - y1 -= alpha32; - - y0 -= alpha32; - - y5 = h5 + alpha96; - - y4 = h4 + alpha96; - - x7 = h7 - y7; - y7 *= scale; - - x6 = h6 - y6; - y6 *= scale; - - x1 = h1 - y1; - - x0 = h0 - y0; - - y5 -= alpha96; - - y4 -= alpha96; - - x1 += y7; - - x0 += y6; - - x7 += y5; - - x6 += y4; - - y3 = h3 + alpha64; - - y2 = h2 + alpha64; - - x0 += x1; - - x6 += x7; - - y3 -= alpha64; - r3low = r3low_stack; - - y2 -= alpha64; - r0low = r0low_stack; - - x5 = h5 - y5; - r3lowx0 = r3low * x0; - r3high = r3high_stack; - - x4 = h4 - y4; - r0lowx6 = r0low * x6; - r0high = r0high_stack; - - x3 = h3 - y3; - r3highx0 = r3high * x0; - sr1low = sr1low_stack; - - x2 = h2 - y2; - r0highx6 = r0high * x6; - sr1high = sr1high_stack; - - x5 += y3; - r0lowx0 = r0low * x0; - r1low = r1low_stack; - - h6 = r3lowx0 + r0lowx6; - sr1lowx6 = sr1low * x6; - r1high = r1high_stack; - - x4 += y2; - r0highx0 = r0high * x0; - sr2low = sr2low_stack; - - h7 = r3highx0 + r0highx6; - sr1highx6 = sr1high * x6; - sr2high = sr2high_stack; - - x3 += y1; - r1lowx0 = r1low * x0; - r2low = r2low_stack; - - h0 = r0lowx0 + sr1lowx6; - sr2lowx6 = sr2low * x6; - r2high = r2high_stack; - - x2 += y0; - r1highx0 = r1high * x0; - sr3low = sr3low_stack; - - h1 = r0highx0 + sr1highx6; - sr2highx6 = sr2high * x6; - sr3high = sr3high_stack; - - x4 += x5; - r2lowx0 = r2low * x0; - - h2 = r1lowx0 + sr2lowx6; - sr3lowx6 = sr3low * x6; - - x2 += x3; - r2highx0 = r2high * x0; - - h3 = r1highx0 + sr2highx6; - sr3highx6 = sr3high * x6; - - r1highx4 = r1high * x4; - - h4 = r2lowx0 + sr3lowx6; - r1lowx4 = r1low * x4; - - r0highx4 = r0high * x4; - - h5 = r2highx0 + sr3highx6; - r0lowx4 = r0low * x4; - - h7 += r1highx4; - sr3highx4 = sr3high * x4; - - h6 += r1lowx4; - sr3lowx4 = sr3low * x4; - - h5 += r0highx4; - sr2highx4 = sr2high * x4; - - h4 += r0lowx4; - sr2lowx4 = sr2low * x4; - - h3 += sr3highx4; - r0lowx2 = r0low * x2; - - h2 += sr3lowx4; - r0highx2 = r0high * x2; - - h1 += sr2highx4; - r1lowx2 = r1low * x2; - - h0 += sr2lowx4; - r1highx2 = r1high * x2; - - h2 += r0lowx2; - r2lowx2 = r2low * x2; - - h3 += r0highx2; - r2highx2 = r2high * x2; - - h4 += r1lowx2; - sr3lowx2 = sr3low * x2; - - h5 += r1highx2; - sr3highx2 = sr3high * x2; - - h6 += r2lowx2; - - h7 += r2highx2; - - h0 += sr3lowx2; - - h1 += sr3highx2; - -addatmost15bytes:; - -if (l == 0) goto nomorebytes; - - lbelow2 = l - 2; - - lbelow3 = l - 3; - - lbelow2 >>= 31; - lbelow4 = l - 4; - - m00 = *(uchar *) (m + 0); - lbelow3 >>= 31; - m += lbelow2; - - m01 = *(uchar *) (m + 1); - lbelow4 >>= 31; - m += lbelow3; - - m02 = *(uchar *) (m + 2); - m += lbelow4; - m0 = 2151; - - m03 = *(uchar *) (m + 3); - m0 <<= 51; - m1 = 2215; - - m0 += m00; - m01 &= ~lbelow2; - - m02 &= ~lbelow3; - m01 -= lbelow2; - - m01 <<= 8; - m03 &= ~lbelow4; - - m0 += m01; - lbelow2 -= lbelow3; - - m02 += lbelow2; - lbelow3 -= lbelow4; - - m02 <<= 16; - m03 += lbelow3; - - m03 <<= 24; - m0 += m02; - - m0 += m03; - lbelow5 = l - 5; - - lbelow6 = l - 6; - lbelow7 = l - 7; - - lbelow5 >>= 31; - lbelow8 = l - 8; - - lbelow6 >>= 31; - m += lbelow5; - - m10 = *(uchar *) (m + 4); - lbelow7 >>= 31; - m += lbelow6; - - m11 = *(uchar *) (m + 5); - lbelow8 >>= 31; - m += lbelow7; - - m12 = *(uchar *) (m + 6); - m1 <<= 51; - m += lbelow8; - - m13 = *(uchar *) (m + 7); - m10 &= ~lbelow5; - lbelow4 -= lbelow5; - - m10 += lbelow4; - lbelow5 -= lbelow6; - - m11 &= ~lbelow6; - m11 += lbelow5; - - m11 <<= 8; - m1 += m10; - - m1 += m11; - m12 &= ~lbelow7; - - lbelow6 -= lbelow7; - m13 &= ~lbelow8; - - m12 += lbelow6; - lbelow7 -= lbelow8; - - m12 <<= 16; - m13 += lbelow7; - - m13 <<= 24; - m1 += m12; - - m1 += m13; - m2 = 2279; - - lbelow9 = l - 9; - m3 = 2343; - - lbelow10 = l - 10; - lbelow11 = l - 11; - - lbelow9 >>= 31; - lbelow12 = l - 12; - - lbelow10 >>= 31; - m += lbelow9; - - m20 = *(uchar *) (m + 8); - lbelow11 >>= 31; - m += lbelow10; - - m21 = *(uchar *) (m + 9); - lbelow12 >>= 31; - m += lbelow11; - - m22 = *(uchar *) (m + 10); - m2 <<= 51; - m += lbelow12; - - m23 = *(uchar *) (m + 11); - m20 &= ~lbelow9; - lbelow8 -= lbelow9; - - m20 += lbelow8; - lbelow9 -= lbelow10; - - m21 &= ~lbelow10; - m21 += lbelow9; - - m21 <<= 8; - m2 += m20; - - m2 += m21; - m22 &= ~lbelow11; - - lbelow10 -= lbelow11; - m23 &= ~lbelow12; - - m22 += lbelow10; - lbelow11 -= lbelow12; - - m22 <<= 16; - m23 += lbelow11; - - m23 <<= 24; - m2 += m22; - - m3 <<= 51; - lbelow13 = l - 13; - - lbelow13 >>= 31; - lbelow14 = l - 14; - - lbelow14 >>= 31; - m += lbelow13; - lbelow15 = l - 15; - - m30 = *(uchar *) (m + 12); - lbelow15 >>= 31; - m += lbelow14; - - m31 = *(uchar *) (m + 13); - m += lbelow15; - m2 += m23; - - m32 = *(uchar *) (m + 14); - m30 &= ~lbelow13; - lbelow12 -= lbelow13; - - m30 += lbelow12; - lbelow13 -= lbelow14; - - m3 += m30; - m31 &= ~lbelow14; - - m31 += lbelow13; - m32 &= ~lbelow15; - - m31 <<= 8; - lbelow14 -= lbelow15; - - m3 += m31; - m32 += lbelow14; - d0 = m0; - - m32 <<= 16; - m33 = lbelow15 + 1; - d1 = m1; - - m33 <<= 24; - m3 += m32; - d2 = m2; - - m3 += m33; - d3 = m3; - - alpha0 = *(double *) (constants + 24); - - z3 = *(double *) &d3; - - z2 = *(double *) &d2; - - z1 = *(double *) &d1; - - z0 = *(double *) &d0; - - z3 -= alpha96; - - z2 -= alpha64; - - z1 -= alpha32; - - z0 -= alpha0; - - h5 += z3; - - h3 += z2; - - h1 += z1; - - h0 += z0; - - y7 = h7 + alpha130; - - y6 = h6 + alpha130; - - y1 = h1 + alpha32; - - y0 = h0 + alpha32; - - y7 -= alpha130; - - y6 -= alpha130; - - y1 -= alpha32; - - y0 -= alpha32; - - y5 = h5 + alpha96; - - y4 = h4 + alpha96; - - x7 = h7 - y7; - y7 *= scale; - - x6 = h6 - y6; - y6 *= scale; - - x1 = h1 - y1; - - x0 = h0 - y0; - - y5 -= alpha96; - - y4 -= alpha96; - - x1 += y7; - - x0 += y6; - - x7 += y5; - - x6 += y4; - - y3 = h3 + alpha64; - - y2 = h2 + alpha64; - - x0 += x1; - - x6 += x7; - - y3 -= alpha64; - r3low = r3low_stack; - - y2 -= alpha64; - r0low = r0low_stack; - - x5 = h5 - y5; - r3lowx0 = r3low * x0; - r3high = r3high_stack; - - x4 = h4 - y4; - r0lowx6 = r0low * x6; - r0high = r0high_stack; - - x3 = h3 - y3; - r3highx0 = r3high * x0; - sr1low = sr1low_stack; - - x2 = h2 - y2; - r0highx6 = r0high * x6; - sr1high = sr1high_stack; - - x5 += y3; - r0lowx0 = r0low * x0; - r1low = r1low_stack; - - h6 = r3lowx0 + r0lowx6; - sr1lowx6 = sr1low * x6; - r1high = r1high_stack; - - x4 += y2; - r0highx0 = r0high * x0; - sr2low = sr2low_stack; - - h7 = r3highx0 + r0highx6; - sr1highx6 = sr1high * x6; - sr2high = sr2high_stack; - - x3 += y1; - r1lowx0 = r1low * x0; - r2low = r2low_stack; - - h0 = r0lowx0 + sr1lowx6; - sr2lowx6 = sr2low * x6; - r2high = r2high_stack; - - x2 += y0; - r1highx0 = r1high * x0; - sr3low = sr3low_stack; - - h1 = r0highx0 + sr1highx6; - sr2highx6 = sr2high * x6; - sr3high = sr3high_stack; - - x4 += x5; - r2lowx0 = r2low * x0; - - h2 = r1lowx0 + sr2lowx6; - sr3lowx6 = sr3low * x6; - - x2 += x3; - r2highx0 = r2high * x0; - - h3 = r1highx0 + sr2highx6; - sr3highx6 = sr3high * x6; - - r1highx4 = r1high * x4; - - h4 = r2lowx0 + sr3lowx6; - r1lowx4 = r1low * x4; - - r0highx4 = r0high * x4; - - h5 = r2highx0 + sr3highx6; - r0lowx4 = r0low * x4; - - h7 += r1highx4; - sr3highx4 = sr3high * x4; - - h6 += r1lowx4; - sr3lowx4 = sr3low * x4; - - h5 += r0highx4; - sr2highx4 = sr2high * x4; - - h4 += r0lowx4; - sr2lowx4 = sr2low * x4; - - h3 += sr3highx4; - r0lowx2 = r0low * x2; - - h2 += sr3lowx4; - r0highx2 = r0high * x2; - - h1 += sr2highx4; - r1lowx2 = r1low * x2; - - h0 += sr2lowx4; - r1highx2 = r1high * x2; - - h2 += r0lowx2; - r2lowx2 = r2low * x2; - - h3 += r0highx2; - r2highx2 = r2high * x2; - - h4 += r1lowx2; - sr3lowx2 = sr3low * x2; - - h5 += r1highx2; - sr3highx2 = sr3high * x2; - - h6 += r2lowx2; - - h7 += r2highx2; - - h0 += sr3lowx2; - - h1 += sr3highx2; - - -nomorebytes:; - - offset0 = *(double *) (constants + 104); - y7 = h7 + alpha130; - - offset1 = *(double *) (constants + 112); - y0 = h0 + alpha32; - - offset2 = *(double *) (constants + 120); - y1 = h1 + alpha32; - - offset3 = *(double *) (constants + 128); - y2 = h2 + alpha64; - - y7 -= alpha130; - - y3 = h3 + alpha64; - - y4 = h4 + alpha96; - - y5 = h5 + alpha96; - - x7 = h7 - y7; - y7 *= scale; - - y0 -= alpha32; - - y1 -= alpha32; - - y2 -= alpha64; - - h6 += x7; - - y3 -= alpha64; - - y4 -= alpha96; - - y5 -= alpha96; - - y6 = h6 + alpha130; - - x0 = h0 - y0; - - x1 = h1 - y1; - - x2 = h2 - y2; - - y6 -= alpha130; - - x0 += y7; - - x3 = h3 - y3; - - x4 = h4 - y4; - - x5 = h5 - y5; - - x6 = h6 - y6; - - y6 *= scale; - - x2 += y0; - - x3 += y1; - - x4 += y2; - - x0 += y6; - - x5 += y3; - - x6 += y4; - - x2 += x3; - - x0 += x1; - - x4 += x5; - - x6 += y5; - - x2 += offset1; - *(double *) &d1 = x2; - - x0 += offset0; - *(double *) &d0 = x0; - - x4 += offset2; - *(double *) &d2 = x4; - - x6 += offset3; - *(double *) &d3 = x6; - - - - - f0 = d0; - - f1 = d1; - bits32 = -1; - - f2 = d2; - bits32 >>= 32; - - f3 = d3; - f = f0 >> 32; - - f0 &= bits32; - f &= 255; - - f1 += f; - g0 = f0 + 5; - - g = g0 >> 32; - g0 &= bits32; - - f = f1 >> 32; - f1 &= bits32; - - f &= 255; - g1 = f1 + g; - - g = g1 >> 32; - f2 += f; - - f = f2 >> 32; - g1 &= bits32; - - f2 &= bits32; - f &= 255; - - f3 += f; - g2 = f2 + g; - - g = g2 >> 32; - g2 &= bits32; - - f4 = f3 >> 32; - f3 &= bits32; - - f4 &= 255; - g3 = f3 + g; - - g = g3 >> 32; - g3 &= bits32; - - g4 = f4 + g; - - g4 = g4 - 4; - s00 = *(uchar *) (s + 0); - - f = (int64) g4 >> 63; - s01 = *(uchar *) (s + 1); - - f0 &= f; - g0 &= ~f; - s02 = *(uchar *) (s + 2); - - f1 &= f; - f0 |= g0; - s03 = *(uchar *) (s + 3); - - g1 &= ~f; - f2 &= f; - s10 = *(uchar *) (s + 4); - - f3 &= f; - g2 &= ~f; - s11 = *(uchar *) (s + 5); - - g3 &= ~f; - f1 |= g1; - s12 = *(uchar *) (s + 6); - - f2 |= g2; - f3 |= g3; - s13 = *(uchar *) (s + 7); - - s01 <<= 8; - f0 += s00; - s20 = *(uchar *) (s + 8); - - s02 <<= 16; - f0 += s01; - s21 = *(uchar *) (s + 9); - - s03 <<= 24; - f0 += s02; - s22 = *(uchar *) (s + 10); - - s11 <<= 8; - f1 += s10; - s23 = *(uchar *) (s + 11); - - s12 <<= 16; - f1 += s11; - s30 = *(uchar *) (s + 12); - - s13 <<= 24; - f1 += s12; - s31 = *(uchar *) (s + 13); - - f0 += s03; - f1 += s13; - s32 = *(uchar *) (s + 14); - - s21 <<= 8; - f2 += s20; - s33 = *(uchar *) (s + 15); - - s22 <<= 16; - f2 += s21; - - s23 <<= 24; - f2 += s22; - - s31 <<= 8; - f3 += s30; - - s32 <<= 16; - f3 += s31; - - s33 <<= 24; - f3 += s32; - - f2 += s23; - f3 += s33; - - *(uchar *) (out + 0) = f0; - f0 >>= 8; - *(uchar *) (out + 1) = f0; - f0 >>= 8; - *(uchar *) (out + 2) = f0; - f0 >>= 8; - *(uchar *) (out + 3) = f0; - f0 >>= 8; - f1 += f0; - - *(uchar *) (out + 4) = f1; - f1 >>= 8; - *(uchar *) (out + 5) = f1; - f1 >>= 8; - *(uchar *) (out + 6) = f1; - f1 >>= 8; - *(uchar *) (out + 7) = f1; - f1 >>= 8; - f2 += f1; - - *(uchar *) (out + 8) = f2; - f2 >>= 8; - *(uchar *) (out + 9) = f2; - f2 >>= 8; - *(uchar *) (out + 10) = f2; - f2 >>= 8; - *(uchar *) (out + 11) = f2; - f2 >>= 8; - f3 += f2; - - *(uchar *) (out + 12) = f3; - f3 >>= 8; - *(uchar *) (out + 13) = f3; - f3 >>= 8; - *(uchar *) (out + 14) = f3; - f3 >>= 8; - *(uchar *) (out + 15) = f3; - - return 0; -} diff --git a/src/libnacl/crypto_onetimeauth/poly1305/53/verify.c b/src/libnacl/crypto_onetimeauth/poly1305/53/verify.c deleted file mode 100644 index c7e063f1..00000000 --- a/src/libnacl/crypto_onetimeauth/poly1305/53/verify.c +++ /dev/null @@ -1,9 +0,0 @@ -#include "crypto_verify_16.h" -#include "crypto_onetimeauth.h" - -int crypto_onetimeauth_verify(const unsigned char *h,const unsigned char *in,unsigned long long inlen,const unsigned char *k) -{ - unsigned char correct[16]; - crypto_onetimeauth(correct,in,inlen,k); - return crypto_verify_16(h,correct); -} diff --git a/src/libnacl/crypto_onetimeauth/poly1305/amd64/api.h b/src/libnacl/crypto_onetimeauth/poly1305/amd64/api.h deleted file mode 100644 index acc133ed..00000000 --- a/src/libnacl/crypto_onetimeauth/poly1305/amd64/api.h +++ /dev/null @@ -1,2 +0,0 @@ -#define CRYPTO_BYTES 16 -#define CRYPTO_KEYBYTES 32 diff --git a/src/libnacl/crypto_onetimeauth/poly1305/amd64/auth.s b/src/libnacl/crypto_onetimeauth/poly1305/amd64/auth.s deleted file mode 100644 index 5212a3e7..00000000 --- a/src/libnacl/crypto_onetimeauth/poly1305/amd64/auth.s +++ /dev/null @@ -1,2787 +0,0 @@ - -# qhasm: int64 r11_caller - -# qhasm: int64 r12_caller - -# qhasm: int64 r13_caller - -# qhasm: int64 r14_caller - -# qhasm: int64 r15_caller - -# qhasm: int64 rbx_caller - -# qhasm: int64 rbp_caller - -# qhasm: caller r11_caller - -# qhasm: caller r12_caller - -# qhasm: caller r13_caller - -# qhasm: caller r14_caller - -# qhasm: caller r15_caller - -# qhasm: caller rbx_caller - -# qhasm: caller rbp_caller - -# qhasm: stack64 r11_stack - -# qhasm: stack64 r12_stack - -# qhasm: stack64 r13_stack - -# qhasm: stack64 r14_stack - -# qhasm: stack64 r15_stack - -# qhasm: stack64 rbx_stack - -# qhasm: stack64 rbp_stack - -# qhasm: int64 out - -# qhasm: stack64 out_stack - -# qhasm: int64 m - -# qhasm: int64 l - -# qhasm: int64 k - -# qhasm: stack64 k_stack - -# qhasm: int64 m0 - -# qhasm: int64 m1 - -# qhasm: int64 m2 - -# qhasm: int64 m3 - -# qhasm: float80 a0 - -# qhasm: float80 a1 - -# qhasm: float80 a2 - -# qhasm: float80 a3 - -# qhasm: float80 h0 - -# qhasm: float80 h1 - -# qhasm: float80 h2 - -# qhasm: float80 h3 - -# qhasm: float80 x0 - -# qhasm: float80 x1 - -# qhasm: float80 x2 - -# qhasm: float80 x3 - -# qhasm: float80 y0 - -# qhasm: float80 y1 - -# qhasm: float80 y2 - -# qhasm: float80 y3 - -# qhasm: float80 r0x0 - -# qhasm: float80 r1x0 - -# qhasm: float80 r2x0 - -# qhasm: float80 r3x0 - -# qhasm: float80 r0x1 - -# qhasm: float80 r1x1 - -# qhasm: float80 r2x1 - -# qhasm: float80 sr3x1 - -# qhasm: float80 r0x2 - -# qhasm: float80 r1x2 - -# qhasm: float80 sr2x2 - -# qhasm: float80 sr3x2 - -# qhasm: float80 r0x3 - -# qhasm: float80 sr1x3 - -# qhasm: float80 sr2x3 - -# qhasm: float80 sr3x3 - -# qhasm: stack64 d0 - -# qhasm: stack64 d1 - -# qhasm: stack64 d2 - -# qhasm: stack64 d3 - -# qhasm: stack64 r0 - -# qhasm: stack64 r1 - -# qhasm: stack64 r2 - -# qhasm: stack64 r3 - -# qhasm: stack64 sr1 - -# qhasm: stack64 sr2 - -# qhasm: stack64 sr3 - -# qhasm: enter crypto_onetimeauth_poly1305_amd64 -.text -.p2align 5 -.globl _crypto_onetimeauth_poly1305_amd64 -.globl crypto_onetimeauth_poly1305_amd64 -_crypto_onetimeauth_poly1305_amd64: -crypto_onetimeauth_poly1305_amd64: -mov %rsp,%r11 -and $31,%r11 -add $192,%r11 -sub %r11,%rsp - -# qhasm: input out - -# qhasm: input m - -# qhasm: input l - -# qhasm: input k - -# qhasm: r11_stack = r11_caller -# asm 1: movq r11_stack=stack64#1 -# asm 2: movq r11_stack=32(%rsp) -movq %r11,32(%rsp) - -# qhasm: r12_stack = r12_caller -# asm 1: movq r12_stack=stack64#2 -# asm 2: movq r12_stack=40(%rsp) -movq %r12,40(%rsp) - -# qhasm: r13_stack = r13_caller -# asm 1: movq r13_stack=stack64#3 -# asm 2: movq r13_stack=48(%rsp) -movq %r13,48(%rsp) - -# qhasm: r14_stack = r14_caller -# asm 1: movq r14_stack=stack64#4 -# asm 2: movq r14_stack=56(%rsp) -movq %r14,56(%rsp) - -# qhasm: r15_stack = r15_caller -# asm 1: movq r15_stack=stack64#5 -# asm 2: movq r15_stack=64(%rsp) -movq %r15,64(%rsp) - -# qhasm: rbx_stack = rbx_caller -# asm 1: movq rbx_stack=stack64#6 -# asm 2: movq rbx_stack=72(%rsp) -movq %rbx,72(%rsp) - -# qhasm: rbp_stack = rbp_caller -# asm 1: movq rbp_stack=stack64#7 -# asm 2: movq rbp_stack=80(%rsp) -movq %rbp,80(%rsp) - -# qhasm: round *(uint16 *) &crypto_onetimeauth_poly1305_amd64_rounding -fldcw crypto_onetimeauth_poly1305_amd64_rounding(%rip) - -# qhasm: m0 = *(uint32 *) (k + 0) -# asm 1: movl 0(m0=int64#5d -# asm 2: movl 0(m0=%r8d -movl 0(%rcx),%r8d - -# qhasm: m1 = *(uint32 *) (k + 4) -# asm 1: movl 4(m1=int64#6d -# asm 2: movl 4(m1=%r9d -movl 4(%rcx),%r9d - -# qhasm: m2 = *(uint32 *) (k + 8) -# asm 1: movl 8(m2=int64#7d -# asm 2: movl 8(m2=%eax -movl 8(%rcx),%eax - -# qhasm: m3 = *(uint32 *) (k + 12) -# asm 1: movl 12(m3=int64#8d -# asm 2: movl 12(m3=%r10d -movl 12(%rcx),%r10d - -# qhasm: out_stack = out -# asm 1: movq out_stack=stack64#8 -# asm 2: movq out_stack=88(%rsp) -movq %rdi,88(%rsp) - -# qhasm: k_stack = k -# asm 1: movq k_stack=stack64#9 -# asm 2: movq k_stack=96(%rsp) -movq %rcx,96(%rsp) - -# qhasm: d0 top = 0x43300000 -# asm 1: movl $0x43300000,>d0=stack64#10 -# asm 2: movl $0x43300000,>d0=108(%rsp) -movl $0x43300000,108(%rsp) - -# qhasm: d1 top = 0x45300000 -# asm 1: movl $0x45300000,>d1=stack64#11 -# asm 2: movl $0x45300000,>d1=116(%rsp) -movl $0x45300000,116(%rsp) - -# qhasm: d2 top = 0x47300000 -# asm 1: movl $0x47300000,>d2=stack64#12 -# asm 2: movl $0x47300000,>d2=124(%rsp) -movl $0x47300000,124(%rsp) - -# qhasm: d3 top = 0x49300000 -# asm 1: movl $0x49300000,>d3=stack64#13 -# asm 2: movl $0x49300000,>d3=132(%rsp) -movl $0x49300000,132(%rsp) - -# qhasm: (uint32) m0 &= 0x0fffffff -# asm 1: and $0x0fffffff,r0=stack64#14 -# asm 2: fstpl >r0=136(%rsp) -fstpl 136(%rsp) -# comment:fpstackfrombottom:r1=stack64#15 -# asm 2: fstl >r1=144(%rsp) -fstl 144(%rsp) -# comment:fpstackfrombottom:sr1=stack64#16 -# asm 2: fstpl >sr1=152(%rsp) -fstpl 152(%rsp) -# comment:fpstackfrombottom:r2=stack64#17 -# asm 2: fstl >r2=160(%rsp) -fstl 160(%rsp) -# comment:fpstackfrombottom:sr2=stack64#18 -# asm 2: fstpl >sr2=168(%rsp) -fstpl 168(%rsp) -# comment:fpstackfrombottom:r3=stack64#19 -# asm 2: fstl >r3=176(%rsp) -fstl 176(%rsp) -# comment:fpstackfrombottom:sr3=stack64#20 -# asm 2: fstpl >sr3=184(%rsp) -fstpl 184(%rsp) -# comment:fpstackfrombottom: - -# qhasm: h3 = 0 -fldz -# comment:fpstackfrombottom:m3=int64#1d -# asm 2: movl 12(m3=%edi -movl 12(%rsi),%edi -# comment:fpstackfrombottom:m2=int64#4d -# asm 2: movl 8(m2=%ecx -movl 8(%rsi),%ecx -# comment:fpstackfrombottom:m1=int64#5d -# asm 2: movl 4(m1=%r8d -movl 4(%rsi),%r8d -# comment:fpstackfrombottom:m0=int64#6d -# asm 2: movl 0(m0=%r9d -movl 0(%rsi),%r9d -# comment:fpstackfrombottom:m3=int64#1d -# asm 2: movl 12(m3=%edi -movl 12(%rsi),%edi -# comment:fpstackfrombottom:m2=int64#4d -# asm 2: movl 8(m2=%ecx -movl 8(%rsi),%ecx -# comment:fpstackfrombottom:m1=int64#5d -# asm 2: movl 4(m1=%r8d -movl 4(%rsi),%r8d -# comment:fpstackfrombottom:m0=int64#6d -# asm 2: movl 0(m0=%r9d -movl 0(%rsi),%r9d -# comment:fpstackfrombottom:lastchunk=stack128#1 -# asm 2: movl $0,>lastchunk=0(%rsp) -movl $0,0(%rsp) -# comment:fpstackfrombottom:destination=int64#1 -# asm 2: leaq destination=%rdi -leaq 0(%rsp),%rdi -# comment:fpstackfrombottom:numbytes=int64#4 -# asm 2: mov numbytes=%rcx -mov %rdx,%rcx -# comment:fpstackfrombottom:m3=int64#1d -# asm 2: movl 12+m3=%edi -movl 12+0(%rsp),%edi -# comment:fpstackfrombottom:m2=int64#2d -# asm 2: movl 8+m2=%esi -movl 8+0(%rsp),%esi -# comment:fpstackfrombottom:m1=int64#3d -# asm 2: movl 4+m1=%edx -movl 4+0(%rsp),%edx -# comment:fpstackfrombottom:m0=int64#4d -# asm 2: movl m0=%ecx -movl 0(%rsp),%ecx -# comment:fpstackfrombottom:d0=stack64#10 -# asm 2: fstpl >d0=104(%rsp) -fstpl 104(%rsp) -# comment:fpstackfrombottom:d1=stack64#11 -# asm 2: fstpl >d1=112(%rsp) -fstpl 112(%rsp) -# comment:fpstackfrombottom:d2=stack64#12 -# asm 2: fstpl >d2=120(%rsp) -fstpl 120(%rsp) -# comment:fpstackfrombottom:d3=stack64#13 -# asm 2: fstpl >d3=128(%rsp) -fstpl 128(%rsp) -# comment:fpstackfrombottom: - -# qhasm: int64 f0 - -# qhasm: int64 f1 - -# qhasm: int64 f2 - -# qhasm: int64 f3 - -# qhasm: int64 f4 - -# qhasm: int64 g0 - -# qhasm: int64 g1 - -# qhasm: int64 g2 - -# qhasm: int64 g3 - -# qhasm: int64 f - -# qhasm: int64 notf - -# qhasm: stack64 f1_stack - -# qhasm: stack64 f2_stack - -# qhasm: stack64 f3_stack - -# qhasm: stack64 f4_stack - -# qhasm: stack64 g0_stack - -# qhasm: stack64 g1_stack - -# qhasm: stack64 g2_stack - -# qhasm: stack64 g3_stack - -# qhasm: g0 = top d0 -# asm 1: movl g0=int64#1d -# asm 2: movl g0=%edi -movl 108(%rsp),%edi - -# qhasm: (uint32) g0 &= 63 -# asm 1: and $63,g1=int64#2d -# asm 2: movl g1=%esi -movl 116(%rsp),%esi - -# qhasm: (uint32) g1 &= 63 -# asm 1: and $63,g2=int64#3d -# asm 2: movl g2=%edx -movl 124(%rsp),%edx - -# qhasm: (uint32) g2 &= 63 -# asm 1: and $63,g3=int64#4d -# asm 2: movl g3=%ecx -movl 132(%rsp),%ecx - -# qhasm: (uint32) g3 &= 63 -# asm 1: and $63,f1=int64#5d -# asm 2: movl f1=%r8d -movl 112(%rsp),%r8d - -# qhasm: carry? (uint32) f1 += g0 -# asm 1: add f1_stack=stack64#11 -# asm 2: movq f1_stack=112(%rsp) -movq %r8,112(%rsp) - -# qhasm: f2 = bottom d2 -# asm 1: movl f2=int64#1d -# asm 2: movl f2=%edi -movl 120(%rsp),%edi - -# qhasm: carry? (uint32) f2 += g1 + carry -# asm 1: adc f2_stack=stack64#12 -# asm 2: movq f2_stack=120(%rsp) -movq %rdi,120(%rsp) - -# qhasm: f3 = bottom d3 -# asm 1: movl f3=int64#1d -# asm 2: movl f3=%edi -movl 128(%rsp),%edi - -# qhasm: carry? (uint32) f3 += g2 + carry -# asm 1: adc f3_stack=stack64#13 -# asm 2: movq f3_stack=128(%rsp) -movq %rdi,128(%rsp) - -# qhasm: f4 = 0 -# asm 1: mov $0,>f4=int64#1 -# asm 2: mov $0,>f4=%rdi -mov $0,%rdi - -# qhasm: carry? (uint32) f4 += g3 + carry -# asm 1: adc f4_stack=stack64#14 -# asm 2: movq f4_stack=136(%rsp) -movq %rdi,136(%rsp) - -# qhasm: g0 = 5 -# asm 1: mov $5,>g0=int64#1 -# asm 2: mov $5,>g0=%rdi -mov $5,%rdi - -# qhasm: f0 = bottom d0 -# asm 1: movl f0=int64#2d -# asm 2: movl f0=%esi -movl 104(%rsp),%esi - -# qhasm: carry? (uint32) g0 += f0 -# asm 1: add g0_stack=stack64#10 -# asm 2: movq g0_stack=104(%rsp) -movq %rdi,104(%rsp) - -# qhasm: g1 = 0 -# asm 1: mov $0,>g1=int64#1 -# asm 2: mov $0,>g1=%rdi -mov $0,%rdi - -# qhasm: f1 = f1_stack -# asm 1: movq f1=int64#3 -# asm 2: movq f1=%rdx -movq 112(%rsp),%rdx - -# qhasm: carry? (uint32) g1 += f1 + carry -# asm 1: adc g1_stack=stack64#11 -# asm 2: movq g1_stack=112(%rsp) -movq %rdi,112(%rsp) - -# qhasm: g2 = 0 -# asm 1: mov $0,>g2=int64#1 -# asm 2: mov $0,>g2=%rdi -mov $0,%rdi - -# qhasm: f2 = f2_stack -# asm 1: movq f2=int64#4 -# asm 2: movq f2=%rcx -movq 120(%rsp),%rcx - -# qhasm: carry? (uint32) g2 += f2 + carry -# asm 1: adc g2_stack=stack64#12 -# asm 2: movq g2_stack=120(%rsp) -movq %rdi,120(%rsp) - -# qhasm: g3 = 0 -# asm 1: mov $0,>g3=int64#1 -# asm 2: mov $0,>g3=%rdi -mov $0,%rdi - -# qhasm: f3 = f3_stack -# asm 1: movq f3=int64#5 -# asm 2: movq f3=%r8 -movq 128(%rsp),%r8 - -# qhasm: carry? (uint32) g3 += f3 + carry -# asm 1: adc g3_stack=stack64#13 -# asm 2: movq g3_stack=128(%rsp) -movq %rdi,128(%rsp) - -# qhasm: f = 0xfffffffc -# asm 1: mov $0xfffffffc,>f=int64#1 -# asm 2: mov $0xfffffffc,>f=%rdi -mov $0xfffffffc,%rdi - -# qhasm: f4 = f4_stack -# asm 1: movq f4=int64#6 -# asm 2: movq f4=%r9 -movq 136(%rsp),%r9 - -# qhasm: carry? (uint32) f += f4 + carry -# asm 1: adc >= 16 -# asm 1: sar $16,notf=int64#6 -# asm 2: mov notf=%r9 -mov %rdi,%r9 - -# qhasm: (uint32) notf ^= 0xffffffff -# asm 1: xor $0xffffffff,g0=int64#7 -# asm 2: movq g0=%rax -movq 104(%rsp),%rax - -# qhasm: g0 &= notf -# asm 1: and g1=int64#7 -# asm 2: movq g1=%rax -movq 112(%rsp),%rax - -# qhasm: g1 &= notf -# asm 1: and g2=int64#7 -# asm 2: movq g2=%rax -movq 120(%rsp),%rax - -# qhasm: g2 &= notf -# asm 1: and g3=int64#1 -# asm 2: movq g3=%rdi -movq 128(%rsp),%rdi - -# qhasm: g3 &= notf -# asm 1: and out=int64#1 -# asm 2: movq out=%rdi -movq 88(%rsp),%rdi - -# qhasm: k = k_stack -# asm 1: movq k=int64#6 -# asm 2: movq k=%r9 -movq 96(%rsp),%r9 - -# qhasm: carry? (uint32) f0 += *(uint32 *) (k + 16) -# asm 1: addl 16(r11_caller=int64#9 -# asm 2: movq r11_caller=%r11 -movq 32(%rsp),%r11 - -# qhasm: r12_caller = r12_stack -# asm 1: movq r12_caller=int64#10 -# asm 2: movq r12_caller=%r12 -movq 40(%rsp),%r12 - -# qhasm: r13_caller = r13_stack -# asm 1: movq r13_caller=int64#11 -# asm 2: movq r13_caller=%r13 -movq 48(%rsp),%r13 - -# qhasm: r14_caller = r14_stack -# asm 1: movq r14_caller=int64#12 -# asm 2: movq r14_caller=%r14 -movq 56(%rsp),%r14 - -# qhasm: r15_caller = r15_stack -# asm 1: movq r15_caller=int64#13 -# asm 2: movq r15_caller=%r15 -movq 64(%rsp),%r15 - -# qhasm: rbx_caller = rbx_stack -# asm 1: movq rbx_caller=int64#14 -# asm 2: movq rbx_caller=%rbx -movq 72(%rsp),%rbx - -# qhasm: rbp_caller = rbp_stack -# asm 1: movq rbp_caller=int64#15 -# asm 2: movq rbp_caller=%rbp -movq 80(%rsp),%rbp - -# qhasm: leave -add %r11,%rsp -xor %rax,%rax -xor %rdx,%rdx -ret diff --git a/src/libnacl/crypto_onetimeauth/poly1305/amd64/constants.s b/src/libnacl/crypto_onetimeauth/poly1305/amd64/constants.s deleted file mode 100644 index 1bfb0be9..00000000 --- a/src/libnacl/crypto_onetimeauth/poly1305/amd64/constants.s +++ /dev/null @@ -1,85 +0,0 @@ -# version 20080913 -# D. J. Bernstein -# Public domain. - -.data -.section .rodata -.p2align 5 - -.globl _crypto_onetimeauth_poly1305_amd64_constants -.globl crypto_onetimeauth_poly1305_amd64_constants -.globl crypto_onetimeauth_poly1305_amd64_scale -.globl crypto_onetimeauth_poly1305_amd64_two32 -.globl crypto_onetimeauth_poly1305_amd64_two64 -.globl crypto_onetimeauth_poly1305_amd64_two96 -.globl crypto_onetimeauth_poly1305_amd64_alpha32 -.globl crypto_onetimeauth_poly1305_amd64_alpha64 -.globl crypto_onetimeauth_poly1305_amd64_alpha96 -.globl crypto_onetimeauth_poly1305_amd64_alpha130 -.globl crypto_onetimeauth_poly1305_amd64_doffset0 -.globl crypto_onetimeauth_poly1305_amd64_doffset1 -.globl crypto_onetimeauth_poly1305_amd64_doffset2 -.globl crypto_onetimeauth_poly1305_amd64_doffset3 -.globl crypto_onetimeauth_poly1305_amd64_doffset3minustwo128 -.globl crypto_onetimeauth_poly1305_amd64_hoffset0 -.globl crypto_onetimeauth_poly1305_amd64_hoffset1 -.globl crypto_onetimeauth_poly1305_amd64_hoffset2 -.globl crypto_onetimeauth_poly1305_amd64_hoffset3 -.globl crypto_onetimeauth_poly1305_amd64_rounding - -_crypto_onetimeauth_poly1305_amd64_constants: -crypto_onetimeauth_poly1305_amd64_constants: -crypto_onetimeauth_poly1305_amd64_scale: -.long 0x0,0x37f40000 - -crypto_onetimeauth_poly1305_amd64_two32: -.long 0x0,0x41f00000 - -crypto_onetimeauth_poly1305_amd64_two64: -.long 0x0,0x43f00000 - -crypto_onetimeauth_poly1305_amd64_two96: -.long 0x0,0x45f00000 - -crypto_onetimeauth_poly1305_amd64_alpha32: -.long 0x0,0x45e80000 - -crypto_onetimeauth_poly1305_amd64_alpha64: -.long 0x0,0x47e80000 - -crypto_onetimeauth_poly1305_amd64_alpha96: -.long 0x0,0x49e80000 - -crypto_onetimeauth_poly1305_amd64_alpha130: -.long 0x0,0x4c080000 - -crypto_onetimeauth_poly1305_amd64_doffset0: -.long 0x0,0x43300000 - -crypto_onetimeauth_poly1305_amd64_doffset1: -.long 0x0,0x45300000 - -crypto_onetimeauth_poly1305_amd64_doffset2: -.long 0x0,0x47300000 - -crypto_onetimeauth_poly1305_amd64_doffset3: -.long 0x0,0x49300000 - -crypto_onetimeauth_poly1305_amd64_doffset3minustwo128: -.long 0x0,0x492ffffe - -crypto_onetimeauth_poly1305_amd64_hoffset0: -.long 0xfffffffb,0x43300001 - -crypto_onetimeauth_poly1305_amd64_hoffset1: -.long 0xfffffffe,0x45300001 - -crypto_onetimeauth_poly1305_amd64_hoffset2: -.long 0xfffffffe,0x47300001 - -crypto_onetimeauth_poly1305_amd64_hoffset3: -.long 0xfffffffe,0x49300003 - -crypto_onetimeauth_poly1305_amd64_rounding: -.byte 0x7f -.byte 0x13 diff --git a/src/libnacl/crypto_onetimeauth/poly1305/amd64/verify.c b/src/libnacl/crypto_onetimeauth/poly1305/amd64/verify.c deleted file mode 100644 index c7e063f1..00000000 --- a/src/libnacl/crypto_onetimeauth/poly1305/amd64/verify.c +++ /dev/null @@ -1,9 +0,0 @@ -#include "crypto_verify_16.h" -#include "crypto_onetimeauth.h" - -int crypto_onetimeauth_verify(const unsigned char *h,const unsigned char *in,unsigned long long inlen,const unsigned char *k) -{ - unsigned char correct[16]; - crypto_onetimeauth(correct,in,inlen,k); - return crypto_verify_16(h,correct); -} diff --git a/src/libnacl/crypto_onetimeauth/poly1305/checksum b/src/libnacl/crypto_onetimeauth/poly1305/checksum deleted file mode 100644 index a713ea40..00000000 --- a/src/libnacl/crypto_onetimeauth/poly1305/checksum +++ /dev/null @@ -1 +0,0 @@ -e836d5ca58cf673fca2b4910f23f3990 diff --git a/src/libnacl/crypto_onetimeauth/poly1305/ref/api.h b/src/libnacl/crypto_onetimeauth/poly1305/ref/api.h deleted file mode 100644 index acc133ed..00000000 --- a/src/libnacl/crypto_onetimeauth/poly1305/ref/api.h +++ /dev/null @@ -1,2 +0,0 @@ -#define CRYPTO_BYTES 16 -#define CRYPTO_KEYBYTES 32 diff --git a/src/libnacl/crypto_onetimeauth/poly1305/ref/auth.c b/src/libnacl/crypto_onetimeauth/poly1305/ref/auth.c deleted file mode 100644 index 06cf115d..00000000 --- a/src/libnacl/crypto_onetimeauth/poly1305/ref/auth.c +++ /dev/null @@ -1,104 +0,0 @@ -/* -20080912 -D. J. Bernstein -Public domain. -*/ - -#include "crypto_onetimeauth.h" - -static void add(unsigned int h[17],const unsigned int c[17]) -{ - unsigned int j; - unsigned int u; - u = 0; - for (j = 0;j < 17;++j) { u += h[j] + c[j]; h[j] = u & 255; u >>= 8; } -} - -static void squeeze(unsigned int h[17]) -{ - unsigned int j; - unsigned int u; - u = 0; - for (j = 0;j < 16;++j) { u += h[j]; h[j] = u & 255; u >>= 8; } - u += h[16]; h[16] = u & 3; - u = 5 * (u >> 2); - for (j = 0;j < 16;++j) { u += h[j]; h[j] = u & 255; u >>= 8; } - u += h[16]; h[16] = u; -} - -static const unsigned int minusp[17] = { - 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 252 -} ; - -static void freeze(unsigned int h[17]) -{ - unsigned int horig[17]; - unsigned int j; - unsigned int negative; - for (j = 0;j < 17;++j) horig[j] = h[j]; - add(h,minusp); - negative = -(h[16] >> 7); - for (j = 0;j < 17;++j) h[j] ^= negative & (horig[j] ^ h[j]); -} - -static void mulmod(unsigned int h[17],const unsigned int r[17]) -{ - unsigned int hr[17]; - unsigned int i; - unsigned int j; - unsigned int u; - - for (i = 0;i < 17;++i) { - u = 0; - for (j = 0;j <= i;++j) u += h[j] * r[i - j]; - for (j = i + 1;j < 17;++j) u += 320 * h[j] * r[i + 17 - j]; - hr[i] = u; - } - for (i = 0;i < 17;++i) h[i] = hr[i]; - squeeze(h); -} - -int crypto_onetimeauth(unsigned char *out,const unsigned char *in,unsigned long long inlen,const unsigned char *k) -{ - unsigned int j; - unsigned int r[17]; - unsigned int h[17]; - unsigned int c[17]; - - r[0] = k[0]; - r[1] = k[1]; - r[2] = k[2]; - r[3] = k[3] & 15; - r[4] = k[4] & 252; - r[5] = k[5]; - r[6] = k[6]; - r[7] = k[7] & 15; - r[8] = k[8] & 252; - r[9] = k[9]; - r[10] = k[10]; - r[11] = k[11] & 15; - r[12] = k[12] & 252; - r[13] = k[13]; - r[14] = k[14]; - r[15] = k[15] & 15; - r[16] = 0; - - for (j = 0;j < 17;++j) h[j] = 0; - - while (inlen > 0) { - for (j = 0;j < 17;++j) c[j] = 0; - for (j = 0;(j < 16) && (j < inlen);++j) c[j] = in[j]; - c[j] = 1; - in += j; inlen -= j; - add(h,c); - mulmod(h,r); - } - - freeze(h); - - for (j = 0;j < 16;++j) c[j] = k[j + 16]; - c[16] = 0; - add(h,c); - for (j = 0;j < 16;++j) out[j] = h[j]; - return 0; -} diff --git a/src/libnacl/crypto_onetimeauth/poly1305/ref/verify.c b/src/libnacl/crypto_onetimeauth/poly1305/ref/verify.c deleted file mode 100644 index c7e063f1..00000000 --- a/src/libnacl/crypto_onetimeauth/poly1305/ref/verify.c +++ /dev/null @@ -1,9 +0,0 @@ -#include "crypto_verify_16.h" -#include "crypto_onetimeauth.h" - -int crypto_onetimeauth_verify(const unsigned char *h,const unsigned char *in,unsigned long long inlen,const unsigned char *k) -{ - unsigned char correct[16]; - crypto_onetimeauth(correct,in,inlen,k); - return crypto_verify_16(h,correct); -} diff --git a/src/libnacl/crypto_onetimeauth/poly1305/selected b/src/libnacl/crypto_onetimeauth/poly1305/selected deleted file mode 100644 index e69de29b..00000000 diff --git a/src/libnacl/crypto_onetimeauth/poly1305/used b/src/libnacl/crypto_onetimeauth/poly1305/used deleted file mode 100644 index e69de29b..00000000 diff --git a/src/libnacl/crypto_onetimeauth/poly1305/x86/api.h b/src/libnacl/crypto_onetimeauth/poly1305/x86/api.h deleted file mode 100644 index acc133ed..00000000 --- a/src/libnacl/crypto_onetimeauth/poly1305/x86/api.h +++ /dev/null @@ -1,2 +0,0 @@ -#define CRYPTO_BYTES 16 -#define CRYPTO_KEYBYTES 32 diff --git a/src/libnacl/crypto_onetimeauth/poly1305/x86/auth.s b/src/libnacl/crypto_onetimeauth/poly1305/x86/auth.s deleted file mode 100644 index acb8c51c..00000000 --- a/src/libnacl/crypto_onetimeauth/poly1305/x86/auth.s +++ /dev/null @@ -1,2779 +0,0 @@ - -# qhasm: stack32 arg_out - -# qhasm: stack32 arg_m - -# qhasm: stack32 arg_l - -# qhasm: stack32 arg_ltop - -# qhasm: stack32 arg_k - -# qhasm: input arg_out - -# qhasm: input arg_m - -# qhasm: input arg_l - -# qhasm: input arg_ltop - -# qhasm: input arg_k - -# qhasm: int32 eax - -# qhasm: int32 ebx - -# qhasm: int32 esi - -# qhasm: int32 edi - -# qhasm: int32 ebp - -# qhasm: caller eax - -# qhasm: caller ebx - -# qhasm: caller esi - -# qhasm: caller edi - -# qhasm: caller ebp - -# qhasm: stack32 eax_stack - -# qhasm: stack32 ebx_stack - -# qhasm: stack32 esi_stack - -# qhasm: stack32 edi_stack - -# qhasm: stack32 ebp_stack - -# qhasm: int32 out - -# qhasm: stack32 out_stack - -# qhasm: int32 k - -# qhasm: stack32 k_stack - -# qhasm: int32 m - -# qhasm: int32 l - -# qhasm: int32 m0 - -# qhasm: int32 m1 - -# qhasm: int32 m2 - -# qhasm: int32 m3 - -# qhasm: float80 a0 - -# qhasm: float80 a1 - -# qhasm: float80 a2 - -# qhasm: float80 a3 - -# qhasm: float80 h0 - -# qhasm: float80 h1 - -# qhasm: float80 h2 - -# qhasm: float80 h3 - -# qhasm: float80 x0 - -# qhasm: float80 x1 - -# qhasm: float80 x2 - -# qhasm: float80 x3 - -# qhasm: float80 y0 - -# qhasm: float80 y1 - -# qhasm: float80 y2 - -# qhasm: float80 y3 - -# qhasm: float80 r0x0 - -# qhasm: float80 r1x0 - -# qhasm: float80 r2x0 - -# qhasm: float80 r3x0 - -# qhasm: float80 r0x1 - -# qhasm: float80 r1x1 - -# qhasm: float80 r2x1 - -# qhasm: float80 sr3x1 - -# qhasm: float80 r0x2 - -# qhasm: float80 r1x2 - -# qhasm: float80 sr2x2 - -# qhasm: float80 sr3x2 - -# qhasm: float80 r0x3 - -# qhasm: float80 sr1x3 - -# qhasm: float80 sr2x3 - -# qhasm: float80 sr3x3 - -# qhasm: stack64 d0 - -# qhasm: stack64 d1 - -# qhasm: stack64 d2 - -# qhasm: stack64 d3 - -# qhasm: stack64 r0 - -# qhasm: stack64 r1 - -# qhasm: stack64 r2 - -# qhasm: stack64 r3 - -# qhasm: stack64 sr1 - -# qhasm: stack64 sr2 - -# qhasm: stack64 sr3 - -# qhasm: enter crypto_onetimeauth_poly1305_x86 stackaligned4096 crypto_onetimeauth_poly1305_x86_constants -.text -.p2align 5 -.globl _crypto_onetimeauth_poly1305_x86 -.globl crypto_onetimeauth_poly1305_x86 -_crypto_onetimeauth_poly1305_x86: -crypto_onetimeauth_poly1305_x86: -mov %esp,%eax -sub $crypto_onetimeauth_poly1305_x86_constants,%eax -and $4095,%eax -add $192,%eax -sub %eax,%esp - -# qhasm: eax_stack = eax -# asm 1: movl eax_stack=stack32#1 -# asm 2: movl eax_stack=0(%esp) -movl %eax,0(%esp) - -# qhasm: ebx_stack = ebx -# asm 1: movl ebx_stack=stack32#2 -# asm 2: movl ebx_stack=4(%esp) -movl %ebx,4(%esp) - -# qhasm: esi_stack = esi -# asm 1: movl esi_stack=stack32#3 -# asm 2: movl esi_stack=8(%esp) -movl %esi,8(%esp) - -# qhasm: edi_stack = edi -# asm 1: movl edi_stack=stack32#4 -# asm 2: movl edi_stack=12(%esp) -movl %edi,12(%esp) - -# qhasm: ebp_stack = ebp -# asm 1: movl ebp_stack=stack32#5 -# asm 2: movl ebp_stack=16(%esp) -movl %ebp,16(%esp) - -# qhasm: round *(uint16 *) &crypto_onetimeauth_poly1305_x86_rounding -fldcw crypto_onetimeauth_poly1305_x86_rounding - -# qhasm: k = arg_k -# asm 1: movl k=int32#3 -# asm 2: movl k=%edx -movl 20(%esp,%eax),%edx - -# qhasm: m0 = *(uint32 *) (k + 0) -# asm 1: movl 0(m0=int32#2 -# asm 2: movl 0(m0=%ecx -movl 0(%edx),%ecx - -# qhasm: m1 = *(uint32 *) (k + 4) -# asm 1: movl 4(m1=int32#4 -# asm 2: movl 4(m1=%ebx -movl 4(%edx),%ebx - -# qhasm: m2 = *(uint32 *) (k + 8) -# asm 1: movl 8(m2=int32#5 -# asm 2: movl 8(m2=%esi -movl 8(%edx),%esi - -# qhasm: m3 = *(uint32 *) (k + 12) -# asm 1: movl 12(m3=int32#6 -# asm 2: movl 12(m3=%edi -movl 12(%edx),%edi - -# qhasm: d0 top = 0x43300000 -# asm 1: movl $0x43300000,>d0=stack64#1 -# asm 2: movl $0x43300000,>d0=100(%esp) -movl $0x43300000,100(%esp) - -# qhasm: d1 top = 0x45300000 -# asm 1: movl $0x45300000,>d1=stack64#2 -# asm 2: movl $0x45300000,>d1=108(%esp) -movl $0x45300000,108(%esp) - -# qhasm: d2 top = 0x47300000 -# asm 1: movl $0x47300000,>d2=stack64#3 -# asm 2: movl $0x47300000,>d2=116(%esp) -movl $0x47300000,116(%esp) - -# qhasm: d3 top = 0x49300000 -# asm 1: movl $0x49300000,>d3=stack64#4 -# asm 2: movl $0x49300000,>d3=124(%esp) -movl $0x49300000,124(%esp) - -# qhasm: m0 &= 0x0fffffff -# asm 1: and $0x0fffffff,r0=stack64#5 -# asm 2: fstpl >r0=128(%esp) -fstpl 128(%esp) -# comment:fpstackfrombottom:r1=stack64#6 -# asm 2: fstl >r1=136(%esp) -fstl 136(%esp) -# comment:fpstackfrombottom:sr1=stack64#7 -# asm 2: fstpl >sr1=144(%esp) -fstpl 144(%esp) -# comment:fpstackfrombottom:r2=stack64#8 -# asm 2: fstl >r2=152(%esp) -fstl 152(%esp) -# comment:fpstackfrombottom:sr2=stack64#9 -# asm 2: fstpl >sr2=160(%esp) -fstpl 160(%esp) -# comment:fpstackfrombottom:r3=stack64#10 -# asm 2: fstl >r3=168(%esp) -fstl 168(%esp) -# comment:fpstackfrombottom:sr3=stack64#11 -# asm 2: fstpl >sr3=176(%esp) -fstpl 176(%esp) -# comment:fpstackfrombottom: - -# qhasm: out = arg_out -# asm 1: movl out=int32#4 -# asm 2: movl out=%ebx -movl 4(%esp,%eax),%ebx - -# qhasm: m = arg_m -# asm 1: movl m=int32#5 -# asm 2: movl m=%esi -movl 8(%esp,%eax),%esi - -# qhasm: l = arg_l -# asm 1: movl l=int32#2 -# asm 2: movl l=%ecx -movl 12(%esp,%eax),%ecx - -# qhasm: h3 = 0 -fldz -# comment:fpstackfrombottom:k_stack=stack32#6 -# asm 2: movl k_stack=20(%esp) -movl %edx,20(%esp) -# comment:fpstackfrombottom:out_stack=stack32#7 -# asm 2: movl out_stack=24(%esp) -movl %ebx,24(%esp) -# comment:fpstackfrombottom:m3=int32#1 -# asm 2: movl 12(m3=%eax -movl 12(%esi),%eax -# comment:fpstackfrombottom:m2=int32#3 -# asm 2: movl 8(m2=%edx -movl 8(%esi),%edx -# comment:fpstackfrombottom:m1=int32#4 -# asm 2: movl 4(m1=%ebx -movl 4(%esi),%ebx -# comment:fpstackfrombottom:m0=int32#6 -# asm 2: movl 0(m0=%edi -movl 0(%esi),%edi -# comment:fpstackfrombottom:m3=int32#1 -# asm 2: movl 12(m3=%eax -movl 12(%esi),%eax -# comment:fpstackfrombottom:m2=int32#3 -# asm 2: movl 8(m2=%edx -movl 8(%esi),%edx -# comment:fpstackfrombottom:m1=int32#4 -# asm 2: movl 4(m1=%ebx -movl 4(%esi),%ebx -# comment:fpstackfrombottom:m0=int32#6 -# asm 2: movl 0(m0=%edi -movl 0(%esi),%edi -# comment:fpstackfrombottom:lastchunk=stack128#1 -# asm 2: movl $0,>lastchunk=64(%esp) -movl $0,64(%esp) -# comment:fpstackfrombottom:destination=int32#6 -# asm 2: leal destination=%edi -leal 64(%esp),%edi -# comment:fpstackfrombottom:m3=int32#1 -# asm 2: movl 12+m3=%eax -movl 12+64(%esp),%eax -# comment:fpstackfrombottom:m2=int32#2 -# asm 2: movl 8+m2=%ecx -movl 8+64(%esp),%ecx -# comment:fpstackfrombottom:m1=int32#3 -# asm 2: movl 4+m1=%edx -movl 4+64(%esp),%edx -# comment:fpstackfrombottom:m0=int32#4 -# asm 2: movl m0=%ebx -movl 64(%esp),%ebx -# comment:fpstackfrombottom:d0=stack64#1 -# asm 2: fstpl >d0=96(%esp) -fstpl 96(%esp) -# comment:fpstackfrombottom:d1=stack64#2 -# asm 2: fstpl >d1=104(%esp) -fstpl 104(%esp) -# comment:fpstackfrombottom:d2=stack64#3 -# asm 2: fstpl >d2=112(%esp) -fstpl 112(%esp) -# comment:fpstackfrombottom:d3=stack64#4 -# asm 2: fstpl >d3=120(%esp) -fstpl 120(%esp) -# comment:fpstackfrombottom: - -# qhasm: int32 f0 - -# qhasm: int32 f1 - -# qhasm: int32 f2 - -# qhasm: int32 f3 - -# qhasm: int32 f4 - -# qhasm: int32 g0 - -# qhasm: int32 g1 - -# qhasm: int32 g2 - -# qhasm: int32 g3 - -# qhasm: int32 f - -# qhasm: int32 notf - -# qhasm: stack32 f1_stack - -# qhasm: stack32 f2_stack - -# qhasm: stack32 f3_stack - -# qhasm: stack32 f4_stack - -# qhasm: stack32 g0_stack - -# qhasm: stack32 g1_stack - -# qhasm: stack32 g2_stack - -# qhasm: stack32 g3_stack - -# qhasm: g0 = top d0 -# asm 1: movl g0=int32#1 -# asm 2: movl g0=%eax -movl 100(%esp),%eax - -# qhasm: g0 &= 63 -# asm 1: and $63,g1=int32#2 -# asm 2: movl g1=%ecx -movl 108(%esp),%ecx - -# qhasm: g1 &= 63 -# asm 1: and $63,g2=int32#3 -# asm 2: movl g2=%edx -movl 116(%esp),%edx - -# qhasm: g2 &= 63 -# asm 1: and $63,g3=int32#4 -# asm 2: movl g3=%ebx -movl 124(%esp),%ebx - -# qhasm: g3 &= 63 -# asm 1: and $63,f1=int32#5 -# asm 2: movl f1=%esi -movl 104(%esp),%esi - -# qhasm: carry? f1 += g0 -# asm 1: addl f1_stack=stack32#8 -# asm 2: movl f1_stack=28(%esp) -movl %esi,28(%esp) - -# qhasm: f2 = bottom d2 -# asm 1: movl f2=int32#1 -# asm 2: movl f2=%eax -movl 112(%esp),%eax - -# qhasm: carry? f2 += g1 + carry -# asm 1: adcl f2_stack=stack32#9 -# asm 2: movl f2_stack=32(%esp) -movl %eax,32(%esp) - -# qhasm: f3 = bottom d3 -# asm 1: movl f3=int32#1 -# asm 2: movl f3=%eax -movl 120(%esp),%eax - -# qhasm: carry? f3 += g2 + carry -# asm 1: adcl f3_stack=stack32#10 -# asm 2: movl f3_stack=36(%esp) -movl %eax,36(%esp) - -# qhasm: f4 = 0 -# asm 1: mov $0,>f4=int32#1 -# asm 2: mov $0,>f4=%eax -mov $0,%eax - -# qhasm: carry? f4 += g3 + carry -# asm 1: adcl f4_stack=stack32#11 -# asm 2: movl f4_stack=40(%esp) -movl %eax,40(%esp) - -# qhasm: g0 = 5 -# asm 1: mov $5,>g0=int32#1 -# asm 2: mov $5,>g0=%eax -mov $5,%eax - -# qhasm: f0 = bottom d0 -# asm 1: movl f0=int32#2 -# asm 2: movl f0=%ecx -movl 96(%esp),%ecx - -# qhasm: carry? g0 += f0 -# asm 1: addl g0_stack=stack32#12 -# asm 2: movl g0_stack=44(%esp) -movl %eax,44(%esp) - -# qhasm: g1 = 0 -# asm 1: mov $0,>g1=int32#1 -# asm 2: mov $0,>g1=%eax -mov $0,%eax - -# qhasm: f1 = f1_stack -# asm 1: movl f1=int32#3 -# asm 2: movl f1=%edx -movl 28(%esp),%edx - -# qhasm: carry? g1 += f1 + carry -# asm 1: adcl g1_stack=stack32#8 -# asm 2: movl g1_stack=28(%esp) -movl %eax,28(%esp) - -# qhasm: g2 = 0 -# asm 1: mov $0,>g2=int32#1 -# asm 2: mov $0,>g2=%eax -mov $0,%eax - -# qhasm: f2 = f2_stack -# asm 1: movl f2=int32#4 -# asm 2: movl f2=%ebx -movl 32(%esp),%ebx - -# qhasm: carry? g2 += f2 + carry -# asm 1: adcl g2_stack=stack32#9 -# asm 2: movl g2_stack=32(%esp) -movl %eax,32(%esp) - -# qhasm: g3 = 0 -# asm 1: mov $0,>g3=int32#1 -# asm 2: mov $0,>g3=%eax -mov $0,%eax - -# qhasm: f3 = f3_stack -# asm 1: movl f3=int32#5 -# asm 2: movl f3=%esi -movl 36(%esp),%esi - -# qhasm: carry? g3 += f3 + carry -# asm 1: adcl g3_stack=stack32#10 -# asm 2: movl g3_stack=36(%esp) -movl %eax,36(%esp) - -# qhasm: f = 0xfffffffc -# asm 1: mov $0xfffffffc,>f=int32#1 -# asm 2: mov $0xfffffffc,>f=%eax -mov $0xfffffffc,%eax - -# qhasm: f4 = f4_stack -# asm 1: movl f4=int32#6 -# asm 2: movl f4=%edi -movl 40(%esp),%edi - -# qhasm: carry? f += f4 + carry -# asm 1: adcl >= 16 -# asm 1: sar $16,notf=int32#6 -# asm 2: mov notf=%edi -mov %eax,%edi - -# qhasm: notf ^= 0xffffffff -# asm 1: xor $0xffffffff,g0=int32#7 -# asm 2: movl g0=%ebp -movl 44(%esp),%ebp - -# qhasm: g0 &= notf -# asm 1: andl g1=int32#7 -# asm 2: movl g1=%ebp -movl 28(%esp),%ebp - -# qhasm: g1 &= notf -# asm 1: andl g2=int32#7 -# asm 2: movl g2=%ebp -movl 32(%esp),%ebp - -# qhasm: g2 &= notf -# asm 1: andl g3=int32#1 -# asm 2: movl g3=%eax -movl 36(%esp),%eax - -# qhasm: g3 &= notf -# asm 1: andl k=int32#1 -# asm 2: movl k=%eax -movl 20(%esp),%eax - -# qhasm: carry? f0 += *(uint32 *) (k + 16) -# asm 1: addl 16(out=int32#1 -# asm 2: movl out=%eax -movl 24(%esp),%eax - -# qhasm: *(uint32 *) (out + 0) = f0 -# asm 1: movl eax=int32#1 -# asm 2: movl eax=%eax -movl 0(%esp),%eax - -# qhasm: ebx = ebx_stack -# asm 1: movl ebx=int32#4 -# asm 2: movl ebx=%ebx -movl 4(%esp),%ebx - -# qhasm: esi = esi_stack -# asm 1: movl esi=int32#5 -# asm 2: movl esi=%esi -movl 8(%esp),%esi - -# qhasm: edi = edi_stack -# asm 1: movl edi=int32#6 -# asm 2: movl edi=%edi -movl 12(%esp),%edi - -# qhasm: ebp = ebp_stack -# asm 1: movl ebp=int32#7 -# asm 2: movl ebp=%ebp -movl 16(%esp),%ebp - -# qhasm: leave -add %eax,%esp -xor %eax,%eax -ret diff --git a/src/libnacl/crypto_onetimeauth/poly1305/x86/constants.s b/src/libnacl/crypto_onetimeauth/poly1305/x86/constants.s deleted file mode 100644 index ab2456c3..00000000 --- a/src/libnacl/crypto_onetimeauth/poly1305/x86/constants.s +++ /dev/null @@ -1,85 +0,0 @@ -# version 20080912 -# D. J. Bernstein -# Public domain. - -.data -.section .rodata -.p2align 5 - -.globl _crypto_onetimeauth_poly1305_x86_constants -.globl crypto_onetimeauth_poly1305_x86_constants -.globl crypto_onetimeauth_poly1305_x86_scale -.globl crypto_onetimeauth_poly1305_x86_two32 -.globl crypto_onetimeauth_poly1305_x86_two64 -.globl crypto_onetimeauth_poly1305_x86_two96 -.globl crypto_onetimeauth_poly1305_x86_alpha32 -.globl crypto_onetimeauth_poly1305_x86_alpha64 -.globl crypto_onetimeauth_poly1305_x86_alpha96 -.globl crypto_onetimeauth_poly1305_x86_alpha130 -.globl crypto_onetimeauth_poly1305_x86_doffset0 -.globl crypto_onetimeauth_poly1305_x86_doffset1 -.globl crypto_onetimeauth_poly1305_x86_doffset2 -.globl crypto_onetimeauth_poly1305_x86_doffset3 -.globl crypto_onetimeauth_poly1305_x86_doffset3minustwo128 -.globl crypto_onetimeauth_poly1305_x86_hoffset0 -.globl crypto_onetimeauth_poly1305_x86_hoffset1 -.globl crypto_onetimeauth_poly1305_x86_hoffset2 -.globl crypto_onetimeauth_poly1305_x86_hoffset3 -.globl crypto_onetimeauth_poly1305_x86_rounding - -_crypto_onetimeauth_poly1305_x86_constants: -crypto_onetimeauth_poly1305_x86_constants: -crypto_onetimeauth_poly1305_x86_scale: -.long 0x0,0x37f40000 - -crypto_onetimeauth_poly1305_x86_two32: -.long 0x0,0x41f00000 - -crypto_onetimeauth_poly1305_x86_two64: -.long 0x0,0x43f00000 - -crypto_onetimeauth_poly1305_x86_two96: -.long 0x0,0x45f00000 - -crypto_onetimeauth_poly1305_x86_alpha32: -.long 0x0,0x45e80000 - -crypto_onetimeauth_poly1305_x86_alpha64: -.long 0x0,0x47e80000 - -crypto_onetimeauth_poly1305_x86_alpha96: -.long 0x0,0x49e80000 - -crypto_onetimeauth_poly1305_x86_alpha130: -.long 0x0,0x4c080000 - -crypto_onetimeauth_poly1305_x86_doffset0: -.long 0x0,0x43300000 - -crypto_onetimeauth_poly1305_x86_doffset1: -.long 0x0,0x45300000 - -crypto_onetimeauth_poly1305_x86_doffset2: -.long 0x0,0x47300000 - -crypto_onetimeauth_poly1305_x86_doffset3: -.long 0x0,0x49300000 - -crypto_onetimeauth_poly1305_x86_doffset3minustwo128: -.long 0x0,0x492ffffe - -crypto_onetimeauth_poly1305_x86_hoffset0: -.long 0xfffffffb,0x43300001 - -crypto_onetimeauth_poly1305_x86_hoffset1: -.long 0xfffffffe,0x45300001 - -crypto_onetimeauth_poly1305_x86_hoffset2: -.long 0xfffffffe,0x47300001 - -crypto_onetimeauth_poly1305_x86_hoffset3: -.long 0xfffffffe,0x49300003 - -crypto_onetimeauth_poly1305_x86_rounding: -.byte 0x7f -.byte 0x13 diff --git a/src/libnacl/crypto_onetimeauth/poly1305/x86/verify.c b/src/libnacl/crypto_onetimeauth/poly1305/x86/verify.c deleted file mode 100644 index c7e063f1..00000000 --- a/src/libnacl/crypto_onetimeauth/poly1305/x86/verify.c +++ /dev/null @@ -1,9 +0,0 @@ -#include "crypto_verify_16.h" -#include "crypto_onetimeauth.h" - -int crypto_onetimeauth_verify(const unsigned char *h,const unsigned char *in,unsigned long long inlen,const unsigned char *k) -{ - unsigned char correct[16]; - crypto_onetimeauth(correct,in,inlen,k); - return crypto_verify_16(h,correct); -} diff --git a/src/libnacl/crypto_onetimeauth/try.c b/src/libnacl/crypto_onetimeauth/try.c deleted file mode 100644 index 185d5c7e..00000000 --- a/src/libnacl/crypto_onetimeauth/try.c +++ /dev/null @@ -1,121 +0,0 @@ -/* - * crypto_onetimeauth/try.c version 20090118 - * D. J. Bernstein - * Public domain. - */ - -#include -#include "crypto_hash_sha256.h" -#include "crypto_onetimeauth.h" -#include "windows/windows-quirks.h" - -extern unsigned char *alignedcalloc(unsigned long long); - -const char *primitiveimplementation = crypto_onetimeauth_IMPLEMENTATION; - -#define MAXTEST_BYTES 10000 -#define CHECKSUM_BYTES 4096 -#define TUNE_BYTES 1536 - -static unsigned char *h; -static unsigned char *m; -static unsigned char *k; -static unsigned char *h2; -static unsigned char *m2; -static unsigned char *k2; - -void preallocate(void) -{ -} - -void allocate(void) -{ - h = alignedcalloc(crypto_onetimeauth_BYTES); - m = alignedcalloc(MAXTEST_BYTES); - k = alignedcalloc(crypto_onetimeauth_KEYBYTES); - h2 = alignedcalloc(crypto_onetimeauth_BYTES); - m2 = alignedcalloc(MAXTEST_BYTES + crypto_onetimeauth_BYTES); - k2 = alignedcalloc(crypto_onetimeauth_KEYBYTES + crypto_onetimeauth_BYTES); -} - -void predoit(void) -{ -} - -void doit(void) -{ - crypto_onetimeauth(h,m,TUNE_BYTES,k); - crypto_onetimeauth_verify(h,m,TUNE_BYTES,k); -} - -char checksum[crypto_onetimeauth_BYTES * 2 + 1]; - -const char *checksum_compute(void) -{ - long long i; - long long j; - - for (i = 0;i < CHECKSUM_BYTES;++i) { - long long mlen = i; - long long klen = crypto_onetimeauth_KEYBYTES; - long long hlen = crypto_onetimeauth_BYTES; - - for (j = -16;j < 0;++j) h[j] = random(); - for (j = -16;j < 0;++j) k[j] = random(); - for (j = -16;j < 0;++j) m[j] = random(); - for (j = hlen;j < hlen + 16;++j) h[j] = random(); - for (j = klen;j < klen + 16;++j) k[j] = random(); - for (j = mlen;j < mlen + 16;++j) m[j] = random(); - for (j = -16;j < hlen + 16;++j) h2[j] = h[j]; - for (j = -16;j < klen + 16;++j) k2[j] = k[j]; - for (j = -16;j < mlen + 16;++j) m2[j] = m[j]; - - if (crypto_onetimeauth(h,m,mlen,k) != 0) return "crypto_onetimeauth returns nonzero"; - - for (j = -16;j < klen + 16;++j) if (k[j] != k2[j]) return "crypto_onetimeauth overwrites k"; - for (j = -16;j < mlen + 16;++j) if (m[j] != m2[j]) return "crypto_onetimeauth overwrites m"; - for (j = -16;j < 0;++j) if (h[j] != h2[j]) return "crypto_onetimeauth writes before output"; - for (j = hlen;j < hlen + 16;++j) if (h[j] != h2[j]) return "crypto_onetimeauth writes after output"; - - for (j = -16;j < 0;++j) h[j] = random(); - for (j = -16;j < 0;++j) k[j] = random(); - for (j = -16;j < 0;++j) m[j] = random(); - for (j = hlen;j < hlen + 16;++j) h[j] = random(); - for (j = klen;j < klen + 16;++j) k[j] = random(); - for (j = mlen;j < mlen + 16;++j) m[j] = random(); - for (j = -16;j < hlen + 16;++j) h2[j] = h[j]; - for (j = -16;j < klen + 16;++j) k2[j] = k[j]; - for (j = -16;j < mlen + 16;++j) m2[j] = m[j]; - - if (crypto_onetimeauth(m2,m2,mlen,k) != 0) return "crypto_onetimeauth returns nonzero"; - for (j = 0;j < hlen;++j) if (m2[j] != h[j]) return "crypto_onetimeauth does not handle m overlap"; - for (j = 0;j < hlen;++j) m2[j] = m[j]; - if (crypto_onetimeauth(k2,m2,mlen,k2) != 0) return "crypto_onetimeauth returns nonzero"; - for (j = 0;j < hlen;++j) if (k2[j] != h[j]) return "crypto_onetimeauth does not handle k overlap"; - for (j = 0;j < hlen;++j) k2[j] = k[j]; - - if (crypto_onetimeauth_verify(h,m,mlen,k) != 0) return "crypto_onetimeauth_verify returns nonzero"; - - for (j = -16;j < hlen + 16;++j) if (h[j] != h2[j]) return "crypto_onetimeauth overwrites h"; - for (j = -16;j < klen + 16;++j) if (k[j] != k2[j]) return "crypto_onetimeauth overwrites k"; - for (j = -16;j < mlen + 16;++j) if (m[j] != m2[j]) return "crypto_onetimeauth overwrites m"; - - crypto_hash_sha256(h2,h,hlen); - for (j = 0;j < klen;++j) k[j] ^= h2[j % 32]; - if (crypto_onetimeauth(h,m,mlen,k) != 0) return "crypto_onetimeauth returns nonzero"; - if (crypto_onetimeauth_verify(h,m,mlen,k) != 0) return "crypto_onetimeauth_verify returns nonzero"; - - crypto_hash_sha256(h2,h,hlen); - for (j = 0;j < mlen;++j) m[j] ^= h2[j % 32]; - m[mlen] = h2[0]; - } - if (crypto_onetimeauth(h,m,CHECKSUM_BYTES,k) != 0) return "crypto_onetimeauth returns nonzero"; - if (crypto_onetimeauth_verify(h,m,CHECKSUM_BYTES,k) != 0) return "crypto_onetimeauth_verify returns nonzero"; - - for (i = 0;i < crypto_onetimeauth_BYTES;++i) { - checksum[2 * i] = "0123456789abcdef"[15 & (h[i] >> 4)]; - checksum[2 * i + 1] = "0123456789abcdef"[15 & h[i]]; - } - checksum[2 * i] = 0; - return 0; -} diff --git a/src/libnacl/crypto_scalarmult/curve25519/checksum b/src/libnacl/crypto_scalarmult/curve25519/checksum deleted file mode 100644 index ce2d395b..00000000 --- a/src/libnacl/crypto_scalarmult/curve25519/checksum +++ /dev/null @@ -1 +0,0 @@ -dacdae4a0f12353dfc66757f2fd1fff538fe6616115dace9afb8016a55be2a52 diff --git a/src/libnacl/crypto_scalarmult/curve25519/donna_c64/api.h b/src/libnacl/crypto_scalarmult/curve25519/donna_c64/api.h deleted file mode 100644 index 60339596..00000000 --- a/src/libnacl/crypto_scalarmult/curve25519/donna_c64/api.h +++ /dev/null @@ -1,2 +0,0 @@ -#define CRYPTO_BYTES 32 -#define CRYPTO_SCALARBYTES 32 diff --git a/src/libnacl/crypto_scalarmult/curve25519/donna_c64/base.c b/src/libnacl/crypto_scalarmult/curve25519/donna_c64/base.c deleted file mode 100644 index f33419e8..00000000 --- a/src/libnacl/crypto_scalarmult/curve25519/donna_c64/base.c +++ /dev/null @@ -1,8 +0,0 @@ -#include "crypto_scalarmult.h" - -static const unsigned char basepoint[32] = {9}; - -int crypto_scalarmult_base(unsigned char *q,const unsigned char *n) -{ - return crypto_scalarmult(q, n, basepoint); -} diff --git a/src/libnacl/crypto_scalarmult/curve25519/donna_c64/implementors b/src/libnacl/crypto_scalarmult/curve25519/donna_c64/implementors deleted file mode 100644 index 0ce43280..00000000 --- a/src/libnacl/crypto_scalarmult/curve25519/donna_c64/implementors +++ /dev/null @@ -1 +0,0 @@ -Adam Langley (Google) diff --git a/src/libnacl/crypto_scalarmult/curve25519/donna_c64/smult.c b/src/libnacl/crypto_scalarmult/curve25519/donna_c64/smult.c deleted file mode 100644 index 6d26956b..00000000 --- a/src/libnacl/crypto_scalarmult/curve25519/donna_c64/smult.c +++ /dev/null @@ -1,477 +0,0 @@ -/* Copyright 2008, Google Inc. - * All rights reserved. - * - * Code released into the public domain. - * - * curve25519-donna: Curve25519 elliptic curve, public key function - * - * http://code.google.com/p/curve25519-donna/ - * - * Adam Langley - * - * Derived from public domain C code by Daniel J. Bernstein - * - * More information about curve25519 can be found here - * http://cr.yp.to/ecdh.html - * - * djb's sample implementation of curve25519 is written in a special assembly - * language called qhasm and uses the floating point registers. - * - * This is, almost, a clean room reimplementation from the curve25519 paper. It - * uses many of the tricks described therein. Only the crecip function is taken - * from the sample implementation. - */ - -#include -#include -#include "crypto_scalarmult.h" - -typedef uint8_t u8; -typedef uint64_t felem; -// This is a special gcc mode for 128-bit integers. It's implemented on 64-bit -// platforms only as far as I know. -typedef unsigned uint128_t __attribute__((mode(TI))); - -/* Sum two numbers: output += in */ -static void fsum(felem *output, const felem *in) { - unsigned i; - for (i = 0; i < 5; ++i) output[i] += in[i]; -} - -/* Find the difference of two numbers: output = in - output - * (note the order of the arguments!) - */ -static void fdifference_backwards(felem *ioutput, const felem *iin) { - static const int64_t twotothe51 = (1l << 51); - const int64_t *in = (const int64_t *) iin; - int64_t *out = (int64_t *) ioutput; - - out[0] = in[0] - out[0]; - out[1] = in[1] - out[1]; - out[2] = in[2] - out[2]; - out[3] = in[3] - out[3]; - out[4] = in[4] - out[4]; - - // An arithmetic shift right of 63 places turns a positive number to 0 and a - // negative number to all 1's. This gives us a bitmask that lets us avoid - // side-channel prone branches. - int64_t t; - -#define NEGCHAIN(a,b) \ - t = out[a] >> 63; \ - out[a] += twotothe51 & t; \ - out[b] -= 1 & t; - -#define NEGCHAIN19(a,b) \ - t = out[a] >> 63; \ - out[a] += twotothe51 & t; \ - out[b] -= 19 & t; - - NEGCHAIN(0, 1); - NEGCHAIN(1, 2); - NEGCHAIN(2, 3); - NEGCHAIN(3, 4); - NEGCHAIN19(4, 0); - NEGCHAIN(0, 1); - NEGCHAIN(1, 2); - NEGCHAIN(2, 3); - NEGCHAIN(3, 4); -} - -/* Multiply a number by a scalar: output = in * scalar */ -static void fscalar_product(felem *output, const felem *in, const felem scalar) { - uint128_t a; - - a = ((uint128_t) in[0]) * scalar; - output[0] = a & 0x7ffffffffffff; - - a = ((uint128_t) in[1]) * scalar + (a >> 51); - output[1] = a & 0x7ffffffffffff; - - a = ((uint128_t) in[2]) * scalar + (a >> 51); - output[2] = a & 0x7ffffffffffff; - - a = ((uint128_t) in[3]) * scalar + (a >> 51); - output[3] = a & 0x7ffffffffffff; - - a = ((uint128_t) in[4]) * scalar + (a >> 51); - output[4] = a & 0x7ffffffffffff; - - output[0] += (a >> 51) * 19; -} - -/* Multiply two numbers: output = in2 * in - * - * output must be distinct to both inputs. The inputs are reduced coefficient - * form, the output is not. - */ -static void fmul(felem *output, const felem *in2, const felem *in) { - uint128_t t[9]; - - t[0] = ((uint128_t) in[0]) * in2[0]; - t[1] = ((uint128_t) in[0]) * in2[1] + - ((uint128_t) in[1]) * in2[0]; - t[2] = ((uint128_t) in[0]) * in2[2] + - ((uint128_t) in[2]) * in2[0] + - ((uint128_t) in[1]) * in2[1]; - t[3] = ((uint128_t) in[0]) * in2[3] + - ((uint128_t) in[3]) * in2[0] + - ((uint128_t) in[1]) * in2[2] + - ((uint128_t) in[2]) * in2[1]; - t[4] = ((uint128_t) in[0]) * in2[4] + - ((uint128_t) in[4]) * in2[0] + - ((uint128_t) in[3]) * in2[1] + - ((uint128_t) in[1]) * in2[3] + - ((uint128_t) in[2]) * in2[2]; - t[5] = ((uint128_t) in[4]) * in2[1] + - ((uint128_t) in[1]) * in2[4] + - ((uint128_t) in[2]) * in2[3] + - ((uint128_t) in[3]) * in2[2]; - t[6] = ((uint128_t) in[4]) * in2[2] + - ((uint128_t) in[2]) * in2[4] + - ((uint128_t) in[3]) * in2[3]; - t[7] = ((uint128_t) in[3]) * in2[4] + - ((uint128_t) in[4]) * in2[3]; - t[8] = ((uint128_t) in[4]) * in2[4]; - - t[0] += t[5] * 19; - t[1] += t[6] * 19; - t[2] += t[7] * 19; - t[3] += t[8] * 19; - - t[1] += t[0] >> 51; - t[0] &= 0x7ffffffffffff; - t[2] += t[1] >> 51; - t[1] &= 0x7ffffffffffff; - t[3] += t[2] >> 51; - t[2] &= 0x7ffffffffffff; - t[4] += t[3] >> 51; - t[3] &= 0x7ffffffffffff; - t[0] += 19 * (t[4] >> 51); - t[4] &= 0x7ffffffffffff; - t[1] += t[0] >> 51; - t[0] &= 0x7ffffffffffff; - t[2] += t[1] >> 51; - t[1] &= 0x7ffffffffffff; - - output[0] = t[0]; - output[1] = t[1]; - output[2] = t[2]; - output[3] = t[3]; - output[4] = t[4]; -} - -static void -fsquare(felem *output, const felem *in) { - uint128_t t[9]; - - t[0] = ((uint128_t) in[0]) * in[0]; - t[1] = ((uint128_t) in[0]) * in[1] * 2; - t[2] = ((uint128_t) in[0]) * in[2] * 2 + - ((uint128_t) in[1]) * in[1]; - t[3] = ((uint128_t) in[0]) * in[3] * 2 + - ((uint128_t) in[1]) * in[2] * 2; - t[4] = ((uint128_t) in[0]) * in[4] * 2 + - ((uint128_t) in[3]) * in[1] * 2 + - ((uint128_t) in[2]) * in[2]; - t[5] = ((uint128_t) in[4]) * in[1] * 2 + - ((uint128_t) in[2]) * in[3] * 2; - t[6] = ((uint128_t) in[4]) * in[2] * 2 + - ((uint128_t) in[3]) * in[3]; - t[7] = ((uint128_t) in[3]) * in[4] * 2; - t[8] = ((uint128_t) in[4]) * in[4]; - - t[0] += t[5] * 19; - t[1] += t[6] * 19; - t[2] += t[7] * 19; - t[3] += t[8] * 19; - - t[1] += t[0] >> 51; - t[0] &= 0x7ffffffffffff; - t[2] += t[1] >> 51; - t[1] &= 0x7ffffffffffff; - t[3] += t[2] >> 51; - t[2] &= 0x7ffffffffffff; - t[4] += t[3] >> 51; - t[3] &= 0x7ffffffffffff; - t[0] += 19 * (t[4] >> 51); - t[4] &= 0x7ffffffffffff; - t[1] += t[0] >> 51; - t[0] &= 0x7ffffffffffff; - - output[0] = t[0]; - output[1] = t[1]; - output[2] = t[2]; - output[3] = t[3]; - output[4] = t[4]; -} - -/* Take a little-endian, 32-byte number and expand it into polynomial form */ -static void -fexpand(felem *output, const u8 *in) { - output[0] = *((const uint64_t *)(in)) & 0x7ffffffffffff; - output[1] = (*((const uint64_t *)(in+6)) >> 3) & 0x7ffffffffffff; - output[2] = (*((const uint64_t *)(in+12)) >> 6) & 0x7ffffffffffff; - output[3] = (*((const uint64_t *)(in+19)) >> 1) & 0x7ffffffffffff; - output[4] = (*((const uint64_t *)(in+25)) >> 4) & 0x7ffffffffffff; -} - -/* Take a fully reduced polynomial form number and contract it into a - * little-endian, 32-byte array - */ -static void -fcontract(u8 *output, const felem *input) { - uint128_t t[5]; - - t[0] = input[0]; - t[1] = input[1]; - t[2] = input[2]; - t[3] = input[3]; - t[4] = input[4]; - - t[1] += t[0] >> 51; t[0] &= 0x7ffffffffffff; - t[2] += t[1] >> 51; t[1] &= 0x7ffffffffffff; - t[3] += t[2] >> 51; t[2] &= 0x7ffffffffffff; - t[4] += t[3] >> 51; t[3] &= 0x7ffffffffffff; - t[0] += 19 * (t[4] >> 51); t[4] &= 0x7ffffffffffff; - - t[1] += t[0] >> 51; t[0] &= 0x7ffffffffffff; - t[2] += t[1] >> 51; t[1] &= 0x7ffffffffffff; - t[3] += t[2] >> 51; t[2] &= 0x7ffffffffffff; - t[4] += t[3] >> 51; t[3] &= 0x7ffffffffffff; - t[0] += 19 * (t[4] >> 51); t[4] &= 0x7ffffffffffff; - - /* now t is between 0 and 2^255-1, properly carried. */ - /* case 1: between 0 and 2^255-20. case 2: between 2^255-19 and 2^255-1. */ - - t[0] += 19; - - t[1] += t[0] >> 51; t[0] &= 0x7ffffffffffff; - t[2] += t[1] >> 51; t[1] &= 0x7ffffffffffff; - t[3] += t[2] >> 51; t[2] &= 0x7ffffffffffff; - t[4] += t[3] >> 51; t[3] &= 0x7ffffffffffff; - t[0] += 19 * (t[4] >> 51); t[4] &= 0x7ffffffffffff; - - /* now between 19 and 2^255-1 in both cases, and offset by 19. */ - - t[0] += 0x8000000000000 - 19; - t[1] += 0x8000000000000 - 1; - t[2] += 0x8000000000000 - 1; - t[3] += 0x8000000000000 - 1; - t[4] += 0x8000000000000 - 1; - - /* now between 2^255 and 2^256-20, and offset by 2^255. */ - - t[1] += t[0] >> 51; t[0] &= 0x7ffffffffffff; - t[2] += t[1] >> 51; t[1] &= 0x7ffffffffffff; - t[3] += t[2] >> 51; t[2] &= 0x7ffffffffffff; - t[4] += t[3] >> 51; t[3] &= 0x7ffffffffffff; - t[4] &= 0x7ffffffffffff; - - *((uint64_t *)(output)) = t[0] | (t[1] << 51); - *((uint64_t *)(output+8)) = (t[1] >> 13) | (t[2] << 38); - *((uint64_t *)(output+16)) = (t[2] >> 26) | (t[3] << 25); - *((uint64_t *)(output+24)) = (t[3] >> 39) | (t[4] << 12); -} - -/* Input: Q, Q', Q-Q' - * Output: 2Q, Q+Q' - * - * x2 z3: long form - * x3 z3: long form - * x z: short form, destroyed - * xprime zprime: short form, destroyed - * qmqp: short form, preserved - */ -static void -fmonty(felem *x2, felem *z2, /* output 2Q */ - felem *x3, felem *z3, /* output Q + Q' */ - felem *x, felem *z, /* input Q */ - felem *xprime, felem *zprime, /* input Q' */ - const felem *qmqp /* input Q - Q' */) { - felem origx[5], origxprime[5], zzz[5], xx[5], zz[5], xxprime[5], - zzprime[5], zzzprime[5]; - - memcpy(origx, x, 5 * sizeof(felem)); - fsum(x, z); - fdifference_backwards(z, origx); // does x - z - - memcpy(origxprime, xprime, sizeof(felem) * 5); - fsum(xprime, zprime); - fdifference_backwards(zprime, origxprime); - fmul(xxprime, xprime, z); - fmul(zzprime, x, zprime); - memcpy(origxprime, xxprime, sizeof(felem) * 5); - fsum(xxprime, zzprime); - fdifference_backwards(zzprime, origxprime); - fsquare(x3, xxprime); - fsquare(zzzprime, zzprime); - fmul(z3, zzzprime, qmqp); - - fsquare(xx, x); - fsquare(zz, z); - fmul(x2, xx, zz); - fdifference_backwards(zz, xx); // does zz = xx - zz - fscalar_product(zzz, zz, 121665); - fsum(zzz, xx); - fmul(z2, zz, zzz); -} - -// ----------------------------------------------------------------------------- -// Maybe swap the contents of two felem arrays (@a and @b), each @len elements -// long. Perform the swap iff @swap is non-zero. -// -// This function performs the swap without leaking any side-channel -// information. -// ----------------------------------------------------------------------------- -static void -swap_conditional(felem *a, felem *b, unsigned len, felem iswap) { - unsigned i; - const felem swap = -iswap; - - for (i = 0; i < len; ++i) { - const felem x = swap & (a[i] ^ b[i]); - a[i] ^= x; - b[i] ^= x; - } -} - -/* Calculates nQ where Q is the x-coordinate of a point on the curve - * - * resultx/resultz: the x coordinate of the resulting curve point (short form) - * n: a little endian, 32-byte number - * q: a point of the curve (short form) - */ -static void -cmult(felem *resultx, felem *resultz, const u8 *n, const felem *q) { - felem a[5] = {0}, b[5] = {1}, c[5] = {1}, d[5] = {0}; - felem *nqpqx = a, *nqpqz = b, *nqx = c, *nqz = d, *t; - felem e[5] = {0}, f[5] = {1}, g[5] = {0}, h[5] = {1}; - felem *nqpqx2 = e, *nqpqz2 = f, *nqx2 = g, *nqz2 = h; - - unsigned i, j; - - memcpy(nqpqx, q, sizeof(felem) * 5); - - for (i = 0; i < 32; ++i) { - u8 byte = n[31 - i]; - for (j = 0; j < 8; ++j) { - const felem bit = byte >> 7; - - swap_conditional(nqx, nqpqx, 5, bit); - swap_conditional(nqz, nqpqz, 5, bit); - fmonty(nqx2, nqz2, - nqpqx2, nqpqz2, - nqx, nqz, - nqpqx, nqpqz, - q); - swap_conditional(nqx2, nqpqx2, 5, bit); - swap_conditional(nqz2, nqpqz2, 5, bit); - - t = nqx; - nqx = nqx2; - nqx2 = t; - t = nqz; - nqz = nqz2; - nqz2 = t; - t = nqpqx; - nqpqx = nqpqx2; - nqpqx2 = t; - t = nqpqz; - nqpqz = nqpqz2; - nqpqz2 = t; - - byte <<= 1; - } - } - - memcpy(resultx, nqx, sizeof(felem) * 5); - memcpy(resultz, nqz, sizeof(felem) * 5); -} - -// ----------------------------------------------------------------------------- -// Shamelessly copied from djb's code -// ----------------------------------------------------------------------------- -static void -crecip(felem *out, const felem *z) { - felem z2[5]; - felem z9[5]; - felem z11[5]; - felem z2_5_0[5]; - felem z2_10_0[5]; - felem z2_20_0[5]; - felem z2_50_0[5]; - felem z2_100_0[5]; - felem t0[5]; - felem t1[5]; - int i; - - /* 2 */ fsquare(z2,z); - /* 4 */ fsquare(t1,z2); - /* 8 */ fsquare(t0,t1); - /* 9 */ fmul(z9,t0,z); - /* 11 */ fmul(z11,z9,z2); - /* 22 */ fsquare(t0,z11); - /* 2^5 - 2^0 = 31 */ fmul(z2_5_0,t0,z9); - - /* 2^6 - 2^1 */ fsquare(t0,z2_5_0); - /* 2^7 - 2^2 */ fsquare(t1,t0); - /* 2^8 - 2^3 */ fsquare(t0,t1); - /* 2^9 - 2^4 */ fsquare(t1,t0); - /* 2^10 - 2^5 */ fsquare(t0,t1); - /* 2^10 - 2^0 */ fmul(z2_10_0,t0,z2_5_0); - - /* 2^11 - 2^1 */ fsquare(t0,z2_10_0); - /* 2^12 - 2^2 */ fsquare(t1,t0); - /* 2^20 - 2^10 */ for (i = 2;i < 10;i += 2) { fsquare(t0,t1); fsquare(t1,t0); } - /* 2^20 - 2^0 */ fmul(z2_20_0,t1,z2_10_0); - - /* 2^21 - 2^1 */ fsquare(t0,z2_20_0); - /* 2^22 - 2^2 */ fsquare(t1,t0); - /* 2^40 - 2^20 */ for (i = 2;i < 20;i += 2) { fsquare(t0,t1); fsquare(t1,t0); } - /* 2^40 - 2^0 */ fmul(t0,t1,z2_20_0); - - /* 2^41 - 2^1 */ fsquare(t1,t0); - /* 2^42 - 2^2 */ fsquare(t0,t1); - /* 2^50 - 2^10 */ for (i = 2;i < 10;i += 2) { fsquare(t1,t0); fsquare(t0,t1); } - /* 2^50 - 2^0 */ fmul(z2_50_0,t0,z2_10_0); - - /* 2^51 - 2^1 */ fsquare(t0,z2_50_0); - /* 2^52 - 2^2 */ fsquare(t1,t0); - /* 2^100 - 2^50 */ for (i = 2;i < 50;i += 2) { fsquare(t0,t1); fsquare(t1,t0); } - /* 2^100 - 2^0 */ fmul(z2_100_0,t1,z2_50_0); - - /* 2^101 - 2^1 */ fsquare(t1,z2_100_0); - /* 2^102 - 2^2 */ fsquare(t0,t1); - /* 2^200 - 2^100 */ for (i = 2;i < 100;i += 2) { fsquare(t1,t0); fsquare(t0,t1); } - /* 2^200 - 2^0 */ fmul(t1,t0,z2_100_0); - - /* 2^201 - 2^1 */ fsquare(t0,t1); - /* 2^202 - 2^2 */ fsquare(t1,t0); - /* 2^250 - 2^50 */ for (i = 2;i < 50;i += 2) { fsquare(t0,t1); fsquare(t1,t0); } - /* 2^250 - 2^0 */ fmul(t0,t1,z2_50_0); - - /* 2^251 - 2^1 */ fsquare(t1,t0); - /* 2^252 - 2^2 */ fsquare(t0,t1); - /* 2^253 - 2^3 */ fsquare(t1,t0); - /* 2^254 - 2^4 */ fsquare(t0,t1); - /* 2^255 - 2^5 */ fsquare(t1,t0); - /* 2^255 - 21 */ fmul(out,t1,z11); -} - -int -crypto_scalarmult(u8 *mypublic, const u8 *secret, const u8 *basepoint) { - felem bp[5], x[5], z[5], zmone[5]; - unsigned char e[32]; - int i; - for (i = 0;i < 32;++i) e[i] = secret[i]; - e[0] &= 248; - e[31] &= 127; - e[31] |= 64; - fexpand(bp, basepoint); - cmult(x, z, e, bp); - crecip(zmone, z); - fmul(z, x, zmone); - fcontract(mypublic, z); - return 0; -} diff --git a/src/libnacl/crypto_scalarmult/curve25519/ref/api.h b/src/libnacl/crypto_scalarmult/curve25519/ref/api.h deleted file mode 100644 index 60339596..00000000 --- a/src/libnacl/crypto_scalarmult/curve25519/ref/api.h +++ /dev/null @@ -1,2 +0,0 @@ -#define CRYPTO_BYTES 32 -#define CRYPTO_SCALARBYTES 32 diff --git a/src/libnacl/crypto_scalarmult/curve25519/ref/base.c b/src/libnacl/crypto_scalarmult/curve25519/ref/base.c deleted file mode 100644 index ac2d7eb4..00000000 --- a/src/libnacl/crypto_scalarmult/curve25519/ref/base.c +++ /dev/null @@ -1,16 +0,0 @@ -/* -version 20081011 -Matthew Dempsky -Public domain. -Derived from public domain code by D. J. Bernstein. -*/ - -#include "crypto_scalarmult.h" - -const unsigned char base[32] = {9}; - -int crypto_scalarmult_base(unsigned char *q, - const unsigned char *n) -{ - return crypto_scalarmult(q,n,base); -} diff --git a/src/libnacl/crypto_scalarmult/curve25519/ref/implementors b/src/libnacl/crypto_scalarmult/curve25519/ref/implementors deleted file mode 100644 index aa551790..00000000 --- a/src/libnacl/crypto_scalarmult/curve25519/ref/implementors +++ /dev/null @@ -1 +0,0 @@ -Matthew Dempsky (Mochi Media) diff --git a/src/libnacl/crypto_scalarmult/curve25519/ref/smult.c b/src/libnacl/crypto_scalarmult/curve25519/ref/smult.c deleted file mode 100644 index 6a479558..00000000 --- a/src/libnacl/crypto_scalarmult/curve25519/ref/smult.c +++ /dev/null @@ -1,265 +0,0 @@ -/* -version 20081011 -Matthew Dempsky -Public domain. -Derived from public domain code by D. J. Bernstein. -*/ - -#include "crypto_scalarmult.h" - -static void add(unsigned int out[32],const unsigned int a[32],const unsigned int b[32]) -{ - unsigned int j; - unsigned int u; - u = 0; - for (j = 0;j < 31;++j) { u += a[j] + b[j]; out[j] = u & 255; u >>= 8; } - u += a[31] + b[31]; out[31] = u; -} - -static void sub(unsigned int out[32],const unsigned int a[32],const unsigned int b[32]) -{ - unsigned int j; - unsigned int u; - u = 218; - for (j = 0;j < 31;++j) { - u += a[j] + 65280 - b[j]; - out[j] = u & 255; - u >>= 8; - } - u += a[31] - b[31]; - out[31] = u; -} - -static void squeeze(unsigned int a[32]) -{ - unsigned int j; - unsigned int u; - u = 0; - for (j = 0;j < 31;++j) { u += a[j]; a[j] = u & 255; u >>= 8; } - u += a[31]; a[31] = u & 127; - u = 19 * (u >> 7); - for (j = 0;j < 31;++j) { u += a[j]; a[j] = u & 255; u >>= 8; } - u += a[31]; a[31] = u; -} - -static const unsigned int minusp[32] = { - 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128 -} ; - -static void freeze(unsigned int a[32]) -{ - unsigned int aorig[32]; - unsigned int j; - unsigned int negative; - - for (j = 0;j < 32;++j) aorig[j] = a[j]; - add(a,a,minusp); - negative = -((a[31] >> 7) & 1); - for (j = 0;j < 32;++j) a[j] ^= negative & (aorig[j] ^ a[j]); -} - -static void mult(unsigned int out[32],const unsigned int a[32],const unsigned int b[32]) -{ - unsigned int i; - unsigned int j; - unsigned int u; - - for (i = 0;i < 32;++i) { - u = 0; - for (j = 0;j <= i;++j) u += a[j] * b[i - j]; - for (j = i + 1;j < 32;++j) u += 38 * a[j] * b[i + 32 - j]; - out[i] = u; - } - squeeze(out); -} - -static void mult121665(unsigned int out[32],const unsigned int a[32]) -{ - unsigned int j; - unsigned int u; - - u = 0; - for (j = 0;j < 31;++j) { u += 121665 * a[j]; out[j] = u & 255; u >>= 8; } - u += 121665 * a[31]; out[31] = u & 127; - u = 19 * (u >> 7); - for (j = 0;j < 31;++j) { u += out[j]; out[j] = u & 255; u >>= 8; } - u += out[j]; out[j] = u; -} - -static void square(unsigned int out[32],const unsigned int a[32]) -{ - unsigned int i; - unsigned int j; - unsigned int u; - - for (i = 0;i < 32;++i) { - u = 0; - for (j = 0;j < i - j;++j) u += a[j] * a[i - j]; - for (j = i + 1;j < i + 32 - j;++j) u += 38 * a[j] * a[i + 32 - j]; - u *= 2; - if ((i & 1) == 0) { - u += a[i / 2] * a[i / 2]; - u += 38 * a[i / 2 + 16] * a[i / 2 + 16]; - } - out[i] = u; - } - squeeze(out); -} - -static void select(unsigned int p[64],unsigned int q[64],const unsigned int r[64],const unsigned int s[64],unsigned int b) -{ - unsigned int j; - unsigned int t; - unsigned int bminus1; - - bminus1 = b - 1; - for (j = 0;j < 64;++j) { - t = bminus1 & (r[j] ^ s[j]); - p[j] = s[j] ^ t; - q[j] = r[j] ^ t; - } -} - -static void mainloop(unsigned int work[64],const unsigned char e[32]) -{ - unsigned int xzm1[64]; - unsigned int xzm[64]; - unsigned int xzmb[64]; - unsigned int xzm1b[64]; - unsigned int xznb[64]; - unsigned int xzn1b[64]; - unsigned int a0[64]; - unsigned int a1[64]; - unsigned int b0[64]; - unsigned int b1[64]; - unsigned int c1[64]; - unsigned int r[32]; - unsigned int s[32]; - unsigned int t[32]; - unsigned int u[32]; - unsigned int i; - unsigned int j; - unsigned int b; - int pos; - - for (j = 0;j < 32;++j) xzm1[j] = work[j]; - xzm1[32] = 1; - for (j = 33;j < 64;++j) xzm1[j] = 0; - - xzm[0] = 1; - for (j = 1;j < 64;++j) xzm[j] = 0; - - for (pos = 254;pos >= 0;--pos) { - b = e[pos / 8] >> (pos & 7); - b &= 1; - select(xzmb,xzm1b,xzm,xzm1,b); - add(a0,xzmb,xzmb + 32); - sub(a0 + 32,xzmb,xzmb + 32); - add(a1,xzm1b,xzm1b + 32); - sub(a1 + 32,xzm1b,xzm1b + 32); - square(b0,a0); - square(b0 + 32,a0 + 32); - mult(b1,a1,a0 + 32); - mult(b1 + 32,a1 + 32,a0); - add(c1,b1,b1 + 32); - sub(c1 + 32,b1,b1 + 32); - square(r,c1 + 32); - sub(s,b0,b0 + 32); - mult121665(t,s); - add(u,t,b0); - mult(xznb,b0,b0 + 32); - mult(xznb + 32,s,u); - square(xzn1b,c1); - mult(xzn1b + 32,r,work); - select(xzm,xzm1,xznb,xzn1b,b); - } - - for (j = 0;j < 64;++j) work[j] = xzm[j]; -} - -static void recip(unsigned int out[32],const unsigned int z[32]) -{ - unsigned int z2[32]; - unsigned int z9[32]; - unsigned int z11[32]; - unsigned int z2_5_0[32]; - unsigned int z2_10_0[32]; - unsigned int z2_20_0[32]; - unsigned int z2_50_0[32]; - unsigned int z2_100_0[32]; - unsigned int t0[32]; - unsigned int t1[32]; - int i; - - /* 2 */ square(z2,z); - /* 4 */ square(t1,z2); - /* 8 */ square(t0,t1); - /* 9 */ mult(z9,t0,z); - /* 11 */ mult(z11,z9,z2); - /* 22 */ square(t0,z11); - /* 2^5 - 2^0 = 31 */ mult(z2_5_0,t0,z9); - - /* 2^6 - 2^1 */ square(t0,z2_5_0); - /* 2^7 - 2^2 */ square(t1,t0); - /* 2^8 - 2^3 */ square(t0,t1); - /* 2^9 - 2^4 */ square(t1,t0); - /* 2^10 - 2^5 */ square(t0,t1); - /* 2^10 - 2^0 */ mult(z2_10_0,t0,z2_5_0); - - /* 2^11 - 2^1 */ square(t0,z2_10_0); - /* 2^12 - 2^2 */ square(t1,t0); - /* 2^20 - 2^10 */ for (i = 2;i < 10;i += 2) { square(t0,t1); square(t1,t0); } - /* 2^20 - 2^0 */ mult(z2_20_0,t1,z2_10_0); - - /* 2^21 - 2^1 */ square(t0,z2_20_0); - /* 2^22 - 2^2 */ square(t1,t0); - /* 2^40 - 2^20 */ for (i = 2;i < 20;i += 2) { square(t0,t1); square(t1,t0); } - /* 2^40 - 2^0 */ mult(t0,t1,z2_20_0); - - /* 2^41 - 2^1 */ square(t1,t0); - /* 2^42 - 2^2 */ square(t0,t1); - /* 2^50 - 2^10 */ for (i = 2;i < 10;i += 2) { square(t1,t0); square(t0,t1); } - /* 2^50 - 2^0 */ mult(z2_50_0,t0,z2_10_0); - - /* 2^51 - 2^1 */ square(t0,z2_50_0); - /* 2^52 - 2^2 */ square(t1,t0); - /* 2^100 - 2^50 */ for (i = 2;i < 50;i += 2) { square(t0,t1); square(t1,t0); } - /* 2^100 - 2^0 */ mult(z2_100_0,t1,z2_50_0); - - /* 2^101 - 2^1 */ square(t1,z2_100_0); - /* 2^102 - 2^2 */ square(t0,t1); - /* 2^200 - 2^100 */ for (i = 2;i < 100;i += 2) { square(t1,t0); square(t0,t1); } - /* 2^200 - 2^0 */ mult(t1,t0,z2_100_0); - - /* 2^201 - 2^1 */ square(t0,t1); - /* 2^202 - 2^2 */ square(t1,t0); - /* 2^250 - 2^50 */ for (i = 2;i < 50;i += 2) { square(t0,t1); square(t1,t0); } - /* 2^250 - 2^0 */ mult(t0,t1,z2_50_0); - - /* 2^251 - 2^1 */ square(t1,t0); - /* 2^252 - 2^2 */ square(t0,t1); - /* 2^253 - 2^3 */ square(t1,t0); - /* 2^254 - 2^4 */ square(t0,t1); - /* 2^255 - 2^5 */ square(t1,t0); - /* 2^255 - 21 */ mult(out,t1,z11); -} - -int crypto_scalarmult(unsigned char *q, - const unsigned char *n, - const unsigned char *p) -{ - unsigned int work[96]; - unsigned char e[32]; - unsigned int i; - for (i = 0;i < 32;++i) e[i] = n[i]; - e[0] &= 248; - e[31] &= 127; - e[31] |= 64; - for (i = 0;i < 32;++i) work[i] = p[i]; - mainloop(work,e); - recip(work + 32,work + 32); - mult(work + 64,work,work + 32); - freeze(work + 64); - for (i = 0;i < 32;++i) q[i] = work[64 + i]; - return 0; -} diff --git a/src/libnacl/crypto_scalarmult/curve25519/used b/src/libnacl/crypto_scalarmult/curve25519/used deleted file mode 100644 index e69de29b..00000000 diff --git a/src/libnacl/crypto_scalarmult/measure.c b/src/libnacl/crypto_scalarmult/measure.c deleted file mode 100644 index 0c7265d5..00000000 --- a/src/libnacl/crypto_scalarmult/measure.c +++ /dev/null @@ -1,61 +0,0 @@ -#include -#include "randombytes.h" -#include "cpucycles.h" -#include "crypto_scalarmult.h" - -extern void printentry(long long,const char *,long long *,long long); -extern unsigned char *alignedcalloc(unsigned long long); -extern const char *primitiveimplementation; -extern const char *implementationversion; -extern const char *sizenames[]; -extern const long long sizes[]; -extern void allocate(void); -extern void measure(void); - -const char *primitiveimplementation = crypto_scalarmult_IMPLEMENTATION; -const char *implementationversion = crypto_scalarmult_VERSION; -const char *sizenames[] = { "outputbytes", "scalarbytes", 0 }; -const long long sizes[] = { crypto_scalarmult_BYTES, crypto_scalarmult_SCALARBYTES }; - -static unsigned char *m; -static unsigned char *n; -static unsigned char *p; -static unsigned char *q; - -void preallocate(void) -{ -} - -void allocate(void) -{ - m = alignedcalloc(crypto_scalarmult_SCALARBYTES); - n = alignedcalloc(crypto_scalarmult_SCALARBYTES); - p = alignedcalloc(crypto_scalarmult_BYTES); - q = alignedcalloc(crypto_scalarmult_BYTES); -} - -#define TIMINGS 63 -static long long cycles[TIMINGS + 1]; - -void measure(void) -{ - int i; - int loop; - - for (loop = 0;loop < LOOPS;++loop) { - randombytes(m,crypto_scalarmult_SCALARBYTES); - randombytes(n,crypto_scalarmult_SCALARBYTES); - for (i = 0;i <= TIMINGS;++i) { - cycles[i] = cpucycles(); - crypto_scalarmult_base(p,m); - } - for (i = 0;i < TIMINGS;++i) cycles[i] = cycles[i + 1] - cycles[i]; - printentry(-1,"base_cycles",cycles,TIMINGS); - for (i = 0;i <= TIMINGS;++i) { - cycles[i] = cpucycles(); - crypto_scalarmult(q,n,p); - } - for (i = 0;i < TIMINGS;++i) cycles[i] = cycles[i + 1] - cycles[i]; - printentry(-1,"cycles",cycles,TIMINGS); - } -} diff --git a/src/libnacl/crypto_scalarmult/try.c b/src/libnacl/crypto_scalarmult/try.c deleted file mode 100644 index 1ec97b6b..00000000 --- a/src/libnacl/crypto_scalarmult/try.c +++ /dev/null @@ -1,127 +0,0 @@ -/* - * crypto_scalarmult/try.c version 20090118 - * D. J. Bernstein - * Public domain. - */ - -#include -#include "crypto_scalarmult.h" -#include "windows/windows-quirks.h" - -extern unsigned char *alignedcalloc(unsigned long long); - -const char *primitiveimplementation = crypto_scalarmult_IMPLEMENTATION; - -#define mlen crypto_scalarmult_SCALARBYTES -#define nlen crypto_scalarmult_SCALARBYTES -#define plen crypto_scalarmult_BYTES -#define qlen crypto_scalarmult_BYTES -#define rlen crypto_scalarmult_BYTES - -static unsigned char *m; -static unsigned char *n; -static unsigned char *p; -static unsigned char *q; -static unsigned char *r; - -static unsigned char *m2; -static unsigned char *n2; -static unsigned char *p2; -static unsigned char *q2; -static unsigned char *r2; - -void preallocate(void) -{ -} - -void allocate(void) -{ - m = alignedcalloc(mlen); - n = alignedcalloc(nlen); - p = alignedcalloc(plen); - q = alignedcalloc(qlen); - r = alignedcalloc(rlen); - m2 = alignedcalloc(mlen + crypto_scalarmult_BYTES); - n2 = alignedcalloc(nlen + crypto_scalarmult_BYTES); - p2 = alignedcalloc(plen + crypto_scalarmult_BYTES); - q2 = alignedcalloc(qlen + crypto_scalarmult_BYTES); - r2 = alignedcalloc(rlen + crypto_scalarmult_BYTES); -} - -void predoit(void) -{ -} - -void doit(void) -{ - crypto_scalarmult(q,n,p); - crypto_scalarmult_base(r,n); -} - -char checksum[crypto_scalarmult_BYTES * 2 + 1]; - -const char *checksum_compute(void) -{ - long long i; - long long j; - long long tests; - - for (i = 0;i < mlen;++i) m[i] = i; - for (i = 0;i < nlen;++i) n[i] = i + 1; - for (i = 0;i < plen;++i) p[i] = i + 2; - for (i = 0;i < qlen;++i) q[i] = i + 3; - for (i = 0;i < rlen;++i) r[i] = i + 4; - - for (i = -16;i < 0;++i) p[i] = random(); - for (i = -16;i < 0;++i) n[i] = random(); - for (i = plen;i < plen + 16;++i) p[i] = random(); - for (i = nlen;i < nlen + 16;++i) n[i] = random(); - for (i = -16;i < plen + 16;++i) p2[i] = p[i]; - for (i = -16;i < nlen + 16;++i) n2[i] = n[i]; - - if (crypto_scalarmult_base(p,n) != 0) return "crypto_scalarmult_base returns nonzero"; - - for (i = -16;i < nlen + 16;++i) if (n2[i] != n[i]) return "crypto_scalarmult_base overwrites input"; - for (i = -16;i < 0;++i) if (p2[i] != p[i]) return "crypto_scalarmult_base writes before output"; - for (i = plen;i < plen + 16;++i) if (p2[i] != p[i]) return "crypto_scalarmult_base writes after output"; - - for (tests = 0;tests < 100;++tests) { - for (i = -16;i < 0;++i) q[i] = random(); - for (i = -16;i < 0;++i) p[i] = random(); - for (i = -16;i < 0;++i) m[i] = random(); - for (i = qlen;i < qlen + 16;++i) q[i] = random(); - for (i = plen;i < plen + 16;++i) p[i] = random(); - for (i = mlen;i < mlen + 16;++i) m[i] = random(); - for (i = -16;i < qlen + 16;++i) q2[i] = q[i]; - for (i = -16;i < plen + 16;++i) p2[i] = p[i]; - for (i = -16;i < mlen + 16;++i) m2[i] = m[i]; - - if (crypto_scalarmult(q,m,p) != 0) return "crypto_scalarmult returns nonzero"; - - for (i = -16;i < mlen + 16;++i) if (m2[i] != m[i]) return "crypto_scalarmult overwrites n input"; - for (i = -16;i < plen + 16;++i) if (p2[i] != p[i]) return "crypto_scalarmult overwrites p input"; - for (i = -16;i < 0;++i) if (q2[i] != q[i]) return "crypto_scalarmult writes before output"; - for (i = qlen;i < qlen + 16;++i) if (q2[i] != q[i]) return "crypto_scalarmult writes after output"; - - if (crypto_scalarmult(m2,m2,p) != 0) return "crypto_scalarmult returns nonzero"; - for (i = 0;i < qlen;++i) if (q[i] != m2[i]) return "crypto_scalarmult does not handle n overlap"; - for (i = 0;i < qlen;++i) m2[i] = m[i]; - - if (crypto_scalarmult(p2,m2,p2) != 0) return "crypto_scalarmult returns nonzero"; - for (i = 0;i < qlen;++i) if (q[i] != p2[i]) return "crypto_scalarmult does not handle p overlap"; - - if (crypto_scalarmult(r,n,q) != 0) return "crypto_scalarmult returns nonzero"; - if (crypto_scalarmult(q,n,p) != 0) return "crypto_scalarmult returns nonzero"; - if (crypto_scalarmult(p,m,q) != 0) return "crypto_scalarmult returns nonzero"; - for (j = 0;j < plen;++j) if (p[j] != r[j]) return "crypto_scalarmult not associative"; - for (j = 0;j < mlen;++j) m[j] ^= q[j % qlen]; - for (j = 0;j < nlen;++j) n[j] ^= p[j % plen]; - } - - for (i = 0;i < crypto_scalarmult_BYTES;++i) { - checksum[2 * i] = "0123456789abcdef"[15 & (p[i] >> 4)]; - checksum[2 * i + 1] = "0123456789abcdef"[15 & p[i]]; - } - checksum[2 * i] = 0; - return 0; -} diff --git a/src/libnacl/crypto_secretbox/measure.c b/src/libnacl/crypto_secretbox/measure.c deleted file mode 100644 index 6cb0692f..00000000 --- a/src/libnacl/crypto_secretbox/measure.c +++ /dev/null @@ -1,75 +0,0 @@ -#include -#include "randombytes.h" -#include "cpucycles.h" -#include "crypto_secretbox.h" - -extern void printentry(long long,const char *,long long *,long long); -extern unsigned char *alignedcalloc(unsigned long long); -extern const char *primitiveimplementation; -extern const char *implementationversion; -extern const char *sizenames[]; -extern const long long sizes[]; -extern void allocate(void); -extern void measure(void); - -const char *primitiveimplementation = crypto_secretbox_IMPLEMENTATION; -const char *implementationversion = crypto_secretbox_VERSION; -const char *sizenames[] = { "keybytes", "noncebytes", "zerobytes", "boxzerobytes", 0 }; -const long long sizes[] = { crypto_secretbox_KEYBYTES, crypto_secretbox_NONCEBYTES, crypto_secretbox_ZEROBYTES, crypto_secretbox_BOXZEROBYTES }; - -#define MAXTEST_BYTES 4096 - -static unsigned char *k; -static unsigned char *n; -static unsigned char *m; -static unsigned char *c; - -void preallocate(void) -{ -} - -void allocate(void) -{ - k = alignedcalloc(crypto_secretbox_KEYBYTES); - n = alignedcalloc(crypto_secretbox_NONCEBYTES); - m = alignedcalloc(MAXTEST_BYTES + crypto_secretbox_ZEROBYTES); - c = alignedcalloc(MAXTEST_BYTES + crypto_secretbox_ZEROBYTES); -} - -#define TIMINGS 15 -static long long cycles[TIMINGS + 1]; - -void measure(void) -{ - int i; - int loop; - int mlen; - - for (loop = 0;loop < LOOPS;++loop) { - for (mlen = 0;mlen <= MAXTEST_BYTES;mlen += 1 + mlen / 8) { - randombytes(k,crypto_secretbox_KEYBYTES); - randombytes(n,crypto_secretbox_NONCEBYTES); - randombytes(m + crypto_secretbox_ZEROBYTES,mlen); - randombytes(c,mlen + crypto_secretbox_ZEROBYTES); - for (i = 0;i <= TIMINGS;++i) { - cycles[i] = cpucycles(); - crypto_secretbox(c,m,mlen + crypto_secretbox_ZEROBYTES,n,k); - } - for (i = 0;i < TIMINGS;++i) cycles[i] = cycles[i + 1] - cycles[i]; - printentry(mlen,"cycles",cycles,TIMINGS); - for (i = 0;i <= TIMINGS;++i) { - cycles[i] = cpucycles(); - crypto_secretbox_open(m,c,mlen + crypto_secretbox_ZEROBYTES,n,k); - } - for (i = 0;i < TIMINGS;++i) cycles[i] = cycles[i + 1] - cycles[i]; - printentry(mlen,"open_cycles",cycles,TIMINGS); - ++c[crypto_secretbox_ZEROBYTES]; - for (i = 0;i <= TIMINGS;++i) { - cycles[i] = cpucycles(); - crypto_secretbox_open(m,c,mlen + crypto_secretbox_ZEROBYTES,n,k); - } - for (i = 0;i < TIMINGS;++i) cycles[i] = cycles[i + 1] - cycles[i]; - printentry(mlen,"forgery_open_cycles",cycles,TIMINGS); - } - } -} diff --git a/src/libnacl/crypto_secretbox/try.c b/src/libnacl/crypto_secretbox/try.c deleted file mode 100644 index 012b28ea..00000000 --- a/src/libnacl/crypto_secretbox/try.c +++ /dev/null @@ -1,131 +0,0 @@ -/* - * crypto_secretbox/try.c version 20090118 - * D. J. Bernstein - * Public domain. - */ - -#include -#include "crypto_secretbox.h" -#include "windows/windows-quirks.h" - -extern unsigned char *alignedcalloc(unsigned long long); - -const char *primitiveimplementation = crypto_secretbox_IMPLEMENTATION; - -#define MAXTEST_BYTES 10000 -#define CHECKSUM_BYTES 4096 -#define TUNE_BYTES 1536 - -static unsigned char *k; -static unsigned char *n; -static unsigned char *m; -static unsigned char *c; -static unsigned char *t; -static unsigned char *k2; -static unsigned char *n2; -static unsigned char *m2; -static unsigned char *c2; -static unsigned char *t2; - -#define klen crypto_secretbox_KEYBYTES -#define nlen crypto_secretbox_NONCEBYTES - -void preallocate(void) -{ -} - -void allocate(void) -{ - k = alignedcalloc(klen); - n = alignedcalloc(nlen); - m = alignedcalloc(MAXTEST_BYTES + crypto_secretbox_ZEROBYTES); - c = alignedcalloc(MAXTEST_BYTES + crypto_secretbox_ZEROBYTES); - t = alignedcalloc(MAXTEST_BYTES + crypto_secretbox_ZEROBYTES); - k2 = alignedcalloc(klen); - n2 = alignedcalloc(nlen); - m2 = alignedcalloc(MAXTEST_BYTES + crypto_secretbox_ZEROBYTES); - c2 = alignedcalloc(MAXTEST_BYTES + crypto_secretbox_ZEROBYTES); - t2 = alignedcalloc(MAXTEST_BYTES + crypto_secretbox_ZEROBYTES); -} - -void predoit(void) -{ -} - -void doit(void) -{ - crypto_secretbox(c,m,TUNE_BYTES + crypto_secretbox_ZEROBYTES,n,k); - crypto_secretbox_open(t,c,TUNE_BYTES + crypto_secretbox_ZEROBYTES,n,k); -} - -char checksum[klen * 2 + 1]; - -const char *checksum_compute(void) -{ - long long i; - long long j; - - for (j = 0;j < crypto_secretbox_ZEROBYTES;++j) m[j] = 0; - - for (i = 0;i < CHECKSUM_BYTES;++i) { - long long mlen = i + crypto_secretbox_ZEROBYTES; - long long tlen = i + crypto_secretbox_ZEROBYTES; - long long clen = i + crypto_secretbox_ZEROBYTES; - - for (j = -16;j < 0;++j) k[j] = random(); - for (j = -16;j < 0;++j) n[j] = random(); - for (j = -16;j < 0;++j) m[j] = random(); - for (j = klen;j < klen + 16;++j) k[j] = random(); - for (j = nlen;j < nlen + 16;++j) n[j] = random(); - for (j = mlen;j < mlen + 16;++j) m[j] = random(); - for (j = -16;j < klen + 16;++j) k2[j] = k[j]; - for (j = -16;j < nlen + 16;++j) n2[j] = n[j]; - for (j = -16;j < mlen + 16;++j) m2[j] = m[j]; - for (j = -16;j < clen + 16;++j) c2[j] = c[j] = random(); - - if (crypto_secretbox(c,m,mlen,n,k) != 0) return "crypto_secretbox returns nonzero"; - - for (j = -16;j < mlen + 16;++j) if (m2[j] != m[j]) return "crypto_secretbox overwrites m"; - for (j = -16;j < nlen + 16;++j) if (n2[j] != n[j]) return "crypto_secretbox overwrites n"; - for (j = -16;j < klen + 16;++j) if (k2[j] != k[j]) return "crypto_secretbox overwrites k"; - for (j = -16;j < 0;++j) if (c2[j] != c[j]) return "crypto_secretbox writes before output"; - for (j = clen;j < clen + 16;++j) if (c2[j] != c[j]) return "crypto_secretbox writes after output"; - for (j = 0;j < crypto_secretbox_BOXZEROBYTES;++j) - if (c[j] != 0) return "crypto_secretbox does not clear extra bytes"; - - for (j = -16;j < 0;++j) c[j] = random(); - for (j = clen;j < clen + 16;++j) c[j] = random(); - for (j = -16;j < clen + 16;++j) c2[j] = c[j]; - for (j = -16;j < tlen + 16;++j) t2[j] = t[j] = random(); - - if (crypto_secretbox_open(t,c,clen,n,k) != 0) return "crypto_secretbox_open returns nonzero"; - - for (j = -16;j < clen + 16;++j) if (c2[j] != c[j]) return "crypto_secretbox_open overwrites c"; - for (j = -16;j < nlen + 16;++j) if (n2[j] != n[j]) return "crypto_secretbox_open overwrites n"; - for (j = -16;j < klen + 16;++j) if (k2[j] != k[j]) return "crypto_secretbox_open overwrites k"; - for (j = -16;j < 0;++j) if (t2[j] != t[j]) return "crypto_secretbox_open writes before output"; - for (j = tlen;j < tlen + 16;++j) if (t2[j] != t[j]) return "crypto_secretbox_open writes after output"; - for (j = 0;j < crypto_secretbox_ZEROBYTES;++j) - if (t[j] != 0) return "crypto_secretbox_open does not clear extra bytes"; - - for (j = 0;j < i;++j) if (t[j] != m[j]) return "plaintext does not match"; - - for (j = 0;j < i;++j) - k[j % klen] ^= c[j + crypto_secretbox_BOXZEROBYTES]; - crypto_secretbox(c,m,mlen,n,k); - for (j = 0;j < i;++j) - n[j % nlen] ^= c[j + crypto_secretbox_BOXZEROBYTES]; - crypto_secretbox(c,m,mlen,n,k); - if (i == 0) m[crypto_secretbox_ZEROBYTES + 0] = 0; - m[crypto_secretbox_ZEROBYTES + i] = m[crypto_secretbox_ZEROBYTES + 0]; - for (j = 0;j < i;++j) - m[j + crypto_secretbox_ZEROBYTES] ^= c[j + crypto_secretbox_BOXZEROBYTES]; - } - - for (i = 0;i < klen;++i) { - checksum[2 * i] = "0123456789abcdef"[15 & (k[i] >> 4)]; - checksum[2 * i + 1] = "0123456789abcdef"[15 & k[i]]; - } - checksum[2 * i] = 0; - return 0; -} diff --git a/src/libnacl/crypto_secretbox/xsalsa20poly1305/checksum b/src/libnacl/crypto_secretbox/xsalsa20poly1305/checksum deleted file mode 100644 index af3c6897..00000000 --- a/src/libnacl/crypto_secretbox/xsalsa20poly1305/checksum +++ /dev/null @@ -1 +0,0 @@ -df372f95dd87381b7c9ceb6f340ccaa03d19bed5d9e4ab004d99d847675a9658 diff --git a/src/libnacl/crypto_secretbox/xsalsa20poly1305/ref/api.h b/src/libnacl/crypto_secretbox/xsalsa20poly1305/ref/api.h deleted file mode 100644 index f5aeb356..00000000 --- a/src/libnacl/crypto_secretbox/xsalsa20poly1305/ref/api.h +++ /dev/null @@ -1,4 +0,0 @@ -#define CRYPTO_KEYBYTES 32 -#define CRYPTO_NONCEBYTES 24 -#define CRYPTO_ZEROBYTES 32 -#define CRYPTO_BOXZEROBYTES 16 diff --git a/src/libnacl/crypto_secretbox/xsalsa20poly1305/ref/box.c b/src/libnacl/crypto_secretbox/xsalsa20poly1305/ref/box.c deleted file mode 100644 index f1abb06f..00000000 --- a/src/libnacl/crypto_secretbox/xsalsa20poly1305/ref/box.c +++ /dev/null @@ -1,35 +0,0 @@ -#include "crypto_onetimeauth_poly1305.h" -#include "crypto_stream_xsalsa20.h" -#include "crypto_secretbox.h" - -int crypto_secretbox( - unsigned char *c, - const unsigned char *m,unsigned long long mlen, - const unsigned char *n, - const unsigned char *k -) -{ - int i; - if (mlen < 32) return -1; - crypto_stream_xsalsa20_xor(c,m,mlen,n,k); - crypto_onetimeauth_poly1305(c + 16,c + 32,mlen - 32,c); - for (i = 0;i < 16;++i) c[i] = 0; - return 0; -} - -int crypto_secretbox_open( - unsigned char *m, - const unsigned char *c,unsigned long long clen, - const unsigned char *n, - const unsigned char *k -) -{ - int i; - unsigned char subkey[32]; - if (clen < 32) return -1; - crypto_stream_xsalsa20(subkey,32,n,k); - if (crypto_onetimeauth_poly1305_verify(c + 16,c + 32,clen - 32,subkey) != 0) return -1; - crypto_stream_xsalsa20_xor(m,c,clen,n,k); - for (i = 0;i < 32;++i) m[i] = 0; - return 0; -} diff --git a/src/libnacl/crypto_secretbox/xsalsa20poly1305/selected b/src/libnacl/crypto_secretbox/xsalsa20poly1305/selected deleted file mode 100644 index e69de29b..00000000 diff --git a/src/libnacl/crypto_secretbox/xsalsa20poly1305/used b/src/libnacl/crypto_secretbox/xsalsa20poly1305/used deleted file mode 100644 index e69de29b..00000000 diff --git a/src/libnacl/crypto_sign/ed25519/description b/src/libnacl/crypto_sign/ed25519/description deleted file mode 100644 index 0dba8c46..00000000 --- a/src/libnacl/crypto_sign/ed25519/description +++ /dev/null @@ -1 +0,0 @@ -EdDSA signatures using Curve25519 diff --git a/src/libnacl/crypto_sign/ed25519/designers b/src/libnacl/crypto_sign/ed25519/designers deleted file mode 100644 index 2a3a93a8..00000000 --- a/src/libnacl/crypto_sign/ed25519/designers +++ /dev/null @@ -1,5 +0,0 @@ -Daniel J. Bernstein -Niels Duif -Tanja Lange -Peter Schwabe -Bo-Yin Yang diff --git a/src/libnacl/crypto_sign/ed25519/ref/api.h b/src/libnacl/crypto_sign/ed25519/ref/api.h deleted file mode 100644 index 1d0c9889..00000000 --- a/src/libnacl/crypto_sign/ed25519/ref/api.h +++ /dev/null @@ -1,4 +0,0 @@ -#define CRYPTO_SECRETKEYBYTES 64 -#define CRYPTO_PUBLICKEYBYTES 32 -#define CRYPTO_BYTES 64 - diff --git a/src/libnacl/crypto_sign/ed25519/ref/ed25519.c b/src/libnacl/crypto_sign/ed25519/ref/ed25519.c deleted file mode 100644 index 125582aa..00000000 --- a/src/libnacl/crypto_sign/ed25519/ref/ed25519.c +++ /dev/null @@ -1,136 +0,0 @@ -#include "crypto_sign.h" - -#include "crypto_verify_32.h" -#include "crypto_hash_sha512.h" -#include "randombytes.h" - -#include "ge25519.h" - -static void get_hram(unsigned char *hram, const unsigned char *sm, const unsigned char *pk, unsigned char *playground, unsigned long long smlen) -{ - unsigned long long i; - - for (i = 0;i < 32;++i) playground[i] = sm[i]; - for (i = 32;i < 64;++i) playground[i] = pk[i-32]; - for (i = 64;i < smlen;++i) playground[i] = sm[i]; - - crypto_hash_sha512(hram,playground,smlen); -} - - -int crypto_sign_keypair( - unsigned char *pk, - unsigned char *sk - ) -{ - sc25519 scsk; - ge25519 gepk; - unsigned char extsk[64]; - int i; - - randombytes(sk, 32); - crypto_hash_sha512(extsk, sk, 32); - extsk[0] &= 248; - extsk[31] &= 127; - extsk[31] |= 64; - - sc25519_from32bytes(&scsk,extsk); - - ge25519_scalarmult_base(&gepk, &scsk); - ge25519_pack(pk, &gepk); - for(i=0;i<32;i++) - sk[32 + i] = pk[i]; - return 0; -} - -int crypto_sign( - unsigned char *sm,unsigned long long *smlen, - const unsigned char *m,unsigned long long mlen, - const unsigned char *sk - ) -{ - sc25519 sck, scs, scsk; - ge25519 ger; - unsigned char r[32]; - unsigned char s[32]; - unsigned char extsk[64]; - unsigned long long i; - unsigned char hmg[crypto_hash_sha512_BYTES]; - unsigned char hram[crypto_hash_sha512_BYTES]; - - crypto_hash_sha512(extsk, sk, 32); - extsk[0] &= 248; - extsk[31] &= 127; - extsk[31] |= 64; - - *smlen = mlen+64; - for(i=0;i>= 31; /* 1: yes; 0: no */ - return x; -} - -static crypto_uint32 ge(crypto_uint32 a,crypto_uint32 b) /* 16-bit inputs */ -{ - unsigned int x = a; - x -= (unsigned int) b; /* 0..65535: yes; 4294901761..4294967295: no */ - x >>= 31; /* 0: yes; 1: no */ - x ^= 1; /* 1: yes; 0: no */ - return x; -} - -static crypto_uint32 times19(crypto_uint32 a) -{ - return (a << 4) + (a << 1) + a; -} - -static crypto_uint32 times38(crypto_uint32 a) -{ - return (a << 5) + (a << 2) + (a << 1); -} - -static void reduce_add_sub(fe25519 *r) -{ - crypto_uint32 t; - int i,rep; - - for(rep=0;rep<4;rep++) - { - t = r->v[31] >> 7; - r->v[31] &= 127; - t = times19(t); - r->v[0] += t; - for(i=0;i<31;i++) - { - t = r->v[i] >> 8; - r->v[i+1] += t; - r->v[i] &= 255; - } - } -} - -static void reduce_mul(fe25519 *r) -{ - crypto_uint32 t; - int i,rep; - - for(rep=0;rep<2;rep++) - { - t = r->v[31] >> 7; - r->v[31] &= 127; - t = times19(t); - r->v[0] += t; - for(i=0;i<31;i++) - { - t = r->v[i] >> 8; - r->v[i+1] += t; - r->v[i] &= 255; - } - } -} - -/* reduction modulo 2^255-19 */ -void fe25519_freeze(fe25519 *r) -{ - int i; - crypto_uint32 m = equal(r->v[31],127); - for(i=30;i>0;i--) - m &= equal(r->v[i],255); - m &= ge(r->v[0],237); - - m = -m; - - r->v[31] -= m&127; - for(i=30;i>0;i--) - r->v[i] -= m&255; - r->v[0] -= m&237; -} - -void fe25519_unpack(fe25519 *r, const unsigned char x[32]) -{ - int i; - for(i=0;i<32;i++) r->v[i] = x[i]; - r->v[31] &= 127; -} - -/* Assumes input x being reduced below 2^255 */ -void fe25519_pack(unsigned char r[32], const fe25519 *x) -{ - int i; - fe25519 y = *x; - fe25519_freeze(&y); - for(i=0;i<32;i++) - r[i] = y.v[i]; -} - -int fe25519_iszero(const fe25519 *x) -{ - int i; - fe25519 t = *x; - fe25519_freeze(&t); - int r = equal(t.v[0],0); - for(i=1;i<32;i++) - r &= equal(t.v[i],0); - return r; -} - -int fe25519_iseq_vartime(const fe25519 *x, const fe25519 *y) -{ - fe25519 t1 = *x; - fe25519 t2 = *y; - fe25519_freeze(&t1); - fe25519_freeze(&t2); - int i; - for(i=0;i<32;i++) - if(t1.v[i] != t2.v[i]) return 0; - return 1; -} - -void fe25519_cmov(fe25519 *r, const fe25519 *x, unsigned char b) -{ - int i; - crypto_uint32 mask = b; - mask = -mask; - for(i=0;i<32;i++) r->v[i] ^= mask & (x->v[i] ^ r->v[i]); -} - -unsigned char fe25519_getparity(const fe25519 *x) -{ - fe25519 t = *x; - fe25519_freeze(&t); - return t.v[0] & 1; -} - -void fe25519_setone(fe25519 *r) -{ - int i; - r->v[0] = 1; - for(i=1;i<32;i++) r->v[i]=0; -} - -void fe25519_setzero(fe25519 *r) -{ - int i; - for(i=0;i<32;i++) r->v[i]=0; -} - -void fe25519_neg(fe25519 *r, const fe25519 *x) -{ - fe25519 t; - int i; - for(i=0;i<32;i++) t.v[i]=x->v[i]; - fe25519_setzero(r); - fe25519_sub(r, r, &t); -} - -void fe25519_add(fe25519 *r, const fe25519 *x, const fe25519 *y) -{ - int i; - for(i=0;i<32;i++) r->v[i] = x->v[i] + y->v[i]; - reduce_add_sub(r); -} - -void fe25519_sub(fe25519 *r, const fe25519 *x, const fe25519 *y) -{ - int i; - crypto_uint32 t[32]; - t[0] = x->v[0] + 0x1da; - t[31] = x->v[31] + 0xfe; - for(i=1;i<31;i++) t[i] = x->v[i] + 0x1fe; - for(i=0;i<32;i++) r->v[i] = t[i] - y->v[i]; - reduce_add_sub(r); -} - -void fe25519_mul(fe25519 *r, const fe25519 *x, const fe25519 *y) -{ - int i,j; - crypto_uint32 t[63]; - for(i=0;i<63;i++)t[i] = 0; - - for(i=0;i<32;i++) - for(j=0;j<32;j++) - t[i+j] += x->v[i] * y->v[j]; - - for(i=32;i<63;i++) - r->v[i-32] = t[i-32] + times38(t[i]); - r->v[31] = t[31]; /* result now in r[0]...r[31] */ - - reduce_mul(r); -} - -void fe25519_square(fe25519 *r, const fe25519 *x) -{ - fe25519_mul(r, x, x); -} - -void fe25519_invert(fe25519 *r, const fe25519 *x) -{ - fe25519 z2; - fe25519 z9; - fe25519 z11; - fe25519 z2_5_0; - fe25519 z2_10_0; - fe25519 z2_20_0; - fe25519 z2_50_0; - fe25519 z2_100_0; - fe25519 t0; - fe25519 t1; - int i; - - /* 2 */ fe25519_square(&z2,x); - /* 4 */ fe25519_square(&t1,&z2); - /* 8 */ fe25519_square(&t0,&t1); - /* 9 */ fe25519_mul(&z9,&t0,x); - /* 11 */ fe25519_mul(&z11,&z9,&z2); - /* 22 */ fe25519_square(&t0,&z11); - /* 2^5 - 2^0 = 31 */ fe25519_mul(&z2_5_0,&t0,&z9); - - /* 2^6 - 2^1 */ fe25519_square(&t0,&z2_5_0); - /* 2^7 - 2^2 */ fe25519_square(&t1,&t0); - /* 2^8 - 2^3 */ fe25519_square(&t0,&t1); - /* 2^9 - 2^4 */ fe25519_square(&t1,&t0); - /* 2^10 - 2^5 */ fe25519_square(&t0,&t1); - /* 2^10 - 2^0 */ fe25519_mul(&z2_10_0,&t0,&z2_5_0); - - /* 2^11 - 2^1 */ fe25519_square(&t0,&z2_10_0); - /* 2^12 - 2^2 */ fe25519_square(&t1,&t0); - /* 2^20 - 2^10 */ for (i = 2;i < 10;i += 2) { fe25519_square(&t0,&t1); fe25519_square(&t1,&t0); } - /* 2^20 - 2^0 */ fe25519_mul(&z2_20_0,&t1,&z2_10_0); - - /* 2^21 - 2^1 */ fe25519_square(&t0,&z2_20_0); - /* 2^22 - 2^2 */ fe25519_square(&t1,&t0); - /* 2^40 - 2^20 */ for (i = 2;i < 20;i += 2) { fe25519_square(&t0,&t1); fe25519_square(&t1,&t0); } - /* 2^40 - 2^0 */ fe25519_mul(&t0,&t1,&z2_20_0); - - /* 2^41 - 2^1 */ fe25519_square(&t1,&t0); - /* 2^42 - 2^2 */ fe25519_square(&t0,&t1); - /* 2^50 - 2^10 */ for (i = 2;i < 10;i += 2) { fe25519_square(&t1,&t0); fe25519_square(&t0,&t1); } - /* 2^50 - 2^0 */ fe25519_mul(&z2_50_0,&t0,&z2_10_0); - - /* 2^51 - 2^1 */ fe25519_square(&t0,&z2_50_0); - /* 2^52 - 2^2 */ fe25519_square(&t1,&t0); - /* 2^100 - 2^50 */ for (i = 2;i < 50;i += 2) { fe25519_square(&t0,&t1); fe25519_square(&t1,&t0); } - /* 2^100 - 2^0 */ fe25519_mul(&z2_100_0,&t1,&z2_50_0); - - /* 2^101 - 2^1 */ fe25519_square(&t1,&z2_100_0); - /* 2^102 - 2^2 */ fe25519_square(&t0,&t1); - /* 2^200 - 2^100 */ for (i = 2;i < 100;i += 2) { fe25519_square(&t1,&t0); fe25519_square(&t0,&t1); } - /* 2^200 - 2^0 */ fe25519_mul(&t1,&t0,&z2_100_0); - - /* 2^201 - 2^1 */ fe25519_square(&t0,&t1); - /* 2^202 - 2^2 */ fe25519_square(&t1,&t0); - /* 2^250 - 2^50 */ for (i = 2;i < 50;i += 2) { fe25519_square(&t0,&t1); fe25519_square(&t1,&t0); } - /* 2^250 - 2^0 */ fe25519_mul(&t0,&t1,&z2_50_0); - - /* 2^251 - 2^1 */ fe25519_square(&t1,&t0); - /* 2^252 - 2^2 */ fe25519_square(&t0,&t1); - /* 2^253 - 2^3 */ fe25519_square(&t1,&t0); - /* 2^254 - 2^4 */ fe25519_square(&t0,&t1); - /* 2^255 - 2^5 */ fe25519_square(&t1,&t0); - /* 2^255 - 21 */ fe25519_mul(r,&t1,&z11); -} - -void fe25519_pow2523(fe25519 *r, const fe25519 *x) -{ - fe25519 z2; - fe25519 z9; - fe25519 z11; - fe25519 z2_5_0; - fe25519 z2_10_0; - fe25519 z2_20_0; - fe25519 z2_50_0; - fe25519 z2_100_0; - fe25519 t; - int i; - - /* 2 */ fe25519_square(&z2,x); - /* 4 */ fe25519_square(&t,&z2); - /* 8 */ fe25519_square(&t,&t); - /* 9 */ fe25519_mul(&z9,&t,x); - /* 11 */ fe25519_mul(&z11,&z9,&z2); - /* 22 */ fe25519_square(&t,&z11); - /* 2^5 - 2^0 = 31 */ fe25519_mul(&z2_5_0,&t,&z9); - - /* 2^6 - 2^1 */ fe25519_square(&t,&z2_5_0); - /* 2^10 - 2^5 */ for (i = 1;i < 5;i++) { fe25519_square(&t,&t); } - /* 2^10 - 2^0 */ fe25519_mul(&z2_10_0,&t,&z2_5_0); - - /* 2^11 - 2^1 */ fe25519_square(&t,&z2_10_0); - /* 2^20 - 2^10 */ for (i = 1;i < 10;i++) { fe25519_square(&t,&t); } - /* 2^20 - 2^0 */ fe25519_mul(&z2_20_0,&t,&z2_10_0); - - /* 2^21 - 2^1 */ fe25519_square(&t,&z2_20_0); - /* 2^40 - 2^20 */ for (i = 1;i < 20;i++) { fe25519_square(&t,&t); } - /* 2^40 - 2^0 */ fe25519_mul(&t,&t,&z2_20_0); - - /* 2^41 - 2^1 */ fe25519_square(&t,&t); - /* 2^50 - 2^10 */ for (i = 1;i < 10;i++) { fe25519_square(&t,&t); } - /* 2^50 - 2^0 */ fe25519_mul(&z2_50_0,&t,&z2_10_0); - - /* 2^51 - 2^1 */ fe25519_square(&t,&z2_50_0); - /* 2^100 - 2^50 */ for (i = 1;i < 50;i++) { fe25519_square(&t,&t); } - /* 2^100 - 2^0 */ fe25519_mul(&z2_100_0,&t,&z2_50_0); - - /* 2^101 - 2^1 */ fe25519_square(&t,&z2_100_0); - /* 2^200 - 2^100 */ for (i = 1;i < 100;i++) { fe25519_square(&t,&t); } - /* 2^200 - 2^0 */ fe25519_mul(&t,&t,&z2_100_0); - - /* 2^201 - 2^1 */ fe25519_square(&t,&t); - /* 2^250 - 2^50 */ for (i = 1;i < 50;i++) { fe25519_square(&t,&t); } - /* 2^250 - 2^0 */ fe25519_mul(&t,&t,&z2_50_0); - - /* 2^251 - 2^1 */ fe25519_square(&t,&t); - /* 2^252 - 2^2 */ fe25519_square(&t,&t); - /* 2^252 - 3 */ fe25519_mul(r,&t,x); -} diff --git a/src/libnacl/crypto_sign/ed25519/ref/fe25519.h b/src/libnacl/crypto_sign/ed25519/ref/fe25519.h deleted file mode 100644 index 4a449142..00000000 --- a/src/libnacl/crypto_sign/ed25519/ref/fe25519.h +++ /dev/null @@ -1,62 +0,0 @@ -#ifndef FE25519_H -#define FE25519_H - -#include "crypto_uint32.h" - -#define fe25519 crypto_sign_ed25519_ref_fe25519 -#define fe25519_freeze crypto_sign_ed25519_ref_fe25519_freeze -#define fe25519_unpack crypto_sign_ed25519_ref_fe25519_unpack -#define fe25519_pack crypto_sign_ed25519_ref_fe25519_pack -#define fe25519_iszero crypto_sign_ed25519_ref_fe25519_iszero -#define fe25519_iseq_vartime crypto_sign_ed25519_ref_fe25519_iseq_vartime -#define fe25519_cmov crypto_sign_ed25519_ref_fe25519_cmov -#define fe25519_setone crypto_sign_ed25519_ref_fe25519_setone -#define fe25519_setzero crypto_sign_ed25519_ref_fe25519_setzero -#define fe25519_neg crypto_sign_ed25519_ref_fe25519_neg -#define fe25519_getparity crypto_sign_ed25519_ref_fe25519_getparity -#define fe25519_add crypto_sign_ed25519_ref_fe25519_add -#define fe25519_sub crypto_sign_ed25519_ref_fe25519_sub -#define fe25519_mul crypto_sign_ed25519_ref_fe25519_mul -#define fe25519_square crypto_sign_ed25519_ref_fe25519_square -#define fe25519_invert crypto_sign_ed25519_ref_fe25519_invert -#define fe25519_pow2523 crypto_sign_ed25519_ref_fe25519_pow2523 - -typedef struct -{ - crypto_uint32 v[32]; -} -fe25519; - -void fe25519_freeze(fe25519 *r); - -void fe25519_unpack(fe25519 *r, const unsigned char x[32]); - -void fe25519_pack(unsigned char r[32], const fe25519 *x); - -int fe25519_iszero(const fe25519 *x); - -int fe25519_iseq_vartime(const fe25519 *x, const fe25519 *y); - -void fe25519_cmov(fe25519 *r, const fe25519 *x, unsigned char b); - -void fe25519_setone(fe25519 *r); - -void fe25519_setzero(fe25519 *r); - -void fe25519_neg(fe25519 *r, const fe25519 *x); - -unsigned char fe25519_getparity(const fe25519 *x); - -void fe25519_add(fe25519 *r, const fe25519 *x, const fe25519 *y); - -void fe25519_sub(fe25519 *r, const fe25519 *x, const fe25519 *y); - -void fe25519_mul(fe25519 *r, const fe25519 *x, const fe25519 *y); - -void fe25519_square(fe25519 *r, const fe25519 *x); - -void fe25519_invert(fe25519 *r, const fe25519 *x); - -void fe25519_pow2523(fe25519 *r, const fe25519 *x); - -#endif diff --git a/src/libnacl/crypto_sign/ed25519/ref/ge25519.c b/src/libnacl/crypto_sign/ed25519/ref/ge25519.c deleted file mode 100644 index 7bc6c48b..00000000 --- a/src/libnacl/crypto_sign/ed25519/ref/ge25519.c +++ /dev/null @@ -1,310 +0,0 @@ -#include "fe25519.h" -#include "sc25519.h" -#include "ge25519.h" - -/* - * Arithmetic on the twisted Edwards curve -x^2 + y^2 = 1 + dx^2y^2 - * with d = -(121665/121666) = 37095705934669439343138083508754565189542113879843219016388785533085940283555 - * Base point: (15112221349535400772501151409588531511454012693041857206046113283949847762202,46316835694926478169428394003475163141307993866256225615783033603165251855960); - */ - -/* d */ -static const fe25519 ge25519_ecd = {{0xA3, 0x78, 0x59, 0x13, 0xCA, 0x4D, 0xEB, 0x75, 0xAB, 0xD8, 0x41, 0x41, 0x4D, 0x0A, 0x70, 0x00, - 0x98, 0xE8, 0x79, 0x77, 0x79, 0x40, 0xC7, 0x8C, 0x73, 0xFE, 0x6F, 0x2B, 0xEE, 0x6C, 0x03, 0x52}}; -/* 2*d */ -static const fe25519 ge25519_ec2d = {{0x59, 0xF1, 0xB2, 0x26, 0x94, 0x9B, 0xD6, 0xEB, 0x56, 0xB1, 0x83, 0x82, 0x9A, 0x14, 0xE0, 0x00, - 0x30, 0xD1, 0xF3, 0xEE, 0xF2, 0x80, 0x8E, 0x19, 0xE7, 0xFC, 0xDF, 0x56, 0xDC, 0xD9, 0x06, 0x24}}; -/* sqrt(-1) */ -static const fe25519 ge25519_sqrtm1 = {{0xB0, 0xA0, 0x0E, 0x4A, 0x27, 0x1B, 0xEE, 0xC4, 0x78, 0xE4, 0x2F, 0xAD, 0x06, 0x18, 0x43, 0x2F, - 0xA7, 0xD7, 0xFB, 0x3D, 0x99, 0x00, 0x4D, 0x2B, 0x0B, 0xDF, 0xC1, 0x4F, 0x80, 0x24, 0x83, 0x2B}}; - -#define ge25519_p3 ge25519 - -typedef struct -{ - fe25519 x; - fe25519 z; - fe25519 y; - fe25519 t; -} ge25519_p1p1; - -typedef struct -{ - fe25519 x; - fe25519 y; - fe25519 z; -} ge25519_p2; - -typedef struct -{ - fe25519 x; - fe25519 y; -} ge25519_aff; - - -/* Packed coordinates of the base point */ -const ge25519 ge25519_base = {{{0x1A, 0xD5, 0x25, 0x8F, 0x60, 0x2D, 0x56, 0xC9, 0xB2, 0xA7, 0x25, 0x95, 0x60, 0xC7, 0x2C, 0x69, - 0x5C, 0xDC, 0xD6, 0xFD, 0x31, 0xE2, 0xA4, 0xC0, 0xFE, 0x53, 0x6E, 0xCD, 0xD3, 0x36, 0x69, 0x21}}, - {{0x58, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, - 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66}}, - {{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, - {{0xA3, 0xDD, 0xB7, 0xA5, 0xB3, 0x8A, 0xDE, 0x6D, 0xF5, 0x52, 0x51, 0x77, 0x80, 0x9F, 0xF0, 0x20, - 0x7D, 0xE3, 0xAB, 0x64, 0x8E, 0x4E, 0xEA, 0x66, 0x65, 0x76, 0x8B, 0xD7, 0x0F, 0x5F, 0x87, 0x67}}}; - -/* Multiples of the base point in affine representation */ -static const ge25519_aff ge25519_base_multiples_affine[425] = { -#include "ge25519_base.data" -}; - -static void p1p1_to_p2(ge25519_p2 *r, const ge25519_p1p1 *p) -{ - fe25519_mul(&r->x, &p->x, &p->t); - fe25519_mul(&r->y, &p->y, &p->z); - fe25519_mul(&r->z, &p->z, &p->t); -} - -static void p1p1_to_p3(ge25519_p3 *r, const ge25519_p1p1 *p) -{ - p1p1_to_p2((ge25519_p2 *)r, p); - fe25519_mul(&r->t, &p->x, &p->y); -} - -static void ge25519_mixadd2(ge25519_p3 *r, const ge25519_aff *q) -{ - fe25519 a,b,t1,t2,c,d,e,f,g,h,qt; - fe25519_mul(&qt, &q->x, &q->y); - fe25519_sub(&a, &r->y, &r->x); /* A = (Y1-X1)*(Y2-X2) */ - fe25519_add(&b, &r->y, &r->x); /* B = (Y1+X1)*(Y2+X2) */ - fe25519_sub(&t1, &q->y, &q->x); - fe25519_add(&t2, &q->y, &q->x); - fe25519_mul(&a, &a, &t1); - fe25519_mul(&b, &b, &t2); - fe25519_sub(&e, &b, &a); /* E = B-A */ - fe25519_add(&h, &b, &a); /* H = B+A */ - fe25519_mul(&c, &r->t, &qt); /* C = T1*k*T2 */ - fe25519_mul(&c, &c, &ge25519_ec2d); - fe25519_add(&d, &r->z, &r->z); /* D = Z1*2 */ - fe25519_sub(&f, &d, &c); /* F = D-C */ - fe25519_add(&g, &d, &c); /* G = D+C */ - fe25519_mul(&r->x, &e, &f); - fe25519_mul(&r->y, &h, &g); - fe25519_mul(&r->z, &g, &f); - fe25519_mul(&r->t, &e, &h); -} - -static void add_p1p1(ge25519_p1p1 *r, const ge25519_p3 *p, const ge25519_p3 *q) -{ - fe25519 a, b, c, d, t; - - fe25519_sub(&a, &p->y, &p->x); /* A = (Y1-X1)*(Y2-X2) */ - fe25519_sub(&t, &q->y, &q->x); - fe25519_mul(&a, &a, &t); - fe25519_add(&b, &p->x, &p->y); /* B = (Y1+X1)*(Y2+X2) */ - fe25519_add(&t, &q->x, &q->y); - fe25519_mul(&b, &b, &t); - fe25519_mul(&c, &p->t, &q->t); /* C = T1*k*T2 */ - fe25519_mul(&c, &c, &ge25519_ec2d); - fe25519_mul(&d, &p->z, &q->z); /* D = Z1*2*Z2 */ - fe25519_add(&d, &d, &d); - fe25519_sub(&r->x, &b, &a); /* E = B-A */ - fe25519_sub(&r->t, &d, &c); /* F = D-C */ - fe25519_add(&r->z, &d, &c); /* G = D+C */ - fe25519_add(&r->y, &b, &a); /* H = B+A */ -} - -/* See http://www.hyperelliptic.org/EFD/g1p/auto-twisted-extended-1.html#doubling-dbl-2008-hwcd */ -static void dbl_p1p1(ge25519_p1p1 *r, const ge25519_p2 *p) -{ - fe25519 a,b,c,d; - fe25519_square(&a, &p->x); - fe25519_square(&b, &p->y); - fe25519_square(&c, &p->z); - fe25519_add(&c, &c, &c); - fe25519_neg(&d, &a); - - fe25519_add(&r->x, &p->x, &p->y); - fe25519_square(&r->x, &r->x); - fe25519_sub(&r->x, &r->x, &a); - fe25519_sub(&r->x, &r->x, &b); - fe25519_add(&r->z, &d, &b); - fe25519_sub(&r->t, &r->z, &c); - fe25519_sub(&r->y, &d, &b); -} - -/* Constant-time version of: if(b) r = p */ -static void cmov_aff(ge25519_aff *r, const ge25519_aff *p, unsigned char b) -{ - fe25519_cmov(&r->x, &p->x, b); - fe25519_cmov(&r->y, &p->y, b); -} - -static unsigned char equal(signed char b,signed char c) -{ - unsigned char ub = b; - unsigned char uc = c; - unsigned char x = ub ^ uc; /* 0: yes; 1..255: no */ - crypto_uint32 y = x; /* 0: yes; 1..255: no */ - y -= 1; /* 4294967295: yes; 0..254: no */ - y >>= 31; /* 1: yes; 0: no */ - return y; -} - -static unsigned char negative(signed char b) -{ - unsigned long long x = b; /* 18446744073709551361..18446744073709551615: yes; 0..255: no */ - x >>= 63; /* 1: yes; 0: no */ - return x; -} - -static void choose_t(ge25519_aff *t, unsigned long long pos, signed char b) -{ - /* constant time */ - fe25519 v; - *t = ge25519_base_multiples_affine[5*pos+0]; - cmov_aff(t, &ge25519_base_multiples_affine[5*pos+1],equal(b,1) | equal(b,-1)); - cmov_aff(t, &ge25519_base_multiples_affine[5*pos+2],equal(b,2) | equal(b,-2)); - cmov_aff(t, &ge25519_base_multiples_affine[5*pos+3],equal(b,3) | equal(b,-3)); - cmov_aff(t, &ge25519_base_multiples_affine[5*pos+4],equal(b,-4)); - fe25519_neg(&v, &t->x); - fe25519_cmov(&t->x, &v, negative(b)); -} - -static void setneutral(ge25519 *r) -{ - fe25519_setzero(&r->x); - fe25519_setone(&r->y); - fe25519_setone(&r->z); - fe25519_setzero(&r->t); -} - -/* ******************************************************************** - * EXPORTED FUNCTIONS - ******************************************************************** */ - -/* return 0 on success, -1 otherwise */ -int ge25519_unpackneg_vartime(ge25519_p3 *r, const unsigned char p[32]) -{ - fe25519 t, chk, num, den, den2, den4, den6; - fe25519_setone(&r->z); - unsigned char par = p[31] >> 7; - fe25519_unpack(&r->y, p); - fe25519_square(&num, &r->y); /* x = y^2 */ - fe25519_mul(&den, &num, &ge25519_ecd); /* den = dy^2 */ - fe25519_sub(&num, &num, &r->z); /* x = y^2-1 */ - fe25519_add(&den, &r->z, &den); /* den = dy^2+1 */ - - /* Computation of sqrt(num/den) */ - /* 1.: computation of num^((p-5)/8)*den^((7p-35)/8) = (num*den^7)^((p-5)/8) */ - fe25519_square(&den2, &den); - fe25519_square(&den4, &den2); - fe25519_mul(&den6, &den4, &den2); - fe25519_mul(&t, &den6, &num); - fe25519_mul(&t, &t, &den); - - fe25519_pow2523(&t, &t); - /* 2. computation of r->x = t * num * den^3 */ - fe25519_mul(&t, &t, &num); - fe25519_mul(&t, &t, &den); - fe25519_mul(&t, &t, &den); - fe25519_mul(&r->x, &t, &den); - - /* 3. Check whether sqrt computation gave correct result, multiply by sqrt(-1) if not: */ - fe25519_square(&chk, &r->x); - fe25519_mul(&chk, &chk, &den); - if (!fe25519_iseq_vartime(&chk, &num)) - fe25519_mul(&r->x, &r->x, &ge25519_sqrtm1); - - /* 4. Now we have one of the two square roots, except if input was not a square */ - fe25519_square(&chk, &r->x); - fe25519_mul(&chk, &chk, &den); - if (!fe25519_iseq_vartime(&chk, &num)) - return -1; - - /* 5. Choose the desired square root according to parity: */ - if(fe25519_getparity(&r->x) != (1-par)) - fe25519_neg(&r->x, &r->x); - - fe25519_mul(&r->t, &r->x, &r->y); - return 0; -} - -void ge25519_pack(unsigned char r[32], const ge25519_p3 *p) -{ - fe25519 tx, ty, zi; - fe25519_invert(&zi, &p->z); - fe25519_mul(&tx, &p->x, &zi); - fe25519_mul(&ty, &p->y, &zi); - fe25519_pack(r, &ty); - r[31] ^= fe25519_getparity(&tx) << 7; -} - -int ge25519_isneutral_vartime(const ge25519_p3 *p) -{ - int ret = 1; - if(!fe25519_iszero(&p->x)) ret = 0; - if(!fe25519_iseq_vartime(&p->y, &p->z)) ret = 0; - return ret; -} - -/* computes [s1]p1 + [s2]p2 */ -void ge25519_double_scalarmult_vartime(ge25519_p3 *r, const ge25519_p3 *p1, const sc25519 *s1, const ge25519_p3 *p2, const sc25519 *s2) -{ - ge25519_p1p1 tp1p1; - ge25519_p3 pre[16]; - unsigned char b[127]; - - /* precomputation s2 s1 */ - setneutral(pre); /* 00 00 */ - pre[1] = *p1; /* 00 01 */ - dbl_p1p1(&tp1p1,(ge25519_p2 *)p1); p1p1_to_p3( &pre[2], &tp1p1); /* 00 10 */ - add_p1p1(&tp1p1,&pre[1], &pre[2]); p1p1_to_p3( &pre[3], &tp1p1); /* 00 11 */ - pre[4] = *p2; /* 01 00 */ - add_p1p1(&tp1p1,&pre[1], &pre[4]); p1p1_to_p3( &pre[5], &tp1p1); /* 01 01 */ - add_p1p1(&tp1p1,&pre[2], &pre[4]); p1p1_to_p3( &pre[6], &tp1p1); /* 01 10 */ - add_p1p1(&tp1p1,&pre[3], &pre[4]); p1p1_to_p3( &pre[7], &tp1p1); /* 01 11 */ - dbl_p1p1(&tp1p1,(ge25519_p2 *)p2); p1p1_to_p3( &pre[8], &tp1p1); /* 10 00 */ - add_p1p1(&tp1p1,&pre[1], &pre[8]); p1p1_to_p3( &pre[9], &tp1p1); /* 10 01 */ - dbl_p1p1(&tp1p1,(ge25519_p2 *)&pre[5]); p1p1_to_p3(&pre[10], &tp1p1); /* 10 10 */ - add_p1p1(&tp1p1,&pre[3], &pre[8]); p1p1_to_p3(&pre[11], &tp1p1); /* 10 11 */ - add_p1p1(&tp1p1,&pre[4], &pre[8]); p1p1_to_p3(&pre[12], &tp1p1); /* 11 00 */ - add_p1p1(&tp1p1,&pre[1],&pre[12]); p1p1_to_p3(&pre[13], &tp1p1); /* 11 01 */ - add_p1p1(&tp1p1,&pre[2],&pre[12]); p1p1_to_p3(&pre[14], &tp1p1); /* 11 10 */ - add_p1p1(&tp1p1,&pre[3],&pre[12]); p1p1_to_p3(&pre[15], &tp1p1); /* 11 11 */ - - sc25519_2interleave2(b,s1,s2); - - /* scalar multiplication */ - *r = pre[b[126]]; - int i; - for(i=125;i>=0;i--) - { - dbl_p1p1(&tp1p1, (ge25519_p2 *)r); - p1p1_to_p2((ge25519_p2 *) r, &tp1p1); - dbl_p1p1(&tp1p1, (ge25519_p2 *)r); - if(b[i]!=0) - { - p1p1_to_p3(r, &tp1p1); - add_p1p1(&tp1p1, r, &pre[b[i]]); - } - if(i != 0) p1p1_to_p2((ge25519_p2 *)r, &tp1p1); - else p1p1_to_p3(r, &tp1p1); - } -} - -void ge25519_scalarmult_base(ge25519_p3 *r, const sc25519 *s) -{ - signed char b[85]; - int i; - ge25519_aff t; - sc25519_window3(b,s); - - choose_t((ge25519_aff *)r, 0, b[0]); - fe25519_setone(&r->z); - fe25519_mul(&r->t, &r->x, &r->y); - for(i=1;i<85;i++) - { - choose_t(&t, (unsigned long long) i, b[i]); - ge25519_mixadd2(r, &t); - } -} diff --git a/src/libnacl/crypto_sign/ed25519/ref/ge25519.h b/src/libnacl/crypto_sign/ed25519/ref/ge25519.h deleted file mode 100644 index 3820492b..00000000 --- a/src/libnacl/crypto_sign/ed25519/ref/ge25519.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef GE25519_H -#define GE25519_H - -#include "fe25519.h" -#include "sc25519.h" - -#define ge25519 crypto_sign_ed25519_ref_ge25519 -#define ge25519_base crypto_sign_ed25519_ref_ge25519_base -#define ge25519_unpackneg_vartime crypto_sign_ed25519_ref_unpackneg_vartime -#define ge25519_pack crypto_sign_ed25519_ref_pack -#define ge25519_isneutral_vartime crypto_sign_ed25519_ref_isneutral_vartime -#define ge25519_double_scalarmult_vartime crypto_sign_ed25519_ref_double_scalarmult_vartime -#define ge25519_scalarmult_base crypto_sign_ed25519_ref_scalarmult_base - -typedef struct -{ - fe25519 x; - fe25519 y; - fe25519 z; - fe25519 t; -} ge25519; - -const ge25519 ge25519_base; - -int ge25519_unpackneg_vartime(ge25519 *r, const unsigned char p[32]); - -void ge25519_pack(unsigned char r[32], const ge25519 *p); - -int ge25519_isneutral_vartime(const ge25519 *p); - -void ge25519_double_scalarmult_vartime(ge25519 *r, const ge25519 *p1, const sc25519 *s1, const ge25519 *p2, const sc25519 *s2); - -void ge25519_scalarmult_base(ge25519 *r, const sc25519 *s); - -#endif diff --git a/src/libnacl/crypto_sign/ed25519/ref/ge25519_base.data b/src/libnacl/crypto_sign/ed25519/ref/ge25519_base.data deleted file mode 100644 index d2ef2c13..00000000 --- a/src/libnacl/crypto_sign/ed25519/ref/ge25519_base.data +++ /dev/null @@ -1,850 +0,0 @@ -{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, - {{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, -{{{0x1a, 0xd5, 0x25, 0x8f, 0x60, 0x2d, 0x56, 0xc9, 0xb2, 0xa7, 0x25, 0x95, 0x60, 0xc7, 0x2c, 0x69, 0x5c, 0xdc, 0xd6, 0xfd, 0x31, 0xe2, 0xa4, 0xc0, 0xfe, 0x53, 0x6e, 0xcd, 0xd3, 0x36, 0x69, 0x21}} , - {{0x58, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66}}}, -{{{0x0e, 0xce, 0x43, 0x28, 0x4e, 0xa1, 0xc5, 0x83, 0x5f, 0xa4, 0xd7, 0x15, 0x45, 0x8e, 0x0d, 0x08, 0xac, 0xe7, 0x33, 0x18, 0x7d, 0x3b, 0x04, 0x3d, 0x6c, 0x04, 0x5a, 0x9f, 0x4c, 0x38, 0xab, 0x36}} , - {{0xc9, 0xa3, 0xf8, 0x6a, 0xae, 0x46, 0x5f, 0x0e, 0x56, 0x51, 0x38, 0x64, 0x51, 0x0f, 0x39, 0x97, 0x56, 0x1f, 0xa2, 0xc9, 0xe8, 0x5e, 0xa2, 0x1d, 0xc2, 0x29, 0x23, 0x09, 0xf3, 0xcd, 0x60, 0x22}}}, -{{{0x5c, 0xe2, 0xf8, 0xd3, 0x5f, 0x48, 0x62, 0xac, 0x86, 0x48, 0x62, 0x81, 0x19, 0x98, 0x43, 0x63, 0x3a, 0xc8, 0xda, 0x3e, 0x74, 0xae, 0xf4, 0x1f, 0x49, 0x8f, 0x92, 0x22, 0x4a, 0x9c, 0xae, 0x67}} , - {{0xd4, 0xb4, 0xf5, 0x78, 0x48, 0x68, 0xc3, 0x02, 0x04, 0x03, 0x24, 0x67, 0x17, 0xec, 0x16, 0x9f, 0xf7, 0x9e, 0x26, 0x60, 0x8e, 0xa1, 0x26, 0xa1, 0xab, 0x69, 0xee, 0x77, 0xd1, 0xb1, 0x67, 0x12}}}, -{{{0x70, 0xf8, 0xc9, 0xc4, 0x57, 0xa6, 0x3a, 0x49, 0x47, 0x15, 0xce, 0x93, 0xc1, 0x9e, 0x73, 0x1a, 0xf9, 0x20, 0x35, 0x7a, 0xb8, 0xd4, 0x25, 0x83, 0x46, 0xf1, 0xcf, 0x56, 0xdb, 0xa8, 0x3d, 0x20}} , - {{0x2f, 0x11, 0x32, 0xca, 0x61, 0xab, 0x38, 0xdf, 0xf0, 0x0f, 0x2f, 0xea, 0x32, 0x28, 0xf2, 0x4c, 0x6c, 0x71, 0xd5, 0x80, 0x85, 0xb8, 0x0e, 0x47, 0xe1, 0x95, 0x15, 0xcb, 0x27, 0xe8, 0xd0, 0x47}}}, -{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, - {{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, -{{{0xc8, 0x84, 0xa5, 0x08, 0xbc, 0xfd, 0x87, 0x3b, 0x99, 0x8b, 0x69, 0x80, 0x7b, 0xc6, 0x3a, 0xeb, 0x93, 0xcf, 0x4e, 0xf8, 0x5c, 0x2d, 0x86, 0x42, 0xb6, 0x71, 0xd7, 0x97, 0x5f, 0xe1, 0x42, 0x67}} , - {{0xb4, 0xb9, 0x37, 0xfc, 0xa9, 0x5b, 0x2f, 0x1e, 0x93, 0xe4, 0x1e, 0x62, 0xfc, 0x3c, 0x78, 0x81, 0x8f, 0xf3, 0x8a, 0x66, 0x09, 0x6f, 0xad, 0x6e, 0x79, 0x73, 0xe5, 0xc9, 0x00, 0x06, 0xd3, 0x21}}}, -{{{0xf8, 0xf9, 0x28, 0x6c, 0x6d, 0x59, 0xb2, 0x59, 0x74, 0x23, 0xbf, 0xe7, 0x33, 0x8d, 0x57, 0x09, 0x91, 0x9c, 0x24, 0x08, 0x15, 0x2b, 0xe2, 0xb8, 0xee, 0x3a, 0xe5, 0x27, 0x06, 0x86, 0xa4, 0x23}} , - {{0xeb, 0x27, 0x67, 0xc1, 0x37, 0xab, 0x7a, 0xd8, 0x27, 0x9c, 0x07, 0x8e, 0xff, 0x11, 0x6a, 0xb0, 0x78, 0x6e, 0xad, 0x3a, 0x2e, 0x0f, 0x98, 0x9f, 0x72, 0xc3, 0x7f, 0x82, 0xf2, 0x96, 0x96, 0x70}}}, -{{{0x81, 0x6b, 0x88, 0xe8, 0x1e, 0xc7, 0x77, 0x96, 0x0e, 0xa1, 0xa9, 0x52, 0xe0, 0xd8, 0x0e, 0x61, 0x9e, 0x79, 0x2d, 0x95, 0x9c, 0x8d, 0x96, 0xe0, 0x06, 0x40, 0x5d, 0x87, 0x28, 0x5f, 0x98, 0x70}} , - {{0xf1, 0x79, 0x7b, 0xed, 0x4f, 0x44, 0xb2, 0xe7, 0x08, 0x0d, 0xc2, 0x08, 0x12, 0xd2, 0x9f, 0xdf, 0xcd, 0x93, 0x20, 0x8a, 0xcf, 0x33, 0xca, 0x6d, 0x89, 0xb9, 0x77, 0xc8, 0x93, 0x1b, 0x4e, 0x60}}}, -{{{0x26, 0x4f, 0x7e, 0x97, 0xf6, 0x40, 0xdd, 0x4f, 0xfc, 0x52, 0x78, 0xf9, 0x90, 0x31, 0x03, 0xe6, 0x7d, 0x56, 0x39, 0x0b, 0x1d, 0x56, 0x82, 0x85, 0xf9, 0x1a, 0x42, 0x17, 0x69, 0x6c, 0xcf, 0x39}} , - {{0x69, 0xd2, 0x06, 0x3a, 0x4f, 0x39, 0x2d, 0xf9, 0x38, 0x40, 0x8c, 0x4c, 0xe7, 0x05, 0x12, 0xb4, 0x78, 0x8b, 0xf8, 0xc0, 0xec, 0x93, 0xde, 0x7a, 0x6b, 0xce, 0x2c, 0xe1, 0x0e, 0xa9, 0x34, 0x44}}}, -{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, - {{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, -{{{0x0b, 0xa4, 0x3c, 0xb0, 0x0f, 0x7a, 0x51, 0xf1, 0x78, 0xd6, 0xd9, 0x6a, 0xfd, 0x46, 0xe8, 0xb8, 0xa8, 0x79, 0x1d, 0x87, 0xf9, 0x90, 0xf2, 0x9c, 0x13, 0x29, 0xf8, 0x0b, 0x20, 0x64, 0xfa, 0x05}} , - {{0x26, 0x09, 0xda, 0x17, 0xaf, 0x95, 0xd6, 0xfb, 0x6a, 0x19, 0x0d, 0x6e, 0x5e, 0x12, 0xf1, 0x99, 0x4c, 0xaa, 0xa8, 0x6f, 0x79, 0x86, 0xf4, 0x72, 0x28, 0x00, 0x26, 0xf9, 0xea, 0x9e, 0x19, 0x3d}}}, -{{{0x87, 0xdd, 0xcf, 0xf0, 0x5b, 0x49, 0xa2, 0x5d, 0x40, 0x7a, 0x23, 0x26, 0xa4, 0x7a, 0x83, 0x8a, 0xb7, 0x8b, 0xd2, 0x1a, 0xbf, 0xea, 0x02, 0x24, 0x08, 0x5f, 0x7b, 0xa9, 0xb1, 0xbe, 0x9d, 0x37}} , - {{0xfc, 0x86, 0x4b, 0x08, 0xee, 0xe7, 0xa0, 0xfd, 0x21, 0x45, 0x09, 0x34, 0xc1, 0x61, 0x32, 0x23, 0xfc, 0x9b, 0x55, 0x48, 0x53, 0x99, 0xf7, 0x63, 0xd0, 0x99, 0xce, 0x01, 0xe0, 0x9f, 0xeb, 0x28}}}, -{{{0x47, 0xfc, 0xab, 0x5a, 0x17, 0xf0, 0x85, 0x56, 0x3a, 0x30, 0x86, 0x20, 0x28, 0x4b, 0x8e, 0x44, 0x74, 0x3a, 0x6e, 0x02, 0xf1, 0x32, 0x8f, 0x9f, 0x3f, 0x08, 0x35, 0xe9, 0xca, 0x16, 0x5f, 0x6e}} , - {{0x1c, 0x59, 0x1c, 0x65, 0x5d, 0x34, 0xa4, 0x09, 0xcd, 0x13, 0x9c, 0x70, 0x7d, 0xb1, 0x2a, 0xc5, 0x88, 0xaf, 0x0b, 0x60, 0xc7, 0x9f, 0x34, 0x8d, 0xd6, 0xb7, 0x7f, 0xea, 0x78, 0x65, 0x8d, 0x77}}}, -{{{0x56, 0xa5, 0xc2, 0x0c, 0xdd, 0xbc, 0xb8, 0x20, 0x6d, 0x57, 0x61, 0xb5, 0xfb, 0x78, 0xb5, 0xd4, 0x49, 0x54, 0x90, 0x26, 0xc1, 0xcb, 0xe9, 0xe6, 0xbf, 0xec, 0x1d, 0x4e, 0xed, 0x07, 0x7e, 0x5e}} , - {{0xc7, 0xf6, 0x6c, 0x56, 0x31, 0x20, 0x14, 0x0e, 0xa8, 0xd9, 0x27, 0xc1, 0x9a, 0x3d, 0x1b, 0x7d, 0x0e, 0x26, 0xd3, 0x81, 0xaa, 0xeb, 0xf5, 0x6b, 0x79, 0x02, 0xf1, 0x51, 0x5c, 0x75, 0x55, 0x0f}}}, -{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, - {{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, -{{{0x0a, 0x34, 0xcd, 0x82, 0x3c, 0x33, 0x09, 0x54, 0xd2, 0x61, 0x39, 0x30, 0x9b, 0xfd, 0xef, 0x21, 0x26, 0xd4, 0x70, 0xfa, 0xee, 0xf9, 0x31, 0x33, 0x73, 0x84, 0xd0, 0xb3, 0x81, 0xbf, 0xec, 0x2e}} , - {{0xe8, 0x93, 0x8b, 0x00, 0x64, 0xf7, 0x9c, 0xb8, 0x74, 0xe0, 0xe6, 0x49, 0x48, 0x4d, 0x4d, 0x48, 0xb6, 0x19, 0xa1, 0x40, 0xb7, 0xd9, 0x32, 0x41, 0x7c, 0x82, 0x37, 0xa1, 0x2d, 0xdc, 0xd2, 0x54}}}, -{{{0x68, 0x2b, 0x4a, 0x5b, 0xd5, 0xc7, 0x51, 0x91, 0x1d, 0xe1, 0x2a, 0x4b, 0xc4, 0x47, 0xf1, 0xbc, 0x7a, 0xb3, 0xcb, 0xc8, 0xb6, 0x7c, 0xac, 0x90, 0x05, 0xfd, 0xf3, 0xf9, 0x52, 0x3a, 0x11, 0x6b}} , - {{0x3d, 0xc1, 0x27, 0xf3, 0x59, 0x43, 0x95, 0x90, 0xc5, 0x96, 0x79, 0xf5, 0xf4, 0x95, 0x65, 0x29, 0x06, 0x9c, 0x51, 0x05, 0x18, 0xda, 0xb8, 0x2e, 0x79, 0x7e, 0x69, 0x59, 0x71, 0x01, 0xeb, 0x1a}}}, -{{{0x15, 0x06, 0x49, 0xb6, 0x8a, 0x3c, 0xea, 0x2f, 0x34, 0x20, 0x14, 0xc3, 0xaa, 0xd6, 0xaf, 0x2c, 0x3e, 0xbd, 0x65, 0x20, 0xe2, 0x4d, 0x4b, 0x3b, 0xeb, 0x9f, 0x4a, 0xc3, 0xad, 0xa4, 0x3b, 0x60}} , - {{0xbc, 0x58, 0xe6, 0xc0, 0x95, 0x2a, 0x2a, 0x81, 0x9a, 0x7a, 0xf3, 0xd2, 0x06, 0xbe, 0x48, 0xbc, 0x0c, 0xc5, 0x46, 0xe0, 0x6a, 0xd4, 0xac, 0x0f, 0xd9, 0xcc, 0x82, 0x34, 0x2c, 0xaf, 0xdb, 0x1f}}}, -{{{0xf7, 0x17, 0x13, 0xbd, 0xfb, 0xbc, 0xd2, 0xec, 0x45, 0xb3, 0x15, 0x31, 0xe9, 0xaf, 0x82, 0x84, 0x3d, 0x28, 0xc6, 0xfc, 0x11, 0xf5, 0x41, 0xb5, 0x8b, 0xd3, 0x12, 0x76, 0x52, 0xe7, 0x1a, 0x3c}} , - {{0x4e, 0x36, 0x11, 0x07, 0xa2, 0x15, 0x20, 0x51, 0xc4, 0x2a, 0xc3, 0x62, 0x8b, 0x5e, 0x7f, 0xa6, 0x0f, 0xf9, 0x45, 0x85, 0x6c, 0x11, 0x86, 0xb7, 0x7e, 0xe5, 0xd7, 0xf9, 0xc3, 0x91, 0x1c, 0x05}}}, -{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, - {{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, -{{{0xea, 0xd6, 0xde, 0x29, 0x3a, 0x00, 0xb9, 0x02, 0x59, 0xcb, 0x26, 0xc4, 0xba, 0x99, 0xb1, 0x97, 0x2f, 0x8e, 0x00, 0x92, 0x26, 0x4f, 0x52, 0xeb, 0x47, 0x1b, 0x89, 0x8b, 0x24, 0xc0, 0x13, 0x7d}} , - {{0xd5, 0x20, 0x5b, 0x80, 0xa6, 0x80, 0x20, 0x95, 0xc3, 0xe9, 0x9f, 0x8e, 0x87, 0x9e, 0x1e, 0x9e, 0x7a, 0xc7, 0xcc, 0x75, 0x6c, 0xa5, 0xf1, 0x91, 0x1a, 0xa8, 0x01, 0x2c, 0xab, 0x76, 0xa9, 0x59}}}, -{{{0xde, 0xc9, 0xb1, 0x31, 0x10, 0x16, 0xaa, 0x35, 0x14, 0x6a, 0xd4, 0xb5, 0x34, 0x82, 0x71, 0xd2, 0x4a, 0x5d, 0x9a, 0x1f, 0x53, 0x26, 0x3c, 0xe5, 0x8e, 0x8d, 0x33, 0x7f, 0xff, 0xa9, 0xd5, 0x17}} , - {{0x89, 0xaf, 0xf6, 0xa4, 0x64, 0xd5, 0x10, 0xe0, 0x1d, 0xad, 0xef, 0x44, 0xbd, 0xda, 0x83, 0xac, 0x7a, 0xa8, 0xf0, 0x1c, 0x07, 0xf9, 0xc3, 0x43, 0x6c, 0x3f, 0xb7, 0xd3, 0x87, 0x22, 0x02, 0x73}}}, -{{{0x64, 0x1d, 0x49, 0x13, 0x2f, 0x71, 0xec, 0x69, 0x87, 0xd0, 0x42, 0xee, 0x13, 0xec, 0xe3, 0xed, 0x56, 0x7b, 0xbf, 0xbd, 0x8c, 0x2f, 0x7d, 0x7b, 0x9d, 0x28, 0xec, 0x8e, 0x76, 0x2f, 0x6f, 0x08}} , - {{0x22, 0xf5, 0x5f, 0x4d, 0x15, 0xef, 0xfc, 0x4e, 0x57, 0x03, 0x36, 0x89, 0xf0, 0xeb, 0x5b, 0x91, 0xd6, 0xe2, 0xca, 0x01, 0xa5, 0xee, 0x52, 0xec, 0xa0, 0x3c, 0x8f, 0x33, 0x90, 0x5a, 0x94, 0x72}}}, -{{{0x8a, 0x4b, 0xe7, 0x38, 0xbc, 0xda, 0xc2, 0xb0, 0x85, 0xe1, 0x4a, 0xfe, 0x2d, 0x44, 0x84, 0xcb, 0x20, 0x6b, 0x2d, 0xbf, 0x11, 0x9c, 0xd7, 0xbe, 0xd3, 0x3e, 0x5f, 0xbf, 0x68, 0xbc, 0xa8, 0x07}} , - {{0x01, 0x89, 0x28, 0x22, 0x6a, 0x78, 0xaa, 0x29, 0x03, 0xc8, 0x74, 0x95, 0x03, 0x3e, 0xdc, 0xbd, 0x07, 0x13, 0xa8, 0xa2, 0x20, 0x2d, 0xb3, 0x18, 0x70, 0x42, 0xfd, 0x7a, 0xc4, 0xd7, 0x49, 0x72}}}, -{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, - {{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, -{{{0x02, 0xff, 0x32, 0x2b, 0x5c, 0x93, 0x54, 0x32, 0xe8, 0x57, 0x54, 0x1a, 0x8b, 0x33, 0x60, 0x65, 0xd3, 0x67, 0xa4, 0xc1, 0x26, 0xc4, 0xa4, 0x34, 0x1f, 0x9b, 0xa7, 0xa9, 0xf4, 0xd9, 0x4f, 0x5b}} , - {{0x46, 0x8d, 0xb0, 0x33, 0x54, 0x26, 0x5b, 0x68, 0xdf, 0xbb, 0xc5, 0xec, 0xc2, 0xf9, 0x3c, 0x5a, 0x37, 0xc1, 0x8e, 0x27, 0x47, 0xaa, 0x49, 0x5a, 0xf8, 0xfb, 0x68, 0x04, 0x23, 0xd1, 0xeb, 0x40}}}, -{{{0x65, 0xa5, 0x11, 0x84, 0x8a, 0x67, 0x9d, 0x9e, 0xd1, 0x44, 0x68, 0x7a, 0x34, 0xe1, 0x9f, 0xa3, 0x54, 0xcd, 0x07, 0xca, 0x79, 0x1f, 0x54, 0x2f, 0x13, 0x70, 0x4e, 0xee, 0xa2, 0xfa, 0xe7, 0x5d}} , - {{0x36, 0xec, 0x54, 0xf8, 0xce, 0xe4, 0x85, 0xdf, 0xf6, 0x6f, 0x1d, 0x90, 0x08, 0xbc, 0xe8, 0xc0, 0x92, 0x2d, 0x43, 0x6b, 0x92, 0xa9, 0x8e, 0xab, 0x0a, 0x2e, 0x1c, 0x1e, 0x64, 0x23, 0x9f, 0x2c}}}, -{{{0xa7, 0xd6, 0x2e, 0xd5, 0xcc, 0xd4, 0xcb, 0x5a, 0x3b, 0xa7, 0xf9, 0x46, 0x03, 0x1d, 0xad, 0x2b, 0x34, 0x31, 0x90, 0x00, 0x46, 0x08, 0x82, 0x14, 0xc4, 0xe0, 0x9c, 0xf0, 0xe3, 0x55, 0x43, 0x31}} , - {{0x60, 0xd6, 0xdd, 0x78, 0xe6, 0xd4, 0x22, 0x42, 0x1f, 0x00, 0xf9, 0xb1, 0x6a, 0x63, 0xe2, 0x92, 0x59, 0xd1, 0x1a, 0xb7, 0x00, 0x54, 0x29, 0xc9, 0xc1, 0xf6, 0x6f, 0x7a, 0xc5, 0x3c, 0x5f, 0x65}}}, -{{{0x27, 0x4f, 0xd0, 0x72, 0xb1, 0x11, 0x14, 0x27, 0x15, 0x94, 0x48, 0x81, 0x7e, 0x74, 0xd8, 0x32, 0xd5, 0xd1, 0x11, 0x28, 0x60, 0x63, 0x36, 0x32, 0x37, 0xb5, 0x13, 0x1c, 0xa0, 0x37, 0xe3, 0x74}} , - {{0xf1, 0x25, 0x4e, 0x11, 0x96, 0x67, 0xe6, 0x1c, 0xc2, 0xb2, 0x53, 0xe2, 0xda, 0x85, 0xee, 0xb2, 0x9f, 0x59, 0xf3, 0xba, 0xbd, 0xfa, 0xcf, 0x6e, 0xf9, 0xda, 0xa4, 0xb3, 0x02, 0x8f, 0x64, 0x08}}}, -{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, - {{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, -{{{0x34, 0x94, 0xf2, 0x64, 0x54, 0x47, 0x37, 0x07, 0x40, 0x8a, 0x20, 0xba, 0x4a, 0x55, 0xd7, 0x3f, 0x47, 0xba, 0x25, 0x23, 0x14, 0xb0, 0x2c, 0xe8, 0x55, 0xa8, 0xa6, 0xef, 0x51, 0xbd, 0x6f, 0x6a}} , - {{0x71, 0xd6, 0x16, 0x76, 0xb2, 0x06, 0xea, 0x79, 0xf5, 0xc4, 0xc3, 0x52, 0x7e, 0x61, 0xd1, 0xe1, 0xad, 0x70, 0x78, 0x1d, 0x16, 0x11, 0xf8, 0x7c, 0x2b, 0xfc, 0x55, 0x9f, 0x52, 0xf8, 0xf5, 0x16}}}, -{{{0x34, 0x96, 0x9a, 0xf6, 0xc5, 0xe0, 0x14, 0x03, 0x24, 0x0e, 0x4c, 0xad, 0x9e, 0x9a, 0x70, 0x23, 0x96, 0xb2, 0xf1, 0x2e, 0x9d, 0xc3, 0x32, 0x9b, 0x54, 0xa5, 0x73, 0xde, 0x88, 0xb1, 0x3e, 0x24}} , - {{0xf6, 0xe2, 0x4c, 0x1f, 0x5b, 0xb2, 0xaf, 0x82, 0xa5, 0xcf, 0x81, 0x10, 0x04, 0xef, 0xdb, 0xa2, 0xcc, 0x24, 0xb2, 0x7e, 0x0b, 0x7a, 0xeb, 0x01, 0xd8, 0x52, 0xf4, 0x51, 0x89, 0x29, 0x79, 0x37}}}, -{{{0x74, 0xde, 0x12, 0xf3, 0x68, 0xb7, 0x66, 0xc3, 0xee, 0x68, 0xdc, 0x81, 0xb5, 0x55, 0x99, 0xab, 0xd9, 0x28, 0x63, 0x6d, 0x8b, 0x40, 0x69, 0x75, 0x6c, 0xcd, 0x5c, 0x2a, 0x7e, 0x32, 0x7b, 0x29}} , - {{0x02, 0xcc, 0x22, 0x74, 0x4d, 0x19, 0x07, 0xc0, 0xda, 0xb5, 0x76, 0x51, 0x2a, 0xaa, 0xa6, 0x0a, 0x5f, 0x26, 0xd4, 0xbc, 0xaf, 0x48, 0x88, 0x7f, 0x02, 0xbc, 0xf2, 0xe1, 0xcf, 0xe9, 0xdd, 0x15}}}, -{{{0xed, 0xb5, 0x9a, 0x8c, 0x9a, 0xdd, 0x27, 0xf4, 0x7f, 0x47, 0xd9, 0x52, 0xa7, 0xcd, 0x65, 0xa5, 0x31, 0x22, 0xed, 0xa6, 0x63, 0x5b, 0x80, 0x4a, 0xad, 0x4d, 0xed, 0xbf, 0xee, 0x49, 0xb3, 0x06}} , - {{0xf8, 0x64, 0x8b, 0x60, 0x90, 0xe9, 0xde, 0x44, 0x77, 0xb9, 0x07, 0x36, 0x32, 0xc2, 0x50, 0xf5, 0x65, 0xdf, 0x48, 0x4c, 0x37, 0xaa, 0x68, 0xab, 0x9a, 0x1f, 0x3e, 0xff, 0x89, 0x92, 0xa0, 0x07}}}, -{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, - {{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, -{{{0x7d, 0x4f, 0x9c, 0x19, 0xc0, 0x4a, 0x31, 0xec, 0xf9, 0xaa, 0xeb, 0xb2, 0x16, 0x9c, 0xa3, 0x66, 0x5f, 0xd1, 0xd4, 0xed, 0xb8, 0x92, 0x1c, 0xab, 0xda, 0xea, 0xd9, 0x57, 0xdf, 0x4c, 0x2a, 0x48}} , - {{0x4b, 0xb0, 0x4e, 0x6e, 0x11, 0x3b, 0x51, 0xbd, 0x6a, 0xfd, 0xe4, 0x25, 0xa5, 0x5f, 0x11, 0x3f, 0x98, 0x92, 0x51, 0x14, 0xc6, 0x5f, 0x3c, 0x0b, 0xa8, 0xf7, 0xc2, 0x81, 0x43, 0xde, 0x91, 0x73}}}, -{{{0x3c, 0x8f, 0x9f, 0x33, 0x2a, 0x1f, 0x43, 0x33, 0x8f, 0x68, 0xff, 0x1f, 0x3d, 0x73, 0x6b, 0xbf, 0x68, 0xcc, 0x7d, 0x13, 0x6c, 0x24, 0x4b, 0xcc, 0x4d, 0x24, 0x0d, 0xfe, 0xde, 0x86, 0xad, 0x3b}} , - {{0x79, 0x51, 0x81, 0x01, 0xdc, 0x73, 0x53, 0xe0, 0x6e, 0x9b, 0xea, 0x68, 0x3f, 0x5c, 0x14, 0x84, 0x53, 0x8d, 0x4b, 0xc0, 0x9f, 0x9f, 0x89, 0x2b, 0x8c, 0xba, 0x86, 0xfa, 0xf2, 0xcd, 0xe3, 0x2d}}}, -{{{0x06, 0xf9, 0x29, 0x5a, 0xdb, 0x3d, 0x84, 0x52, 0xab, 0xcc, 0x6b, 0x60, 0x9d, 0xb7, 0x4a, 0x0e, 0x36, 0x63, 0x91, 0xad, 0xa0, 0x95, 0xb0, 0x97, 0x89, 0x4e, 0xcf, 0x7d, 0x3c, 0xe5, 0x7c, 0x28}} , - {{0x2e, 0x69, 0x98, 0xfd, 0xc6, 0xbd, 0xcc, 0xca, 0xdf, 0x9a, 0x44, 0x7e, 0x9d, 0xca, 0x89, 0x6d, 0xbf, 0x27, 0xc2, 0xf8, 0xcd, 0x46, 0x00, 0x2b, 0xb5, 0x58, 0x4e, 0xb7, 0x89, 0x09, 0xe9, 0x2d}}}, -{{{0x54, 0xbe, 0x75, 0xcb, 0x05, 0xb0, 0x54, 0xb7, 0xe7, 0x26, 0x86, 0x4a, 0xfc, 0x19, 0xcf, 0x27, 0x46, 0xd4, 0x22, 0x96, 0x5a, 0x11, 0xe8, 0xd5, 0x1b, 0xed, 0x71, 0xc5, 0x5d, 0xc8, 0xaf, 0x45}} , - {{0x40, 0x7b, 0x77, 0x57, 0x49, 0x9e, 0x80, 0x39, 0x23, 0xee, 0x81, 0x0b, 0x22, 0xcf, 0xdb, 0x7a, 0x2f, 0x14, 0xb8, 0x57, 0x8f, 0xa1, 0x39, 0x1e, 0x77, 0xfc, 0x0b, 0xa6, 0xbf, 0x8a, 0x0c, 0x6c}}}, -{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, - {{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, -{{{0x77, 0x3a, 0xd4, 0xd8, 0x27, 0xcf, 0xe8, 0xa1, 0x72, 0x9d, 0xca, 0xdd, 0x0d, 0x96, 0xda, 0x79, 0xed, 0x56, 0x42, 0x15, 0x60, 0xc7, 0x1c, 0x6b, 0x26, 0x30, 0xf6, 0x6a, 0x95, 0x67, 0xf3, 0x0a}} , - {{0xc5, 0x08, 0xa4, 0x2b, 0x2f, 0xbd, 0x31, 0x81, 0x2a, 0xa6, 0xb6, 0xe4, 0x00, 0x91, 0xda, 0x3d, 0xb2, 0xb0, 0x96, 0xce, 0x8a, 0xd2, 0x8d, 0x70, 0xb3, 0xd3, 0x34, 0x01, 0x90, 0x8d, 0x10, 0x21}}}, -{{{0x33, 0x0d, 0xe7, 0xba, 0x4f, 0x07, 0xdf, 0x8d, 0xea, 0x7d, 0xa0, 0xc5, 0xd6, 0xb1, 0xb0, 0xe5, 0x57, 0x1b, 0x5b, 0xf5, 0x45, 0x13, 0x14, 0x64, 0x5a, 0xeb, 0x5c, 0xfc, 0x54, 0x01, 0x76, 0x2b}} , - {{0x02, 0x0c, 0xc2, 0xaf, 0x96, 0x36, 0xfe, 0x4a, 0xe2, 0x54, 0x20, 0x6a, 0xeb, 0xb2, 0x9f, 0x62, 0xd7, 0xce, 0xa2, 0x3f, 0x20, 0x11, 0x34, 0x37, 0xe0, 0x42, 0xed, 0x6f, 0xf9, 0x1a, 0xc8, 0x7d}}}, -{{{0xd8, 0xb9, 0x11, 0xe8, 0x36, 0x3f, 0x42, 0xc1, 0xca, 0xdc, 0xd3, 0xf1, 0xc8, 0x23, 0x3d, 0x4f, 0x51, 0x7b, 0x9d, 0x8d, 0xd8, 0xe4, 0xa0, 0xaa, 0xf3, 0x04, 0xd6, 0x11, 0x93, 0xc8, 0x35, 0x45}} , - {{0x61, 0x36, 0xd6, 0x08, 0x90, 0xbf, 0xa7, 0x7a, 0x97, 0x6c, 0x0f, 0x84, 0xd5, 0x33, 0x2d, 0x37, 0xc9, 0x6a, 0x80, 0x90, 0x3d, 0x0a, 0xa2, 0xaa, 0xe1, 0xb8, 0x84, 0xba, 0x61, 0x36, 0xdd, 0x69}}}, -{{{0x6b, 0xdb, 0x5b, 0x9c, 0xc6, 0x92, 0xbc, 0x23, 0xaf, 0xc5, 0xb8, 0x75, 0xf8, 0x42, 0xfa, 0xd6, 0xb6, 0x84, 0x94, 0x63, 0x98, 0x93, 0x48, 0x78, 0x38, 0xcd, 0xbb, 0x18, 0x34, 0xc3, 0xdb, 0x67}} , - {{0x96, 0xf3, 0x3a, 0x09, 0x56, 0xb0, 0x6f, 0x7c, 0x51, 0x1e, 0x1b, 0x39, 0x48, 0xea, 0xc9, 0x0c, 0x25, 0xa2, 0x7a, 0xca, 0xe7, 0x92, 0xfc, 0x59, 0x30, 0xa3, 0x89, 0x85, 0xdf, 0x6f, 0x43, 0x38}}}, -{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, - {{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, -{{{0x79, 0x84, 0x44, 0x19, 0xbd, 0xe9, 0x54, 0xc4, 0xc0, 0x6e, 0x2a, 0xa8, 0xa8, 0x9b, 0x43, 0xd5, 0x71, 0x22, 0x5f, 0xdc, 0x01, 0xfa, 0xdf, 0xb3, 0xb8, 0x47, 0x4b, 0x0a, 0xa5, 0x44, 0xea, 0x29}} , - {{0x05, 0x90, 0x50, 0xaf, 0x63, 0x5f, 0x9d, 0x9e, 0xe1, 0x9d, 0x38, 0x97, 0x1f, 0x6c, 0xac, 0x30, 0x46, 0xb2, 0x6a, 0x19, 0xd1, 0x4b, 0xdb, 0xbb, 0x8c, 0xda, 0x2e, 0xab, 0xc8, 0x5a, 0x77, 0x6c}}}, -{{{0x2b, 0xbe, 0xaf, 0xa1, 0x6d, 0x2f, 0x0b, 0xb1, 0x8f, 0xe3, 0xe0, 0x38, 0xcd, 0x0b, 0x41, 0x1b, 0x4a, 0x15, 0x07, 0xf3, 0x6f, 0xdc, 0xb8, 0xe9, 0xde, 0xb2, 0xa3, 0x40, 0x01, 0xa6, 0x45, 0x1e}} , - {{0x76, 0x0a, 0xda, 0x8d, 0x2c, 0x07, 0x3f, 0x89, 0x7d, 0x04, 0xad, 0x43, 0x50, 0x6e, 0xd2, 0x47, 0xcb, 0x8a, 0xe6, 0x85, 0x1a, 0x24, 0xf3, 0xd2, 0x60, 0xfd, 0xdf, 0x73, 0xa4, 0x0d, 0x73, 0x0e}}}, -{{{0xfd, 0x67, 0x6b, 0x71, 0x9b, 0x81, 0x53, 0x39, 0x39, 0xf4, 0xb8, 0xd5, 0xc3, 0x30, 0x9b, 0x3b, 0x7c, 0xa3, 0xf0, 0xd0, 0x84, 0x21, 0xd6, 0xbf, 0xb7, 0x4c, 0x87, 0x13, 0x45, 0x2d, 0xa7, 0x55}} , - {{0x5d, 0x04, 0xb3, 0x40, 0x28, 0x95, 0x2d, 0x30, 0x83, 0xec, 0x5e, 0xe4, 0xff, 0x75, 0xfe, 0x79, 0x26, 0x9d, 0x1d, 0x36, 0xcd, 0x0a, 0x15, 0xd2, 0x24, 0x14, 0x77, 0x71, 0xd7, 0x8a, 0x1b, 0x04}}}, -{{{0x5d, 0x93, 0xc9, 0xbe, 0xaa, 0x90, 0xcd, 0x9b, 0xfb, 0x73, 0x7e, 0xb0, 0x64, 0x98, 0x57, 0x44, 0x42, 0x41, 0xb1, 0xaf, 0xea, 0xc1, 0xc3, 0x22, 0xff, 0x60, 0x46, 0xcb, 0x61, 0x81, 0x70, 0x61}} , - {{0x0d, 0x82, 0xb9, 0xfe, 0x21, 0xcd, 0xc4, 0xf5, 0x98, 0x0c, 0x4e, 0x72, 0xee, 0x87, 0x49, 0xf8, 0xa1, 0x95, 0xdf, 0x8f, 0x2d, 0xbd, 0x21, 0x06, 0x7c, 0x15, 0xe8, 0x12, 0x6d, 0x93, 0xd6, 0x38}}}, -{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, - {{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, -{{{0x91, 0xf7, 0x51, 0xd9, 0xef, 0x7d, 0x42, 0x01, 0x13, 0xe9, 0xb8, 0x7f, 0xa6, 0x49, 0x17, 0x64, 0x21, 0x80, 0x83, 0x2c, 0x63, 0x4c, 0x60, 0x09, 0x59, 0x91, 0x92, 0x77, 0x39, 0x51, 0xf4, 0x48}} , - {{0x60, 0xd5, 0x22, 0x83, 0x08, 0x2f, 0xff, 0x99, 0x3e, 0x69, 0x6d, 0x88, 0xda, 0xe7, 0x5b, 0x52, 0x26, 0x31, 0x2a, 0xe5, 0x89, 0xde, 0x68, 0x90, 0xb6, 0x22, 0x5a, 0xbd, 0xd3, 0x85, 0x53, 0x31}}}, -{{{0xd8, 0xce, 0xdc, 0xf9, 0x3c, 0x4b, 0xa2, 0x1d, 0x2c, 0x2f, 0x36, 0xbe, 0x7a, 0xfc, 0xcd, 0xbc, 0xdc, 0xf9, 0x30, 0xbd, 0xff, 0x05, 0xc7, 0xe4, 0x8e, 0x17, 0x62, 0xf8, 0x4d, 0xa0, 0x56, 0x79}} , - {{0x82, 0xe7, 0xf6, 0xba, 0x53, 0x84, 0x0a, 0xa3, 0x34, 0xff, 0x3c, 0xa3, 0x6a, 0xa1, 0x37, 0xea, 0xdd, 0xb6, 0x95, 0xb3, 0x78, 0x19, 0x76, 0x1e, 0x55, 0x2f, 0x77, 0x2e, 0x7f, 0xc1, 0xea, 0x5e}}}, -{{{0x83, 0xe1, 0x6e, 0xa9, 0x07, 0x33, 0x3e, 0x83, 0xff, 0xcb, 0x1c, 0x9f, 0xb1, 0xa3, 0xb4, 0xc9, 0xe1, 0x07, 0x97, 0xff, 0xf8, 0x23, 0x8f, 0xce, 0x40, 0xfd, 0x2e, 0x5e, 0xdb, 0x16, 0x43, 0x2d}} , - {{0xba, 0x38, 0x02, 0xf7, 0x81, 0x43, 0x83, 0xa3, 0x20, 0x4f, 0x01, 0x3b, 0x8a, 0x04, 0x38, 0x31, 0xc6, 0x0f, 0xc8, 0xdf, 0xd7, 0xfa, 0x2f, 0x88, 0x3f, 0xfc, 0x0c, 0x76, 0xc4, 0xa6, 0x45, 0x72}}}, -{{{0xbb, 0x0c, 0xbc, 0x6a, 0xa4, 0x97, 0x17, 0x93, 0x2d, 0x6f, 0xde, 0x72, 0x10, 0x1c, 0x08, 0x2c, 0x0f, 0x80, 0x32, 0x68, 0x27, 0xd4, 0xab, 0xdd, 0xc5, 0x58, 0x61, 0x13, 0x6d, 0x11, 0x1e, 0x4d}} , - {{0x1a, 0xb9, 0xc9, 0x10, 0xfb, 0x1e, 0x4e, 0xf4, 0x84, 0x4b, 0x8a, 0x5e, 0x7b, 0x4b, 0xe8, 0x43, 0x8c, 0x8f, 0x00, 0xb5, 0x54, 0x13, 0xc5, 0x5c, 0xb6, 0x35, 0x4e, 0x9d, 0xe4, 0x5b, 0x41, 0x6d}}}, -{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, - {{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, -{{{0x15, 0x7d, 0x12, 0x48, 0x82, 0x14, 0x42, 0xcd, 0x32, 0xd4, 0x4b, 0xc1, 0x72, 0x61, 0x2a, 0x8c, 0xec, 0xe2, 0xf8, 0x24, 0x45, 0x94, 0xe3, 0xbe, 0xdd, 0x67, 0xa8, 0x77, 0x5a, 0xae, 0x5b, 0x4b}} , - {{0xcb, 0x77, 0x9a, 0x20, 0xde, 0xb8, 0x23, 0xd9, 0xa0, 0x0f, 0x8c, 0x7b, 0xa5, 0xcb, 0xae, 0xb6, 0xec, 0x42, 0x67, 0x0e, 0x58, 0xa4, 0x75, 0x98, 0x21, 0x71, 0x84, 0xb3, 0xe0, 0x76, 0x94, 0x73}}}, -{{{0xdf, 0xfc, 0x69, 0x28, 0x23, 0x3f, 0x5b, 0xf8, 0x3b, 0x24, 0x37, 0xf3, 0x1d, 0xd5, 0x22, 0x6b, 0xd0, 0x98, 0xa8, 0x6c, 0xcf, 0xff, 0x06, 0xe1, 0x13, 0xdf, 0xb9, 0xc1, 0x0c, 0xa9, 0xbf, 0x33}} , - {{0xd9, 0x81, 0xda, 0xb2, 0x4f, 0x82, 0x9d, 0x43, 0x81, 0x09, 0xf1, 0xd2, 0x01, 0xef, 0xac, 0xf4, 0x2d, 0x7d, 0x01, 0x09, 0xf1, 0xff, 0xa5, 0x9f, 0xe5, 0xca, 0x27, 0x63, 0xdb, 0x20, 0xb1, 0x53}}}, -{{{0x67, 0x02, 0xe8, 0xad, 0xa9, 0x34, 0xd4, 0xf0, 0x15, 0x81, 0xaa, 0xc7, 0x4d, 0x87, 0x94, 0xea, 0x75, 0xe7, 0x4c, 0x94, 0x04, 0x0e, 0x69, 0x87, 0xe7, 0x51, 0x91, 0x10, 0x03, 0xc7, 0xbe, 0x56}} , - {{0x32, 0xfb, 0x86, 0xec, 0x33, 0x6b, 0x2e, 0x51, 0x2b, 0xc8, 0xfa, 0x6c, 0x70, 0x47, 0x7e, 0xce, 0x05, 0x0c, 0x71, 0xf3, 0xb4, 0x56, 0xa6, 0xdc, 0xcc, 0x78, 0x07, 0x75, 0xd0, 0xdd, 0xb2, 0x6a}}}, -{{{0xc6, 0xef, 0xb9, 0xc0, 0x2b, 0x22, 0x08, 0x1e, 0x71, 0x70, 0xb3, 0x35, 0x9c, 0x7a, 0x01, 0x92, 0x44, 0x9a, 0xf6, 0xb0, 0x58, 0x95, 0xc1, 0x9b, 0x02, 0xed, 0x2d, 0x7c, 0x34, 0x29, 0x49, 0x44}} , - {{0x45, 0x62, 0x1d, 0x2e, 0xff, 0x2a, 0x1c, 0x21, 0xa4, 0x25, 0x7b, 0x0d, 0x8c, 0x15, 0x39, 0xfc, 0x8f, 0x7c, 0xa5, 0x7d, 0x1e, 0x25, 0xa3, 0x45, 0xd6, 0xab, 0xbd, 0xcb, 0xc5, 0x5e, 0x78, 0x77}}}, -{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, - {{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, -{{{0xd0, 0xd3, 0x42, 0xed, 0x1d, 0x00, 0x3c, 0x15, 0x2c, 0x9c, 0x77, 0x81, 0xd2, 0x73, 0xd1, 0x06, 0xd5, 0xc4, 0x7f, 0x94, 0xbb, 0x92, 0x2d, 0x2c, 0x4b, 0x45, 0x4b, 0xe9, 0x2a, 0x89, 0x6b, 0x2b}} , - {{0xd2, 0x0c, 0x88, 0xc5, 0x48, 0x4d, 0xea, 0x0d, 0x4a, 0xc9, 0x52, 0x6a, 0x61, 0x79, 0xe9, 0x76, 0xf3, 0x85, 0x52, 0x5c, 0x1b, 0x2c, 0xe1, 0xd6, 0xc4, 0x0f, 0x18, 0x0e, 0x4e, 0xf6, 0x1c, 0x7f}}}, -{{{0xb4, 0x04, 0x2e, 0x42, 0xcb, 0x1f, 0x2b, 0x11, 0x51, 0x7b, 0x08, 0xac, 0xaa, 0x3e, 0x9e, 0x52, 0x60, 0xb7, 0xc2, 0x61, 0x57, 0x8c, 0x84, 0xd5, 0x18, 0xa6, 0x19, 0xfc, 0xb7, 0x75, 0x91, 0x1b}} , - {{0xe8, 0x68, 0xca, 0x44, 0xc8, 0x38, 0x38, 0xcc, 0x53, 0x0a, 0x32, 0x35, 0xcc, 0x52, 0xcb, 0x0e, 0xf7, 0xc5, 0xe7, 0xec, 0x3d, 0x85, 0xcc, 0x58, 0xe2, 0x17, 0x47, 0xff, 0x9f, 0xa5, 0x30, 0x17}}}, -{{{0xe3, 0xae, 0xc8, 0xc1, 0x71, 0x75, 0x31, 0x00, 0x37, 0x41, 0x5c, 0x0e, 0x39, 0xda, 0x73, 0xa0, 0xc7, 0x97, 0x36, 0x6c, 0x5b, 0xf2, 0xee, 0x64, 0x0a, 0x3d, 0x89, 0x1e, 0x1d, 0x49, 0x8c, 0x37}} , - {{0x4c, 0xe6, 0xb0, 0xc1, 0xa5, 0x2a, 0x82, 0x09, 0x08, 0xad, 0x79, 0x9c, 0x56, 0xf6, 0xf9, 0xc1, 0xd7, 0x7c, 0x39, 0x7f, 0x93, 0xca, 0x11, 0x55, 0xbf, 0x07, 0x1b, 0x82, 0x29, 0x69, 0x95, 0x5c}}}, -{{{0x87, 0xee, 0xa6, 0x56, 0x9e, 0xc2, 0x9a, 0x56, 0x24, 0x42, 0x85, 0x4d, 0x98, 0x31, 0x1e, 0x60, 0x4d, 0x87, 0x85, 0x04, 0xae, 0x46, 0x12, 0xf9, 0x8e, 0x7f, 0xe4, 0x7f, 0xf6, 0x1c, 0x37, 0x01}} , - {{0x73, 0x4c, 0xb6, 0xc5, 0xc4, 0xe9, 0x6c, 0x85, 0x48, 0x4a, 0x5a, 0xac, 0xd9, 0x1f, 0x43, 0xf8, 0x62, 0x5b, 0xee, 0x98, 0x2a, 0x33, 0x8e, 0x79, 0xce, 0x61, 0x06, 0x35, 0xd8, 0xd7, 0xca, 0x71}}}, -{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, - {{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, -{{{0x72, 0xd3, 0xae, 0xa6, 0xca, 0x8f, 0xcd, 0xcc, 0x78, 0x8e, 0x19, 0x4d, 0xa7, 0xd2, 0x27, 0xe9, 0xa4, 0x3c, 0x16, 0x5b, 0x84, 0x80, 0xf9, 0xd0, 0xcc, 0x6a, 0x1e, 0xca, 0x1e, 0x67, 0xbd, 0x63}} , - {{0x7b, 0x6e, 0x2a, 0xd2, 0x87, 0x48, 0xff, 0xa1, 0xca, 0xe9, 0x15, 0x85, 0xdc, 0xdb, 0x2c, 0x39, 0x12, 0x91, 0xa9, 0x20, 0xaa, 0x4f, 0x29, 0xf4, 0x15, 0x7a, 0xd2, 0xf5, 0x32, 0xcc, 0x60, 0x04}}}, -{{{0xe5, 0x10, 0x47, 0x3b, 0xfa, 0x90, 0xfc, 0x30, 0xb5, 0xea, 0x6f, 0x56, 0x8f, 0xfb, 0x0e, 0xa7, 0x3b, 0xc8, 0xb2, 0xff, 0x02, 0x7a, 0x33, 0x94, 0x93, 0x2a, 0x03, 0xe0, 0x96, 0x3a, 0x6c, 0x0f}} , - {{0x5a, 0x63, 0x67, 0xe1, 0x9b, 0x47, 0x78, 0x9f, 0x38, 0x79, 0xac, 0x97, 0x66, 0x1d, 0x5e, 0x51, 0xee, 0x24, 0x42, 0xe8, 0x58, 0x4b, 0x8a, 0x03, 0x75, 0x86, 0x37, 0x86, 0xe2, 0x97, 0x4e, 0x3d}}}, -{{{0x3f, 0x75, 0x8e, 0xb4, 0xff, 0xd8, 0xdd, 0xd6, 0x37, 0x57, 0x9d, 0x6d, 0x3b, 0xbd, 0xd5, 0x60, 0x88, 0x65, 0x9a, 0xb9, 0x4a, 0x68, 0x84, 0xa2, 0x67, 0xdd, 0x17, 0x25, 0x97, 0x04, 0x8b, 0x5e}} , - {{0xbb, 0x40, 0x5e, 0xbc, 0x16, 0x92, 0x05, 0xc4, 0xc0, 0x4e, 0x72, 0x90, 0x0e, 0xab, 0xcf, 0x8a, 0xed, 0xef, 0xb9, 0x2d, 0x3b, 0xf8, 0x43, 0x5b, 0xba, 0x2d, 0xeb, 0x2f, 0x52, 0xd2, 0xd1, 0x5a}}}, -{{{0x40, 0xb4, 0xab, 0xe6, 0xad, 0x9f, 0x46, 0x69, 0x4a, 0xb3, 0x8e, 0xaa, 0xea, 0x9c, 0x8a, 0x20, 0x16, 0x5d, 0x8c, 0x13, 0xbd, 0xf6, 0x1d, 0xc5, 0x24, 0xbd, 0x90, 0x2a, 0x1c, 0xc7, 0x13, 0x3b}} , - {{0x54, 0xdc, 0x16, 0x0d, 0x18, 0xbe, 0x35, 0x64, 0x61, 0x52, 0x02, 0x80, 0xaf, 0x05, 0xf7, 0xa6, 0x42, 0xd3, 0x8f, 0x2e, 0x79, 0x26, 0xa8, 0xbb, 0xb2, 0x17, 0x48, 0xb2, 0x7a, 0x0a, 0x89, 0x14}}}, -{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, - {{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, -{{{0x20, 0xa8, 0x88, 0xe3, 0x91, 0xc0, 0x6e, 0xbb, 0x8a, 0x27, 0x82, 0x51, 0x83, 0xb2, 0x28, 0xa9, 0x83, 0xeb, 0xa6, 0xa9, 0x4d, 0x17, 0x59, 0x22, 0x54, 0x00, 0x50, 0x45, 0xcb, 0x48, 0x4b, 0x18}} , - {{0x33, 0x7c, 0xe7, 0x26, 0xba, 0x4d, 0x32, 0xfe, 0x53, 0xf4, 0xfa, 0x83, 0xe3, 0xa5, 0x79, 0x66, 0x73, 0xef, 0x80, 0x23, 0x68, 0xc2, 0x60, 0xdd, 0xa9, 0x33, 0xdc, 0x03, 0x7a, 0xe0, 0xe0, 0x3e}}}, -{{{0x34, 0x5c, 0x13, 0xfb, 0xc0, 0xe3, 0x78, 0x2b, 0x54, 0x58, 0x22, 0x9b, 0x76, 0x81, 0x7f, 0x93, 0x9c, 0x25, 0x3c, 0xd2, 0xe9, 0x96, 0x21, 0x26, 0x08, 0xf5, 0xed, 0x95, 0x11, 0xae, 0x04, 0x5a}} , - {{0xb9, 0xe8, 0xc5, 0x12, 0x97, 0x1f, 0x83, 0xfe, 0x3e, 0x94, 0x99, 0xd4, 0x2d, 0xf9, 0x52, 0x59, 0x5c, 0x82, 0xa6, 0xf0, 0x75, 0x7e, 0xe8, 0xec, 0xcc, 0xac, 0x18, 0x21, 0x09, 0x67, 0x66, 0x67}}}, -{{{0xb3, 0x40, 0x29, 0xd1, 0xcb, 0x1b, 0x08, 0x9e, 0x9c, 0xb7, 0x53, 0xb9, 0x3b, 0x71, 0x08, 0x95, 0x12, 0x1a, 0x58, 0xaf, 0x7e, 0x82, 0x52, 0x43, 0x4f, 0x11, 0x39, 0xf4, 0x93, 0x1a, 0x26, 0x05}} , - {{0x6e, 0x44, 0xa3, 0xf9, 0x64, 0xaf, 0xe7, 0x6d, 0x7d, 0xdf, 0x1e, 0xac, 0x04, 0xea, 0x3b, 0x5f, 0x9b, 0xe8, 0x24, 0x9d, 0x0e, 0xe5, 0x2e, 0x3e, 0xdf, 0xa9, 0xf7, 0xd4, 0x50, 0x71, 0xf0, 0x78}}}, -{{{0x3e, 0xa8, 0x38, 0xc2, 0x57, 0x56, 0x42, 0x9a, 0xb1, 0xe2, 0xf8, 0x45, 0xaa, 0x11, 0x48, 0x5f, 0x17, 0xc4, 0x54, 0x27, 0xdc, 0x5d, 0xaa, 0xdd, 0x41, 0xbc, 0xdf, 0x81, 0xb9, 0x53, 0xee, 0x52}} , - {{0xc3, 0xf1, 0xa7, 0x6d, 0xb3, 0x5f, 0x92, 0x6f, 0xcc, 0x91, 0xb8, 0x95, 0x05, 0xdf, 0x3c, 0x64, 0x57, 0x39, 0x61, 0x51, 0xad, 0x8c, 0x38, 0x7b, 0xc8, 0xde, 0x00, 0x34, 0xbe, 0xa1, 0xb0, 0x7e}}}, -{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, - {{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, -{{{0x25, 0x24, 0x1d, 0x8a, 0x67, 0x20, 0xee, 0x42, 0xeb, 0x38, 0xed, 0x0b, 0x8b, 0xcd, 0x46, 0x9d, 0x5e, 0x6b, 0x1e, 0x24, 0x9d, 0x12, 0x05, 0x1a, 0xcc, 0x05, 0x4e, 0x92, 0x38, 0xe1, 0x1f, 0x50}} , - {{0x4e, 0xee, 0x1c, 0x91, 0xe6, 0x11, 0xbd, 0x8e, 0x55, 0x1a, 0x18, 0x75, 0x66, 0xaf, 0x4d, 0x7b, 0x0f, 0xae, 0x6d, 0x85, 0xca, 0x82, 0x58, 0x21, 0x9c, 0x18, 0xe0, 0xed, 0xec, 0x22, 0x80, 0x2f}}}, -{{{0x68, 0x3b, 0x0a, 0x39, 0x1d, 0x6a, 0x15, 0x57, 0xfc, 0xf0, 0x63, 0x54, 0xdb, 0x39, 0xdb, 0xe8, 0x5c, 0x64, 0xff, 0xa0, 0x09, 0x4f, 0x3b, 0xb7, 0x32, 0x60, 0x99, 0x94, 0xfd, 0x94, 0x82, 0x2d}} , - {{0x24, 0xf6, 0x5a, 0x44, 0xf1, 0x55, 0x2c, 0xdb, 0xea, 0x7c, 0x84, 0x7c, 0x01, 0xac, 0xe3, 0xfd, 0xc9, 0x27, 0xc1, 0x5a, 0xb9, 0xde, 0x4f, 0x5a, 0x90, 0xdd, 0xc6, 0x67, 0xaa, 0x6f, 0x8a, 0x3a}}}, -{{{0x78, 0x52, 0x87, 0xc9, 0x97, 0x63, 0xb1, 0xdd, 0x54, 0x5f, 0xc1, 0xf8, 0xf1, 0x06, 0xa6, 0xa8, 0xa3, 0x88, 0x82, 0xd4, 0xcb, 0xa6, 0x19, 0xdd, 0xd1, 0x11, 0x87, 0x08, 0x17, 0x4c, 0x37, 0x2a}} , - {{0xa1, 0x0c, 0xf3, 0x08, 0x43, 0xd9, 0x24, 0x1e, 0x83, 0xa7, 0xdf, 0x91, 0xca, 0xbd, 0x69, 0x47, 0x8d, 0x1b, 0xe2, 0xb9, 0x4e, 0xb5, 0xe1, 0x76, 0xb3, 0x1c, 0x93, 0x03, 0xce, 0x5f, 0xb3, 0x5a}}}, -{{{0x1d, 0xda, 0xe4, 0x61, 0x03, 0x50, 0xa9, 0x8b, 0x68, 0x18, 0xef, 0xb2, 0x1c, 0x84, 0x3b, 0xa2, 0x44, 0x95, 0xa3, 0x04, 0x3b, 0xd6, 0x99, 0x00, 0xaf, 0x76, 0x42, 0x67, 0x02, 0x7d, 0x85, 0x56}} , - {{0xce, 0x72, 0x0e, 0x29, 0x84, 0xb2, 0x7d, 0xd2, 0x45, 0xbe, 0x57, 0x06, 0xed, 0x7f, 0xcf, 0xed, 0xcd, 0xef, 0x19, 0xd6, 0xbc, 0x15, 0x79, 0x64, 0xd2, 0x18, 0xe3, 0x20, 0x67, 0x3a, 0x54, 0x0b}}}, -{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, - {{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, -{{{0x52, 0xfd, 0x04, 0xc5, 0xfb, 0x99, 0xe7, 0xe8, 0xfb, 0x8c, 0xe1, 0x42, 0x03, 0xef, 0x9d, 0xd9, 0x9e, 0x4d, 0xf7, 0x80, 0xcf, 0x2e, 0xcc, 0x9b, 0x45, 0xc9, 0x7b, 0x7a, 0xbc, 0x37, 0xa8, 0x52}} , - {{0x96, 0x11, 0x41, 0x8a, 0x47, 0x91, 0xfe, 0xb6, 0xda, 0x7a, 0x54, 0x63, 0xd1, 0x14, 0x35, 0x05, 0x86, 0x8c, 0xa9, 0x36, 0x3f, 0xf2, 0x85, 0x54, 0x4e, 0x92, 0xd8, 0x85, 0x01, 0x46, 0xd6, 0x50}}}, -{{{0x53, 0xcd, 0xf3, 0x86, 0x40, 0xe6, 0x39, 0x42, 0x95, 0xd6, 0xcb, 0x45, 0x1a, 0x20, 0xc8, 0x45, 0x4b, 0x32, 0x69, 0x04, 0xb1, 0xaf, 0x20, 0x46, 0xc7, 0x6b, 0x23, 0x5b, 0x69, 0xee, 0x30, 0x3f}} , - {{0x70, 0x83, 0x47, 0xc0, 0xdb, 0x55, 0x08, 0xa8, 0x7b, 0x18, 0x6d, 0xf5, 0x04, 0x5a, 0x20, 0x0c, 0x4a, 0x8c, 0x60, 0xae, 0xae, 0x0f, 0x64, 0x55, 0x55, 0x2e, 0xd5, 0x1d, 0x53, 0x31, 0x42, 0x41}}}, -{{{0xca, 0xfc, 0x88, 0x6b, 0x96, 0x78, 0x0a, 0x8b, 0x83, 0xdc, 0xbc, 0xaf, 0x40, 0xb6, 0x8d, 0x7f, 0xef, 0xb4, 0xd1, 0x3f, 0xcc, 0xa2, 0x74, 0xc9, 0xc2, 0x92, 0x55, 0x00, 0xab, 0xdb, 0xbf, 0x4f}} , - {{0x93, 0x1c, 0x06, 0x2d, 0x66, 0x65, 0x02, 0xa4, 0x97, 0x18, 0xfd, 0x00, 0xe7, 0xab, 0x03, 0xec, 0xce, 0xc1, 0xbf, 0x37, 0xf8, 0x13, 0x53, 0xa5, 0xe5, 0x0c, 0x3a, 0xa8, 0x55, 0xb9, 0xff, 0x68}}}, -{{{0xe4, 0xe6, 0x6d, 0x30, 0x7d, 0x30, 0x35, 0xc2, 0x78, 0x87, 0xf9, 0xfc, 0x6b, 0x5a, 0xc3, 0xb7, 0x65, 0xd8, 0x2e, 0xc7, 0xa5, 0x0c, 0xc6, 0xdc, 0x12, 0xaa, 0xd6, 0x4f, 0xc5, 0x38, 0xbc, 0x0e}} , - {{0xe2, 0x3c, 0x76, 0x86, 0x38, 0xf2, 0x7b, 0x2c, 0x16, 0x78, 0x8d, 0xf5, 0xa4, 0x15, 0xda, 0xdb, 0x26, 0x85, 0xa0, 0x56, 0xdd, 0x1d, 0xe3, 0xb3, 0xfd, 0x40, 0xef, 0xf2, 0xd9, 0xa1, 0xb3, 0x04}}}, -{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, - {{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, -{{{0xdb, 0x49, 0x0e, 0xe6, 0x58, 0x10, 0x7a, 0x52, 0xda, 0xb5, 0x7d, 0x37, 0x6a, 0x3e, 0xa1, 0x78, 0xce, 0xc7, 0x1c, 0x24, 0x23, 0xdb, 0x7d, 0xfb, 0x8c, 0x8d, 0xdc, 0x30, 0x67, 0x69, 0x75, 0x3b}} , - {{0xa9, 0xea, 0x6d, 0x16, 0x16, 0x60, 0xf4, 0x60, 0x87, 0x19, 0x44, 0x8c, 0x4a, 0x8b, 0x3e, 0xfb, 0x16, 0x00, 0x00, 0x54, 0xa6, 0x9e, 0x9f, 0xef, 0xcf, 0xd9, 0xd2, 0x4c, 0x74, 0x31, 0xd0, 0x34}}}, -{{{0xa4, 0xeb, 0x04, 0xa4, 0x8c, 0x8f, 0x71, 0x27, 0x95, 0x85, 0x5d, 0x55, 0x4b, 0xb1, 0x26, 0x26, 0xc8, 0xae, 0x6a, 0x7d, 0xa2, 0x21, 0xca, 0xce, 0x38, 0xab, 0x0f, 0xd0, 0xd5, 0x2b, 0x6b, 0x00}} , - {{0xe5, 0x67, 0x0c, 0xf1, 0x3a, 0x9a, 0xea, 0x09, 0x39, 0xef, 0xd1, 0x30, 0xbc, 0x33, 0xba, 0xb1, 0x6a, 0xc5, 0x27, 0x08, 0x7f, 0x54, 0x80, 0x3d, 0xab, 0xf6, 0x15, 0x7a, 0xc2, 0x40, 0x73, 0x72}}}, -{{{0x84, 0x56, 0x82, 0xb6, 0x12, 0x70, 0x7f, 0xf7, 0xf0, 0xbd, 0x5b, 0xa9, 0xd5, 0xc5, 0x5f, 0x59, 0xbf, 0x7f, 0xb3, 0x55, 0x22, 0x02, 0xc9, 0x44, 0x55, 0x87, 0x8f, 0x96, 0x98, 0x64, 0x6d, 0x15}} , - {{0xb0, 0x8b, 0xaa, 0x1e, 0xec, 0xc7, 0xa5, 0x8f, 0x1f, 0x92, 0x04, 0xc6, 0x05, 0xf6, 0xdf, 0xa1, 0xcc, 0x1f, 0x81, 0xf5, 0x0e, 0x9c, 0x57, 0xdc, 0xe3, 0xbb, 0x06, 0x87, 0x1e, 0xfe, 0x23, 0x6c}}}, -{{{0xd8, 0x2b, 0x5b, 0x16, 0xea, 0x20, 0xf1, 0xd3, 0x68, 0x8f, 0xae, 0x5b, 0xd0, 0xa9, 0x1a, 0x19, 0xa8, 0x36, 0xfb, 0x2b, 0x57, 0x88, 0x7d, 0x90, 0xd5, 0xa6, 0xf3, 0xdc, 0x38, 0x89, 0x4e, 0x1f}} , - {{0xcc, 0x19, 0xda, 0x9b, 0x3b, 0x43, 0x48, 0x21, 0x2e, 0x23, 0x4d, 0x3d, 0xae, 0xf8, 0x8c, 0xfc, 0xdd, 0xa6, 0x74, 0x37, 0x65, 0xca, 0xee, 0x1a, 0x19, 0x8e, 0x9f, 0x64, 0x6f, 0x0c, 0x8b, 0x5a}}}, -{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, - {{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, -{{{0x25, 0xb9, 0xc2, 0xf0, 0x72, 0xb8, 0x15, 0x16, 0xcc, 0x8d, 0x3c, 0x6f, 0x25, 0xed, 0xf4, 0x46, 0x2e, 0x0c, 0x60, 0x0f, 0xe2, 0x84, 0x34, 0x55, 0x89, 0x59, 0x34, 0x1b, 0xf5, 0x8d, 0xfe, 0x08}} , - {{0xf8, 0xab, 0x93, 0xbc, 0x44, 0xba, 0x1b, 0x75, 0x4b, 0x49, 0x6f, 0xd0, 0x54, 0x2e, 0x63, 0xba, 0xb5, 0xea, 0xed, 0x32, 0x14, 0xc9, 0x94, 0xd8, 0xc5, 0xce, 0xf4, 0x10, 0x68, 0xe0, 0x38, 0x27}}}, -{{{0x74, 0x1c, 0x14, 0x9b, 0xd4, 0x64, 0x61, 0x71, 0x5a, 0xb6, 0x21, 0x33, 0x4f, 0xf7, 0x8e, 0xba, 0xa5, 0x48, 0x9a, 0xc7, 0xfa, 0x9a, 0xf0, 0xb4, 0x62, 0xad, 0xf2, 0x5e, 0xcc, 0x03, 0x24, 0x1a}} , - {{0xf5, 0x76, 0xfd, 0xe4, 0xaf, 0xb9, 0x03, 0x59, 0xce, 0x63, 0xd2, 0x3b, 0x1f, 0xcd, 0x21, 0x0c, 0xad, 0x44, 0xa5, 0x97, 0xac, 0x80, 0x11, 0x02, 0x9b, 0x0c, 0xe5, 0x8b, 0xcd, 0xfb, 0x79, 0x77}}}, -{{{0x15, 0xbe, 0x9a, 0x0d, 0xba, 0x38, 0x72, 0x20, 0x8a, 0xf5, 0xbe, 0x59, 0x93, 0x79, 0xb7, 0xf6, 0x6a, 0x0c, 0x38, 0x27, 0x1a, 0x60, 0xf4, 0x86, 0x3b, 0xab, 0x5a, 0x00, 0xa0, 0xce, 0x21, 0x7d}} , - {{0x6c, 0xba, 0x14, 0xc5, 0xea, 0x12, 0x9e, 0x2e, 0x82, 0x63, 0xce, 0x9b, 0x4a, 0xe7, 0x1d, 0xec, 0xf1, 0x2e, 0x51, 0x1c, 0xf4, 0xd0, 0x69, 0x15, 0x42, 0x9d, 0xa3, 0x3f, 0x0e, 0xbf, 0xe9, 0x5c}}}, -{{{0xe4, 0x0d, 0xf4, 0xbd, 0xee, 0x31, 0x10, 0xed, 0xcb, 0x12, 0x86, 0xad, 0xd4, 0x2f, 0x90, 0x37, 0x32, 0xc3, 0x0b, 0x73, 0xec, 0x97, 0x85, 0xa4, 0x01, 0x1c, 0x76, 0x35, 0xfe, 0x75, 0xdd, 0x71}} , - {{0x11, 0xa4, 0x88, 0x9f, 0x3e, 0x53, 0x69, 0x3b, 0x1b, 0xe0, 0xf7, 0xba, 0x9b, 0xad, 0x4e, 0x81, 0x5f, 0xb5, 0x5c, 0xae, 0xbe, 0x67, 0x86, 0x37, 0x34, 0x8e, 0x07, 0x32, 0x45, 0x4a, 0x67, 0x39}}}, -{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, - {{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, -{{{0x90, 0x70, 0x58, 0x20, 0x03, 0x1e, 0x67, 0xb2, 0xc8, 0x9b, 0x58, 0xc5, 0xb1, 0xeb, 0x2d, 0x4a, 0xde, 0x82, 0x8c, 0xf2, 0xd2, 0x14, 0xb8, 0x70, 0x61, 0x4e, 0x73, 0xd6, 0x0b, 0x6b, 0x0d, 0x30}} , - {{0x81, 0xfc, 0x55, 0x5c, 0xbf, 0xa7, 0xc4, 0xbd, 0xe2, 0xf0, 0x4b, 0x8f, 0xe9, 0x7d, 0x99, 0xfa, 0xd3, 0xab, 0xbc, 0xc7, 0x83, 0x2b, 0x04, 0x7f, 0x0c, 0x19, 0x43, 0x03, 0x3d, 0x07, 0xca, 0x40}}}, -{{{0xf9, 0xc8, 0xbe, 0x8c, 0x16, 0x81, 0x39, 0x96, 0xf6, 0x17, 0x58, 0xc8, 0x30, 0x58, 0xfb, 0xc2, 0x03, 0x45, 0xd2, 0x52, 0x76, 0xe0, 0x6a, 0x26, 0x28, 0x5c, 0x88, 0x59, 0x6a, 0x5a, 0x54, 0x42}} , - {{0x07, 0xb5, 0x2e, 0x2c, 0x67, 0x15, 0x9b, 0xfb, 0x83, 0x69, 0x1e, 0x0f, 0xda, 0xd6, 0x29, 0xb1, 0x60, 0xe0, 0xb2, 0xba, 0x69, 0xa2, 0x9e, 0xbd, 0xbd, 0xe0, 0x1c, 0xbd, 0xcd, 0x06, 0x64, 0x70}}}, -{{{0x41, 0xfa, 0x8c, 0xe1, 0x89, 0x8f, 0x27, 0xc8, 0x25, 0x8f, 0x6f, 0x5f, 0x55, 0xf8, 0xde, 0x95, 0x6d, 0x2f, 0x75, 0x16, 0x2b, 0x4e, 0x44, 0xfd, 0x86, 0x6e, 0xe9, 0x70, 0x39, 0x76, 0x97, 0x7e}} , - {{0x17, 0x62, 0x6b, 0x14, 0xa1, 0x7c, 0xd0, 0x79, 0x6e, 0xd8, 0x8a, 0xa5, 0x6d, 0x8c, 0x93, 0xd2, 0x3f, 0xec, 0x44, 0x8d, 0x6e, 0x91, 0x01, 0x8c, 0x8f, 0xee, 0x01, 0x8f, 0xc0, 0xb4, 0x85, 0x0e}}}, -{{{0x02, 0x3a, 0x70, 0x41, 0xe4, 0x11, 0x57, 0x23, 0xac, 0xe6, 0xfc, 0x54, 0x7e, 0xcd, 0xd7, 0x22, 0xcb, 0x76, 0x9f, 0x20, 0xce, 0xa0, 0x73, 0x76, 0x51, 0x3b, 0xa4, 0xf8, 0xe3, 0x62, 0x12, 0x6c}} , - {{0x7f, 0x00, 0x9c, 0x26, 0x0d, 0x6f, 0x48, 0x7f, 0x3a, 0x01, 0xed, 0xc5, 0x96, 0xb0, 0x1f, 0x4f, 0xa8, 0x02, 0x62, 0x27, 0x8a, 0x50, 0x8d, 0x9a, 0x8b, 0x52, 0x0f, 0x1e, 0xcf, 0x41, 0x38, 0x19}}}, -{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, - {{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, -{{{0xf5, 0x6c, 0xd4, 0x2f, 0x0f, 0x69, 0x0f, 0x87, 0x3f, 0x61, 0x65, 0x1e, 0x35, 0x34, 0x85, 0xba, 0x02, 0x30, 0xac, 0x25, 0x3d, 0xe2, 0x62, 0xf1, 0xcc, 0xe9, 0x1b, 0xc2, 0xef, 0x6a, 0x42, 0x57}} , - {{0x34, 0x1f, 0x2e, 0xac, 0xd1, 0xc7, 0x04, 0x52, 0x32, 0x66, 0xb2, 0x33, 0x73, 0x21, 0x34, 0x54, 0xf7, 0x71, 0xed, 0x06, 0xb0, 0xff, 0xa6, 0x59, 0x6f, 0x8a, 0x4e, 0xfb, 0x02, 0xb0, 0x45, 0x6b}}}, -{{{0xf5, 0x48, 0x0b, 0x03, 0xc5, 0x22, 0x7d, 0x80, 0x08, 0x53, 0xfe, 0x32, 0xb1, 0xa1, 0x8a, 0x74, 0x6f, 0xbd, 0x3f, 0x85, 0xf4, 0xcf, 0xf5, 0x60, 0xaf, 0x41, 0x7e, 0x3e, 0x46, 0xa3, 0x5a, 0x20}} , - {{0xaa, 0x35, 0x87, 0x44, 0x63, 0x66, 0x97, 0xf8, 0x6e, 0x55, 0x0c, 0x04, 0x3e, 0x35, 0x50, 0xbf, 0x93, 0x69, 0xd2, 0x8b, 0x05, 0x55, 0x99, 0xbe, 0xe2, 0x53, 0x61, 0xec, 0xe8, 0x08, 0x0b, 0x32}}}, -{{{0xb3, 0x10, 0x45, 0x02, 0x69, 0x59, 0x2e, 0x97, 0xd9, 0x64, 0xf8, 0xdb, 0x25, 0x80, 0xdc, 0xc4, 0xd5, 0x62, 0x3c, 0xed, 0x65, 0x91, 0xad, 0xd1, 0x57, 0x81, 0x94, 0xaa, 0xa1, 0x29, 0xfc, 0x68}} , - {{0xdd, 0xb5, 0x7d, 0xab, 0x5a, 0x21, 0x41, 0x53, 0xbb, 0x17, 0x79, 0x0d, 0xd1, 0xa8, 0x0c, 0x0c, 0x20, 0x88, 0x09, 0xe9, 0x84, 0xe8, 0x25, 0x11, 0x67, 0x7a, 0x8b, 0x1a, 0xe4, 0x5d, 0xe1, 0x5d}}}, -{{{0x37, 0xea, 0xfe, 0x65, 0x3b, 0x25, 0xe8, 0xe1, 0xc2, 0xc5, 0x02, 0xa4, 0xbe, 0x98, 0x0a, 0x2b, 0x61, 0xc1, 0x9b, 0xe2, 0xd5, 0x92, 0xe6, 0x9e, 0x7d, 0x1f, 0xca, 0x43, 0x88, 0x8b, 0x2c, 0x59}} , - {{0xe0, 0xb5, 0x00, 0x1d, 0x2a, 0x6f, 0xaf, 0x79, 0x86, 0x2f, 0xa6, 0x5a, 0x93, 0xd1, 0xfe, 0xae, 0x3a, 0xee, 0xdb, 0x7c, 0x61, 0xbe, 0x7c, 0x01, 0xf9, 0xfe, 0x52, 0xdc, 0xd8, 0x52, 0xa3, 0x42}}}, -{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, - {{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, -{{{0x22, 0xaf, 0x13, 0x37, 0xbd, 0x37, 0x71, 0xac, 0x04, 0x46, 0x63, 0xac, 0xa4, 0x77, 0xed, 0x25, 0x38, 0xe0, 0x15, 0xa8, 0x64, 0x00, 0x0d, 0xce, 0x51, 0x01, 0xa9, 0xbc, 0x0f, 0x03, 0x1c, 0x04}} , - {{0x89, 0xf9, 0x80, 0x07, 0xcf, 0x3f, 0xb3, 0xe9, 0xe7, 0x45, 0x44, 0x3d, 0x2a, 0x7c, 0xe9, 0xe4, 0x16, 0x5c, 0x5e, 0x65, 0x1c, 0xc7, 0x7d, 0xc6, 0x7a, 0xfb, 0x43, 0xee, 0x25, 0x76, 0x46, 0x72}}}, -{{{0x02, 0xa2, 0xed, 0xf4, 0x8f, 0x6b, 0x0b, 0x3e, 0xeb, 0x35, 0x1a, 0xd5, 0x7e, 0xdb, 0x78, 0x00, 0x96, 0x8a, 0xa0, 0xb4, 0xcf, 0x60, 0x4b, 0xd4, 0xd5, 0xf9, 0x2d, 0xbf, 0x88, 0xbd, 0x22, 0x62}} , - {{0x13, 0x53, 0xe4, 0x82, 0x57, 0xfa, 0x1e, 0x8f, 0x06, 0x2b, 0x90, 0xba, 0x08, 0xb6, 0x10, 0x54, 0x4f, 0x7c, 0x1b, 0x26, 0xed, 0xda, 0x6b, 0xdd, 0x25, 0xd0, 0x4e, 0xea, 0x42, 0xbb, 0x25, 0x03}}}, -{{{0x51, 0x16, 0x50, 0x7c, 0xd5, 0x5d, 0xf6, 0x99, 0xe8, 0x77, 0x72, 0x4e, 0xfa, 0x62, 0xcb, 0x76, 0x75, 0x0c, 0xe2, 0x71, 0x98, 0x92, 0xd5, 0xfa, 0x45, 0xdf, 0x5c, 0x6f, 0x1e, 0x9e, 0x28, 0x69}} , - {{0x0d, 0xac, 0x66, 0x6d, 0xc3, 0x8b, 0xba, 0x16, 0xb5, 0xe2, 0xa0, 0x0d, 0x0c, 0xbd, 0xa4, 0x8e, 0x18, 0x6c, 0xf2, 0xdc, 0xf9, 0xdc, 0x4a, 0x86, 0x25, 0x95, 0x14, 0xcb, 0xd8, 0x1a, 0x04, 0x0f}}}, -{{{0x97, 0xa5, 0xdb, 0x8b, 0x2d, 0xaa, 0x42, 0x11, 0x09, 0xf2, 0x93, 0xbb, 0xd9, 0x06, 0x84, 0x4e, 0x11, 0xa8, 0xa0, 0x25, 0x2b, 0xa6, 0x5f, 0xae, 0xc4, 0xb4, 0x4c, 0xc8, 0xab, 0xc7, 0x3b, 0x02}} , - {{0xee, 0xc9, 0x29, 0x0f, 0xdf, 0x11, 0x85, 0xed, 0xce, 0x0d, 0x62, 0x2c, 0x8f, 0x4b, 0xf9, 0x04, 0xe9, 0x06, 0x72, 0x1d, 0x37, 0x20, 0x50, 0xc9, 0x14, 0xeb, 0xec, 0x39, 0xa7, 0x97, 0x2b, 0x4d}}}, -{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, - {{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, -{{{0x69, 0xd1, 0x39, 0xbd, 0xfb, 0x33, 0xbe, 0xc4, 0xf0, 0x5c, 0xef, 0xf0, 0x56, 0x68, 0xfc, 0x97, 0x47, 0xc8, 0x72, 0xb6, 0x53, 0xa4, 0x0a, 0x98, 0xa5, 0xb4, 0x37, 0x71, 0xcf, 0x66, 0x50, 0x6d}} , - {{0x17, 0xa4, 0x19, 0x52, 0x11, 0x47, 0xb3, 0x5c, 0x5b, 0xa9, 0x2e, 0x22, 0xb4, 0x00, 0x52, 0xf9, 0x57, 0x18, 0xb8, 0xbe, 0x5a, 0xe3, 0xab, 0x83, 0xc8, 0x87, 0x0a, 0x2a, 0xd8, 0x8c, 0xbb, 0x54}}}, -{{{0xa9, 0x62, 0x93, 0x85, 0xbe, 0xe8, 0x73, 0x4a, 0x0e, 0xb0, 0xb5, 0x2d, 0x94, 0x50, 0xaa, 0xd3, 0xb2, 0xea, 0x9d, 0x62, 0x76, 0x3b, 0x07, 0x34, 0x4e, 0x2d, 0x70, 0xc8, 0x9a, 0x15, 0x66, 0x6b}} , - {{0xc5, 0x96, 0xca, 0xc8, 0x22, 0x1a, 0xee, 0x5f, 0xe7, 0x31, 0x60, 0x22, 0x83, 0x08, 0x63, 0xce, 0xb9, 0x32, 0x44, 0x58, 0x5d, 0x3a, 0x9b, 0xe4, 0x04, 0xd5, 0xef, 0x38, 0xef, 0x4b, 0xdd, 0x19}}}, -{{{0x4d, 0xc2, 0x17, 0x75, 0xa1, 0x68, 0xcd, 0xc3, 0xc6, 0x03, 0x44, 0xe3, 0x78, 0x09, 0x91, 0x47, 0x3f, 0x0f, 0xe4, 0x92, 0x58, 0xfa, 0x7d, 0x1f, 0x20, 0x94, 0x58, 0x5e, 0xbc, 0x19, 0x02, 0x6f}} , - {{0x20, 0xd6, 0xd8, 0x91, 0x54, 0xa7, 0xf3, 0x20, 0x4b, 0x34, 0x06, 0xfa, 0x30, 0xc8, 0x6f, 0x14, 0x10, 0x65, 0x74, 0x13, 0x4e, 0xf0, 0x69, 0x26, 0xce, 0xcf, 0x90, 0xf4, 0xd0, 0xc5, 0xc8, 0x64}}}, -{{{0x26, 0xa2, 0x50, 0x02, 0x24, 0x72, 0xf1, 0xf0, 0x4e, 0x2d, 0x93, 0xd5, 0x08, 0xe7, 0xae, 0x38, 0xf7, 0x18, 0xa5, 0x32, 0x34, 0xc2, 0xf0, 0xa6, 0xec, 0xb9, 0x61, 0x7b, 0x64, 0x99, 0xac, 0x71}} , - {{0x25, 0xcf, 0x74, 0x55, 0x1b, 0xaa, 0xa9, 0x38, 0x41, 0x40, 0xd5, 0x95, 0x95, 0xab, 0x1c, 0x5e, 0xbc, 0x41, 0x7e, 0x14, 0x30, 0xbe, 0x13, 0x89, 0xf4, 0xe5, 0xeb, 0x28, 0xc0, 0xc2, 0x96, 0x3a}}}, -{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, - {{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, -{{{0x2b, 0x77, 0x45, 0xec, 0x67, 0x76, 0x32, 0x4c, 0xb9, 0xdf, 0x25, 0x32, 0x6b, 0xcb, 0xe7, 0x14, 0x61, 0x43, 0xee, 0xba, 0x9b, 0x71, 0xef, 0xd2, 0x48, 0x65, 0xbb, 0x1b, 0x8a, 0x13, 0x1b, 0x22}} , - {{0x84, 0xad, 0x0c, 0x18, 0x38, 0x5a, 0xba, 0xd0, 0x98, 0x59, 0xbf, 0x37, 0xb0, 0x4f, 0x97, 0x60, 0x20, 0xb3, 0x9b, 0x97, 0xf6, 0x08, 0x6c, 0xa4, 0xff, 0xfb, 0xb7, 0xfa, 0x95, 0xb2, 0x51, 0x79}}}, -{{{0x28, 0x5c, 0x3f, 0xdb, 0x6b, 0x18, 0x3b, 0x5c, 0xd1, 0x04, 0x28, 0xde, 0x85, 0x52, 0x31, 0xb5, 0xbb, 0xf6, 0xa9, 0xed, 0xbe, 0x28, 0x4f, 0xb3, 0x7e, 0x05, 0x6a, 0xdb, 0x95, 0x0d, 0x1b, 0x1c}} , - {{0xd5, 0xc5, 0xc3, 0x9a, 0x0a, 0xd0, 0x31, 0x3e, 0x07, 0x36, 0x8e, 0xc0, 0x8a, 0x62, 0xb1, 0xca, 0xd6, 0x0e, 0x1e, 0x9d, 0xef, 0xab, 0x98, 0x4d, 0xbb, 0x6c, 0x05, 0xe0, 0xe4, 0x5d, 0xbd, 0x57}}}, -{{{0xcc, 0x21, 0x27, 0xce, 0xfd, 0xa9, 0x94, 0x8e, 0xe1, 0xab, 0x49, 0xe0, 0x46, 0x26, 0xa1, 0xa8, 0x8c, 0xa1, 0x99, 0x1d, 0xb4, 0x27, 0x6d, 0x2d, 0xc8, 0x39, 0x30, 0x5e, 0x37, 0x52, 0xc4, 0x6e}} , - {{0xa9, 0x85, 0xf4, 0xe7, 0xb0, 0x15, 0x33, 0x84, 0x1b, 0x14, 0x1a, 0x02, 0xd9, 0x3b, 0xad, 0x0f, 0x43, 0x6c, 0xea, 0x3e, 0x0f, 0x7e, 0xda, 0xdd, 0x6b, 0x4c, 0x7f, 0x6e, 0xd4, 0x6b, 0xbf, 0x0f}}}, -{{{0x47, 0x9f, 0x7c, 0x56, 0x7c, 0x43, 0x91, 0x1c, 0xbb, 0x4e, 0x72, 0x3e, 0x64, 0xab, 0xa0, 0xa0, 0xdf, 0xb4, 0xd8, 0x87, 0x3a, 0xbd, 0xa8, 0x48, 0xc9, 0xb8, 0xef, 0x2e, 0xad, 0x6f, 0x84, 0x4f}} , - {{0x2d, 0x2d, 0xf0, 0x1b, 0x7e, 0x2a, 0x6c, 0xf8, 0xa9, 0x6a, 0xe1, 0xf0, 0x99, 0xa1, 0x67, 0x9a, 0xd4, 0x13, 0xca, 0xca, 0xba, 0x27, 0x92, 0xaa, 0xa1, 0x5d, 0x50, 0xde, 0xcc, 0x40, 0x26, 0x0a}}}, -{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, - {{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, -{{{0x9f, 0x3e, 0xf2, 0xb2, 0x90, 0xce, 0xdb, 0x64, 0x3e, 0x03, 0xdd, 0x37, 0x36, 0x54, 0x70, 0x76, 0x24, 0xb5, 0x69, 0x03, 0xfc, 0xa0, 0x2b, 0x74, 0xb2, 0x05, 0x0e, 0xcc, 0xd8, 0x1f, 0x6a, 0x1f}} , - {{0x19, 0x5e, 0x60, 0x69, 0x58, 0x86, 0xa0, 0x31, 0xbd, 0x32, 0xe9, 0x2c, 0x5c, 0xd2, 0x85, 0xba, 0x40, 0x64, 0xa8, 0x74, 0xf8, 0x0e, 0x1c, 0xb3, 0xa9, 0x69, 0xe8, 0x1e, 0x40, 0x64, 0x99, 0x77}}}, -{{{0x6c, 0x32, 0x4f, 0xfd, 0xbb, 0x5c, 0xbb, 0x8d, 0x64, 0x66, 0x4a, 0x71, 0x1f, 0x79, 0xa3, 0xad, 0x8d, 0xf9, 0xd4, 0xec, 0xcf, 0x67, 0x70, 0xfa, 0x05, 0x4a, 0x0f, 0x6e, 0xaf, 0x87, 0x0a, 0x6f}} , - {{0xc6, 0x36, 0x6e, 0x6c, 0x8c, 0x24, 0x09, 0x60, 0xbe, 0x26, 0xd2, 0x4c, 0x5e, 0x17, 0xca, 0x5f, 0x1d, 0xcc, 0x87, 0xe8, 0x42, 0x6a, 0xcb, 0xcb, 0x7d, 0x92, 0x05, 0x35, 0x81, 0x13, 0x60, 0x6b}}}, -{{{0xf4, 0x15, 0xcd, 0x0f, 0x0a, 0xaf, 0x4e, 0x6b, 0x51, 0xfd, 0x14, 0xc4, 0x2e, 0x13, 0x86, 0x74, 0x44, 0xcb, 0x66, 0x6b, 0xb6, 0x9d, 0x74, 0x56, 0x32, 0xac, 0x8d, 0x8e, 0x8c, 0x8c, 0x8c, 0x39}} , - {{0xca, 0x59, 0x74, 0x1a, 0x11, 0xef, 0x6d, 0xf7, 0x39, 0x5c, 0x3b, 0x1f, 0xfa, 0xe3, 0x40, 0x41, 0x23, 0x9e, 0xf6, 0xd1, 0x21, 0xa2, 0xbf, 0xad, 0x65, 0x42, 0x6b, 0x59, 0x8a, 0xe8, 0xc5, 0x7f}}}, -{{{0x64, 0x05, 0x7a, 0x84, 0x4a, 0x13, 0xc3, 0xf6, 0xb0, 0x6e, 0x9a, 0x6b, 0x53, 0x6b, 0x32, 0xda, 0xd9, 0x74, 0x75, 0xc4, 0xba, 0x64, 0x3d, 0x3b, 0x08, 0xdd, 0x10, 0x46, 0xef, 0xc7, 0x90, 0x1f}} , - {{0x7b, 0x2f, 0x3a, 0xce, 0xc8, 0xa1, 0x79, 0x3c, 0x30, 0x12, 0x44, 0x28, 0xf6, 0xbc, 0xff, 0xfd, 0xf4, 0xc0, 0x97, 0xb0, 0xcc, 0xc3, 0x13, 0x7a, 0xb9, 0x9a, 0x16, 0xe4, 0xcb, 0x4c, 0x34, 0x63}}}, -{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, - {{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, -{{{0x07, 0x4e, 0xd3, 0x2d, 0x09, 0x33, 0x0e, 0xd2, 0x0d, 0xbe, 0x3e, 0xe7, 0xe4, 0xaa, 0xb7, 0x00, 0x8b, 0xe8, 0xad, 0xaa, 0x7a, 0x8d, 0x34, 0x28, 0xa9, 0x81, 0x94, 0xc5, 0xe7, 0x42, 0xac, 0x47}} , - {{0x24, 0x89, 0x7a, 0x8f, 0xb5, 0x9b, 0xf0, 0xc2, 0x03, 0x64, 0xd0, 0x1e, 0xf5, 0xa4, 0xb2, 0xf3, 0x74, 0xe9, 0x1a, 0x16, 0xfd, 0xcb, 0x15, 0xea, 0xeb, 0x10, 0x6c, 0x35, 0xd1, 0xc1, 0xa6, 0x28}}}, -{{{0xcc, 0xd5, 0x39, 0xfc, 0xa5, 0xa4, 0xad, 0x32, 0x15, 0xce, 0x19, 0xe8, 0x34, 0x2b, 0x1c, 0x60, 0x91, 0xfc, 0x05, 0xa9, 0xb3, 0xdc, 0x80, 0x29, 0xc4, 0x20, 0x79, 0x06, 0x39, 0xc0, 0xe2, 0x22}} , - {{0xbb, 0xa8, 0xe1, 0x89, 0x70, 0x57, 0x18, 0x54, 0x3c, 0xf6, 0x0d, 0x82, 0x12, 0x05, 0x87, 0x96, 0x06, 0x39, 0xe3, 0xf8, 0xb3, 0x95, 0xe5, 0xd7, 0x26, 0xbf, 0x09, 0x5a, 0x94, 0xf9, 0x1c, 0x63}}}, -{{{0x2b, 0x8c, 0x2d, 0x9a, 0x8b, 0x84, 0xf2, 0x56, 0xfb, 0xad, 0x2e, 0x7f, 0xb7, 0xfc, 0x30, 0xe1, 0x35, 0x89, 0xba, 0x4d, 0xa8, 0x6d, 0xce, 0x8c, 0x8b, 0x30, 0xe0, 0xda, 0x29, 0x18, 0x11, 0x17}} , - {{0x19, 0xa6, 0x5a, 0x65, 0x93, 0xc3, 0xb5, 0x31, 0x22, 0x4f, 0xf3, 0xf6, 0x0f, 0xeb, 0x28, 0xc3, 0x7c, 0xeb, 0xce, 0x86, 0xec, 0x67, 0x76, 0x6e, 0x35, 0x45, 0x7b, 0xd8, 0x6b, 0x92, 0x01, 0x65}}}, -{{{0x3d, 0xd5, 0x9a, 0x64, 0x73, 0x36, 0xb1, 0xd6, 0x86, 0x98, 0x42, 0x3f, 0x8a, 0xf1, 0xc7, 0xf5, 0x42, 0xa8, 0x9c, 0x52, 0xa8, 0xdc, 0xf9, 0x24, 0x3f, 0x4a, 0xa1, 0xa4, 0x5b, 0xe8, 0x62, 0x1a}} , - {{0xc5, 0xbd, 0xc8, 0x14, 0xd5, 0x0d, 0xeb, 0xe1, 0xa5, 0xe6, 0x83, 0x11, 0x09, 0x00, 0x1d, 0x55, 0x83, 0x51, 0x7e, 0x75, 0x00, 0x81, 0xb9, 0xcb, 0xd8, 0xc5, 0xe5, 0xa1, 0xd9, 0x17, 0x6d, 0x1f}}}, -{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, - {{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, -{{{0xea, 0xf9, 0xe4, 0xe9, 0xe1, 0x52, 0x3f, 0x51, 0x19, 0x0d, 0xdd, 0xd9, 0x9d, 0x93, 0x31, 0x87, 0x23, 0x09, 0xd5, 0x83, 0xeb, 0x92, 0x09, 0x76, 0x6e, 0xe3, 0xf8, 0xc0, 0xa2, 0x66, 0xb5, 0x36}} , - {{0x3a, 0xbb, 0x39, 0xed, 0x32, 0x02, 0xe7, 0x43, 0x7a, 0x38, 0x14, 0x84, 0xe3, 0x44, 0xd2, 0x5e, 0x94, 0xdd, 0x78, 0x89, 0x55, 0x4c, 0x73, 0x9e, 0xe1, 0xe4, 0x3e, 0x43, 0xd0, 0x4a, 0xde, 0x1b}}}, -{{{0xb2, 0xe7, 0x8f, 0xe3, 0xa3, 0xc5, 0xcb, 0x72, 0xee, 0x79, 0x41, 0xf8, 0xdf, 0xee, 0x65, 0xc5, 0x45, 0x77, 0x27, 0x3c, 0xbd, 0x58, 0xd3, 0x75, 0xe2, 0x04, 0x4b, 0xbb, 0x65, 0xf3, 0xc8, 0x0f}} , - {{0x24, 0x7b, 0x93, 0x34, 0xb5, 0xe2, 0x74, 0x48, 0xcd, 0xa0, 0x0b, 0x92, 0x97, 0x66, 0x39, 0xf4, 0xb0, 0xe2, 0x5d, 0x39, 0x6a, 0x5b, 0x45, 0x17, 0x78, 0x1e, 0xdb, 0x91, 0x81, 0x1c, 0xf9, 0x16}}}, -{{{0x16, 0xdf, 0xd1, 0x5a, 0xd5, 0xe9, 0x4e, 0x58, 0x95, 0x93, 0x5f, 0x51, 0x09, 0xc3, 0x2a, 0xc9, 0xd4, 0x55, 0x48, 0x79, 0xa4, 0xa3, 0xb2, 0xc3, 0x62, 0xaa, 0x8c, 0xe8, 0xad, 0x47, 0x39, 0x1b}} , - {{0x46, 0xda, 0x9e, 0x51, 0x3a, 0xe6, 0xd1, 0xa6, 0xbb, 0x4d, 0x7b, 0x08, 0xbe, 0x8c, 0xd5, 0xf3, 0x3f, 0xfd, 0xf7, 0x44, 0x80, 0x2d, 0x53, 0x4b, 0xd0, 0x87, 0x68, 0xc1, 0xb5, 0xd8, 0xf7, 0x07}}}, -{{{0xf4, 0x10, 0x46, 0xbe, 0xb7, 0xd2, 0xd1, 0xce, 0x5e, 0x76, 0xa2, 0xd7, 0x03, 0xdc, 0xe4, 0x81, 0x5a, 0xf6, 0x3c, 0xde, 0xae, 0x7a, 0x9d, 0x21, 0x34, 0xa5, 0xf6, 0xa9, 0x73, 0xe2, 0x8d, 0x60}} , - {{0xfa, 0x44, 0x71, 0xf6, 0x41, 0xd8, 0xc6, 0x58, 0x13, 0x37, 0xeb, 0x84, 0x0f, 0x96, 0xc7, 0xdc, 0xc8, 0xa9, 0x7a, 0x83, 0xb2, 0x2f, 0x31, 0xb1, 0x1a, 0xd8, 0x98, 0x3f, 0x11, 0xd0, 0x31, 0x3b}}}, -{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, - {{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, -{{{0x81, 0xd5, 0x34, 0x16, 0x01, 0xa3, 0x93, 0xea, 0x52, 0x94, 0xec, 0x93, 0xb7, 0x81, 0x11, 0x2d, 0x58, 0xf9, 0xb5, 0x0a, 0xaa, 0x4f, 0xf6, 0x2e, 0x3f, 0x36, 0xbf, 0x33, 0x5a, 0xe7, 0xd1, 0x08}} , - {{0x1a, 0xcf, 0x42, 0xae, 0xcc, 0xb5, 0x77, 0x39, 0xc4, 0x5b, 0x5b, 0xd0, 0x26, 0x59, 0x27, 0xd0, 0x55, 0x71, 0x12, 0x9d, 0x88, 0x3d, 0x9c, 0xea, 0x41, 0x6a, 0xf0, 0x50, 0x93, 0x93, 0xdd, 0x47}}}, -{{{0x6f, 0xc9, 0x51, 0x6d, 0x1c, 0xaa, 0xf5, 0xa5, 0x90, 0x3f, 0x14, 0xe2, 0x6e, 0x8e, 0x64, 0xfd, 0xac, 0xe0, 0x4e, 0x22, 0xe5, 0xc1, 0xbc, 0x29, 0x0a, 0x6a, 0x9e, 0xa1, 0x60, 0xcb, 0x2f, 0x0b}} , - {{0xdc, 0x39, 0x32, 0xf3, 0xa1, 0x44, 0xe9, 0xc5, 0xc3, 0x78, 0xfb, 0x95, 0x47, 0x34, 0x35, 0x34, 0xe8, 0x25, 0xde, 0x93, 0xc6, 0xb4, 0x76, 0x6d, 0x86, 0x13, 0xc6, 0xe9, 0x68, 0xb5, 0x01, 0x63}}}, -{{{0x1f, 0x9a, 0x52, 0x64, 0x97, 0xd9, 0x1c, 0x08, 0x51, 0x6f, 0x26, 0x9d, 0xaa, 0x93, 0x33, 0x43, 0xfa, 0x77, 0xe9, 0x62, 0x9b, 0x5d, 0x18, 0x75, 0xeb, 0x78, 0xf7, 0x87, 0x8f, 0x41, 0xb4, 0x4d}} , - {{0x13, 0xa8, 0x82, 0x3e, 0xe9, 0x13, 0xad, 0xeb, 0x01, 0xca, 0xcf, 0xda, 0xcd, 0xf7, 0x6c, 0xc7, 0x7a, 0xdc, 0x1e, 0x6e, 0xc8, 0x4e, 0x55, 0x62, 0x80, 0xea, 0x78, 0x0c, 0x86, 0xb9, 0x40, 0x51}}}, -{{{0x27, 0xae, 0xd3, 0x0d, 0x4c, 0x8f, 0x34, 0xea, 0x7d, 0x3c, 0xe5, 0x8a, 0xcf, 0x5b, 0x92, 0xd8, 0x30, 0x16, 0xb4, 0xa3, 0x75, 0xff, 0xeb, 0x27, 0xc8, 0x5c, 0x6c, 0xc2, 0xee, 0x6c, 0x21, 0x0b}} , - {{0xc3, 0xba, 0x12, 0x53, 0x2a, 0xaa, 0x77, 0xad, 0x19, 0x78, 0x55, 0x8a, 0x2e, 0x60, 0x87, 0xc2, 0x6e, 0x91, 0x38, 0x91, 0x3f, 0x7a, 0xc5, 0x24, 0x8f, 0x51, 0xc5, 0xde, 0xb0, 0x53, 0x30, 0x56}}}, -{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, - {{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, -{{{0x02, 0xfe, 0x54, 0x12, 0x18, 0xca, 0x7d, 0xa5, 0x68, 0x43, 0xa3, 0x6d, 0x14, 0x2a, 0x6a, 0xa5, 0x8e, 0x32, 0xe7, 0x63, 0x4f, 0xe3, 0xc6, 0x44, 0x3e, 0xab, 0x63, 0xca, 0x17, 0x86, 0x74, 0x3f}} , - {{0x1e, 0x64, 0xc1, 0x7d, 0x52, 0xdc, 0x13, 0x5a, 0xa1, 0x9c, 0x4e, 0xee, 0x99, 0x28, 0xbb, 0x4c, 0xee, 0xac, 0xa9, 0x1b, 0x89, 0xa2, 0x38, 0x39, 0x7b, 0xc4, 0x0f, 0x42, 0xe6, 0x89, 0xed, 0x0f}}}, -{{{0xf3, 0x3c, 0x8c, 0x80, 0x83, 0x10, 0x8a, 0x37, 0x50, 0x9c, 0xb4, 0xdf, 0x3f, 0x8c, 0xf7, 0x23, 0x07, 0xd6, 0xff, 0xa0, 0x82, 0x6c, 0x75, 0x3b, 0xe4, 0xb5, 0xbb, 0xe4, 0xe6, 0x50, 0xf0, 0x08}} , - {{0x62, 0xee, 0x75, 0x48, 0x92, 0x33, 0xf2, 0xf4, 0xad, 0x15, 0x7a, 0xa1, 0x01, 0x46, 0xa9, 0x32, 0x06, 0x88, 0xb6, 0x36, 0x47, 0x35, 0xb9, 0xb4, 0x42, 0x85, 0x76, 0xf0, 0x48, 0x00, 0x90, 0x38}}}, -{{{0x51, 0x15, 0x9d, 0xc3, 0x95, 0xd1, 0x39, 0xbb, 0x64, 0x9d, 0x15, 0x81, 0xc1, 0x68, 0xd0, 0xb6, 0xa4, 0x2c, 0x7d, 0x5e, 0x02, 0x39, 0x00, 0xe0, 0x3b, 0xa4, 0xcc, 0xca, 0x1d, 0x81, 0x24, 0x10}} , - {{0xe7, 0x29, 0xf9, 0x37, 0xd9, 0x46, 0x5a, 0xcd, 0x70, 0xfe, 0x4d, 0x5b, 0xbf, 0xa5, 0xcf, 0x91, 0xf4, 0xef, 0xee, 0x8a, 0x29, 0xd0, 0xe7, 0xc4, 0x25, 0x92, 0x8a, 0xff, 0x36, 0xfc, 0xe4, 0x49}}}, -{{{0xbd, 0x00, 0xb9, 0x04, 0x7d, 0x35, 0xfc, 0xeb, 0xd0, 0x0b, 0x05, 0x32, 0x52, 0x7a, 0x89, 0x24, 0x75, 0x50, 0xe1, 0x63, 0x02, 0x82, 0x8e, 0xe7, 0x85, 0x0c, 0xf2, 0x56, 0x44, 0x37, 0x83, 0x25}} , - {{0x8f, 0xa1, 0xce, 0xcb, 0x60, 0xda, 0x12, 0x02, 0x1e, 0x29, 0x39, 0x2a, 0x03, 0xb7, 0xeb, 0x77, 0x40, 0xea, 0xc9, 0x2b, 0x2c, 0xd5, 0x7d, 0x7e, 0x2c, 0xc7, 0x5a, 0xfd, 0xff, 0xc4, 0xd1, 0x62}}}, -{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, - {{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, -{{{0x1d, 0x88, 0x98, 0x5b, 0x4e, 0xfc, 0x41, 0x24, 0x05, 0xe6, 0x50, 0x2b, 0xae, 0x96, 0x51, 0xd9, 0x6b, 0x72, 0xb2, 0x33, 0x42, 0x98, 0x68, 0xbb, 0x10, 0x5a, 0x7a, 0x8c, 0x9d, 0x07, 0xb4, 0x05}} , - {{0x2f, 0x61, 0x9f, 0xd7, 0xa8, 0x3f, 0x83, 0x8c, 0x10, 0x69, 0x90, 0xe6, 0xcf, 0xd2, 0x63, 0xa3, 0xe4, 0x54, 0x7e, 0xe5, 0x69, 0x13, 0x1c, 0x90, 0x57, 0xaa, 0xe9, 0x53, 0x22, 0x43, 0x29, 0x23}}}, -{{{0xe5, 0x1c, 0xf8, 0x0a, 0xfd, 0x2d, 0x7e, 0xf5, 0xf5, 0x70, 0x7d, 0x41, 0x6b, 0x11, 0xfe, 0xbe, 0x99, 0xd1, 0x55, 0x29, 0x31, 0xbf, 0xc0, 0x97, 0x6c, 0xd5, 0x35, 0xcc, 0x5e, 0x8b, 0xd9, 0x69}} , - {{0x8e, 0x4e, 0x9f, 0x25, 0xf8, 0x81, 0x54, 0x2d, 0x0e, 0xd5, 0x54, 0x81, 0x9b, 0xa6, 0x92, 0xce, 0x4b, 0xe9, 0x8f, 0x24, 0x3b, 0xca, 0xe0, 0x44, 0xab, 0x36, 0xfe, 0xfb, 0x87, 0xd4, 0x26, 0x3e}}}, -{{{0x0f, 0x93, 0x9c, 0x11, 0xe7, 0xdb, 0xf1, 0xf0, 0x85, 0x43, 0x28, 0x15, 0x37, 0xdd, 0xde, 0x27, 0xdf, 0xad, 0x3e, 0x49, 0x4f, 0xe0, 0x5b, 0xf6, 0x80, 0x59, 0x15, 0x3c, 0x85, 0xb7, 0x3e, 0x12}} , - {{0xf5, 0xff, 0xcc, 0xf0, 0xb4, 0x12, 0x03, 0x5f, 0xc9, 0x84, 0xcb, 0x1d, 0x17, 0xe0, 0xbc, 0xcc, 0x03, 0x62, 0xa9, 0x8b, 0x94, 0xa6, 0xaa, 0x18, 0xcb, 0x27, 0x8d, 0x49, 0xa6, 0x17, 0x15, 0x07}}}, -{{{0xd9, 0xb6, 0xd4, 0x9d, 0xd4, 0x6a, 0xaf, 0x70, 0x07, 0x2c, 0x10, 0x9e, 0xbd, 0x11, 0xad, 0xe4, 0x26, 0x33, 0x70, 0x92, 0x78, 0x1c, 0x74, 0x9f, 0x75, 0x60, 0x56, 0xf4, 0x39, 0xa8, 0xa8, 0x62}} , - {{0x3b, 0xbf, 0x55, 0x35, 0x61, 0x8b, 0x44, 0x97, 0xe8, 0x3a, 0x55, 0xc1, 0xc8, 0x3b, 0xfd, 0x95, 0x29, 0x11, 0x60, 0x96, 0x1e, 0xcb, 0x11, 0x9d, 0xc2, 0x03, 0x8a, 0x1b, 0xc6, 0xd6, 0x45, 0x3d}}}, -{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, - {{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, -{{{0x7e, 0x0e, 0x50, 0xb2, 0xcc, 0x0d, 0x6b, 0xa6, 0x71, 0x5b, 0x42, 0xed, 0xbd, 0xaf, 0xac, 0xf0, 0xfc, 0x12, 0xa2, 0x3f, 0x4e, 0xda, 0xe8, 0x11, 0xf3, 0x23, 0xe1, 0x04, 0x62, 0x03, 0x1c, 0x4e}} , - {{0xc8, 0xb1, 0x1b, 0x6f, 0x73, 0x61, 0x3d, 0x27, 0x0d, 0x7d, 0x7a, 0x25, 0x5f, 0x73, 0x0e, 0x2f, 0x93, 0xf6, 0x24, 0xd8, 0x4f, 0x90, 0xac, 0xa2, 0x62, 0x0a, 0xf0, 0x61, 0xd9, 0x08, 0x59, 0x6a}}}, -{{{0x6f, 0x2d, 0x55, 0xf8, 0x2f, 0x8e, 0xf0, 0x18, 0x3b, 0xea, 0xdd, 0x26, 0x72, 0xd1, 0xf5, 0xfe, 0xe5, 0xb8, 0xe6, 0xd3, 0x10, 0x48, 0x46, 0x49, 0x3a, 0x9f, 0x5e, 0x45, 0x6b, 0x90, 0xe8, 0x7f}} , - {{0xd3, 0x76, 0x69, 0x33, 0x7b, 0xb9, 0x40, 0x70, 0xee, 0xa6, 0x29, 0x6b, 0xdd, 0xd0, 0x5d, 0x8d, 0xc1, 0x3e, 0x4a, 0xea, 0x37, 0xb1, 0x03, 0x02, 0x03, 0x35, 0xf1, 0x28, 0x9d, 0xff, 0x00, 0x13}}}, -{{{0x7a, 0xdb, 0x12, 0xd2, 0x8a, 0x82, 0x03, 0x1b, 0x1e, 0xaf, 0xf9, 0x4b, 0x9c, 0xbe, 0xae, 0x7c, 0xe4, 0x94, 0x2a, 0x23, 0xb3, 0x62, 0x86, 0xe7, 0xfd, 0x23, 0xaa, 0x99, 0xbd, 0x2b, 0x11, 0x6c}} , - {{0x8d, 0xa6, 0xd5, 0xac, 0x9d, 0xcc, 0x68, 0x75, 0x7f, 0xc3, 0x4d, 0x4b, 0xdd, 0x6c, 0xbb, 0x11, 0x5a, 0x60, 0xe5, 0xbd, 0x7d, 0x27, 0x8b, 0xda, 0xb4, 0x95, 0xf6, 0x03, 0x27, 0xa4, 0x92, 0x3f}}}, -{{{0x22, 0xd6, 0xb5, 0x17, 0x84, 0xbf, 0x12, 0xcc, 0x23, 0x14, 0x4a, 0xdf, 0x14, 0x31, 0xbc, 0xa1, 0xac, 0x6e, 0xab, 0xfa, 0x57, 0x11, 0x53, 0xb3, 0x27, 0xe6, 0xf9, 0x47, 0x33, 0x44, 0x34, 0x1e}} , - {{0x79, 0xfc, 0xa6, 0xb4, 0x0b, 0x35, 0x20, 0xc9, 0x4d, 0x22, 0x84, 0xc4, 0xa9, 0x20, 0xec, 0x89, 0x94, 0xba, 0x66, 0x56, 0x48, 0xb9, 0x87, 0x7f, 0xca, 0x1e, 0x06, 0xed, 0xa5, 0x55, 0x59, 0x29}}}, -{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, - {{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, -{{{0x56, 0xe1, 0xf5, 0xf1, 0xd5, 0xab, 0xa8, 0x2b, 0xae, 0x89, 0xf3, 0xcf, 0x56, 0x9f, 0xf2, 0x4b, 0x31, 0xbc, 0x18, 0xa9, 0x06, 0x5b, 0xbe, 0xb4, 0x61, 0xf8, 0xb2, 0x06, 0x9c, 0x81, 0xab, 0x4c}} , - {{0x1f, 0x68, 0x76, 0x01, 0x16, 0x38, 0x2b, 0x0f, 0x77, 0x97, 0x92, 0x67, 0x4e, 0x86, 0x6a, 0x8b, 0xe5, 0xe8, 0x0c, 0xf7, 0x36, 0x39, 0xb5, 0x33, 0xe6, 0xcf, 0x5e, 0xbd, 0x18, 0xfb, 0x10, 0x1f}}}, -{{{0x83, 0xf0, 0x0d, 0x63, 0xef, 0x53, 0x6b, 0xb5, 0x6b, 0xf9, 0x83, 0xcf, 0xde, 0x04, 0x22, 0x9b, 0x2c, 0x0a, 0xe0, 0xa5, 0xd8, 0xc7, 0x9c, 0xa5, 0xa3, 0xf6, 0x6f, 0xcf, 0x90, 0x6b, 0x68, 0x7c}} , - {{0x33, 0x15, 0xd7, 0x7f, 0x1a, 0xd5, 0x21, 0x58, 0xc4, 0x18, 0xa5, 0xf0, 0xcc, 0x73, 0xa8, 0xfd, 0xfa, 0x18, 0xd1, 0x03, 0x91, 0x8d, 0x52, 0xd2, 0xa3, 0xa4, 0xd3, 0xb1, 0xea, 0x1d, 0x0f, 0x00}}}, -{{{0xcc, 0x48, 0x83, 0x90, 0xe5, 0xfd, 0x3f, 0x84, 0xaa, 0xf9, 0x8b, 0x82, 0x59, 0x24, 0x34, 0x68, 0x4f, 0x1c, 0x23, 0xd9, 0xcc, 0x71, 0xe1, 0x7f, 0x8c, 0xaf, 0xf1, 0xee, 0x00, 0xb6, 0xa0, 0x77}} , - {{0xf5, 0x1a, 0x61, 0xf7, 0x37, 0x9d, 0x00, 0xf4, 0xf2, 0x69, 0x6f, 0x4b, 0x01, 0x85, 0x19, 0x45, 0x4d, 0x7f, 0x02, 0x7c, 0x6a, 0x05, 0x47, 0x6c, 0x1f, 0x81, 0x20, 0xd4, 0xe8, 0x50, 0x27, 0x72}}}, -{{{0x2c, 0x3a, 0xe5, 0xad, 0xf4, 0xdd, 0x2d, 0xf7, 0x5c, 0x44, 0xb5, 0x5b, 0x21, 0xa3, 0x89, 0x5f, 0x96, 0x45, 0xca, 0x4d, 0xa4, 0x21, 0x99, 0x70, 0xda, 0xc4, 0xc4, 0xa0, 0xe5, 0xf4, 0xec, 0x0a}} , - {{0x07, 0x68, 0x21, 0x65, 0xe9, 0x08, 0xa0, 0x0b, 0x6a, 0x4a, 0xba, 0xb5, 0x80, 0xaf, 0xd0, 0x1b, 0xc5, 0xf5, 0x4b, 0x73, 0x50, 0x60, 0x2d, 0x71, 0x69, 0x61, 0x0e, 0xc0, 0x20, 0x40, 0x30, 0x19}}}, -{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, - {{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, -{{{0xd0, 0x75, 0x57, 0x3b, 0xeb, 0x5c, 0x14, 0x56, 0x50, 0xc9, 0x4f, 0xb8, 0xb8, 0x1e, 0xa3, 0xf4, 0xab, 0xf5, 0xa9, 0x20, 0x15, 0x94, 0x82, 0xda, 0x96, 0x1c, 0x9b, 0x59, 0x8c, 0xff, 0xf4, 0x51}} , - {{0xc1, 0x3a, 0x86, 0xd7, 0xb0, 0x06, 0x84, 0x7f, 0x1b, 0xbd, 0xd4, 0x07, 0x78, 0x80, 0x2e, 0xb1, 0xb4, 0xee, 0x52, 0x38, 0xee, 0x9a, 0xf9, 0xf6, 0xf3, 0x41, 0x6e, 0xd4, 0x88, 0x95, 0xac, 0x35}}}, -{{{0x41, 0x97, 0xbf, 0x71, 0x6a, 0x9b, 0x72, 0xec, 0xf3, 0xf8, 0x6b, 0xe6, 0x0e, 0x6c, 0x69, 0xa5, 0x2f, 0x68, 0x52, 0xd8, 0x61, 0x81, 0xc0, 0x63, 0x3f, 0xa6, 0x3c, 0x13, 0x90, 0xe6, 0x8d, 0x56}} , - {{0xe8, 0x39, 0x30, 0x77, 0x23, 0xb1, 0xfd, 0x1b, 0x3d, 0x3e, 0x74, 0x4d, 0x7f, 0xae, 0x5b, 0x3a, 0xb4, 0x65, 0x0e, 0x3a, 0x43, 0xdc, 0xdc, 0x41, 0x47, 0xe6, 0xe8, 0x92, 0x09, 0x22, 0x48, 0x4c}}}, -{{{0x85, 0x57, 0x9f, 0xb5, 0xc8, 0x06, 0xb2, 0x9f, 0x47, 0x3f, 0xf0, 0xfa, 0xe6, 0xa9, 0xb1, 0x9b, 0x6f, 0x96, 0x7d, 0xf9, 0xa4, 0x65, 0x09, 0x75, 0x32, 0xa6, 0x6c, 0x7f, 0x47, 0x4b, 0x2f, 0x4f}} , - {{0x34, 0xe9, 0x59, 0x93, 0x9d, 0x26, 0x80, 0x54, 0xf2, 0xcc, 0x3c, 0xc2, 0x25, 0x85, 0xe3, 0x6a, 0xc1, 0x62, 0x04, 0xa7, 0x08, 0x32, 0x6d, 0xa1, 0x39, 0x84, 0x8a, 0x3b, 0x87, 0x5f, 0x11, 0x13}}}, -{{{0xda, 0x03, 0x34, 0x66, 0xc4, 0x0c, 0x73, 0x6e, 0xbc, 0x24, 0xb5, 0xf9, 0x70, 0x81, 0x52, 0xe9, 0xf4, 0x7c, 0x23, 0xdd, 0x9f, 0xb8, 0x46, 0xef, 0x1d, 0x22, 0x55, 0x7d, 0x71, 0xc4, 0x42, 0x33}} , - {{0xc5, 0x37, 0x69, 0x5b, 0xa8, 0xc6, 0x9d, 0xa4, 0xfc, 0x61, 0x6e, 0x68, 0x46, 0xea, 0xd7, 0x1c, 0x67, 0xd2, 0x7d, 0xfa, 0xf1, 0xcc, 0x54, 0x8d, 0x36, 0x35, 0xc9, 0x00, 0xdf, 0x6c, 0x67, 0x50}}}, -{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, - {{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, -{{{0x9a, 0x4d, 0x42, 0x29, 0x5d, 0xa4, 0x6b, 0x6f, 0xa8, 0x8a, 0x4d, 0x91, 0x7b, 0xd2, 0xdf, 0x36, 0xef, 0x01, 0x22, 0xc5, 0xcc, 0x8d, 0xeb, 0x58, 0x3d, 0xb3, 0x50, 0xfc, 0x8b, 0x97, 0x96, 0x33}} , - {{0x93, 0x33, 0x07, 0xc8, 0x4a, 0xca, 0xd0, 0xb1, 0xab, 0xbd, 0xdd, 0xa7, 0x7c, 0xac, 0x3e, 0x45, 0xcb, 0xcc, 0x07, 0x91, 0xbf, 0x35, 0x9d, 0xcb, 0x7d, 0x12, 0x3c, 0x11, 0x59, 0x13, 0xcf, 0x5c}}}, -{{{0x45, 0xb8, 0x41, 0xd7, 0xab, 0x07, 0x15, 0x00, 0x8e, 0xce, 0xdf, 0xb2, 0x43, 0x5c, 0x01, 0xdc, 0xf4, 0x01, 0x51, 0x95, 0x10, 0x5a, 0xf6, 0x24, 0x24, 0xa0, 0x19, 0x3a, 0x09, 0x2a, 0xaa, 0x3f}} , - {{0xdc, 0x8e, 0xeb, 0xc6, 0xbf, 0xdd, 0x11, 0x7b, 0xe7, 0x47, 0xe6, 0xce, 0xe7, 0xb6, 0xc5, 0xe8, 0x8a, 0xdc, 0x4b, 0x57, 0x15, 0x3b, 0x66, 0xca, 0x89, 0xa3, 0xfd, 0xac, 0x0d, 0xe1, 0x1d, 0x7a}}}, -{{{0x89, 0xef, 0xbf, 0x03, 0x75, 0xd0, 0x29, 0x50, 0xcb, 0x7d, 0xd6, 0xbe, 0xad, 0x5f, 0x7b, 0x00, 0x32, 0xaa, 0x98, 0xed, 0x3f, 0x8f, 0x92, 0xcb, 0x81, 0x56, 0x01, 0x63, 0x64, 0xa3, 0x38, 0x39}} , - {{0x8b, 0xa4, 0xd6, 0x50, 0xb4, 0xaa, 0x5d, 0x64, 0x64, 0x76, 0x2e, 0xa1, 0xa6, 0xb3, 0xb8, 0x7c, 0x7a, 0x56, 0xf5, 0x5c, 0x4e, 0x84, 0x5c, 0xfb, 0xdd, 0xca, 0x48, 0x8b, 0x48, 0xb9, 0xba, 0x34}}}, -{{{0xc5, 0xe3, 0xe8, 0xae, 0x17, 0x27, 0xe3, 0x64, 0x60, 0x71, 0x47, 0x29, 0x02, 0x0f, 0x92, 0x5d, 0x10, 0x93, 0xc8, 0x0e, 0xa1, 0xed, 0xba, 0xa9, 0x96, 0x1c, 0xc5, 0x76, 0x30, 0xcd, 0xf9, 0x30}} , - {{0x95, 0xb0, 0xbd, 0x8c, 0xbc, 0xa7, 0x4f, 0x7e, 0xfd, 0x4e, 0x3a, 0xbf, 0x5f, 0x04, 0x79, 0x80, 0x2b, 0x5a, 0x9f, 0x4f, 0x68, 0x21, 0x19, 0x71, 0xc6, 0x20, 0x01, 0x42, 0xaa, 0xdf, 0xae, 0x2c}}}, -{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, - {{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, -{{{0x90, 0x6e, 0x7e, 0x4b, 0x71, 0x93, 0xc0, 0x72, 0xed, 0xeb, 0x71, 0x24, 0x97, 0x26, 0x9c, 0xfe, 0xcb, 0x3e, 0x59, 0x19, 0xa8, 0x0f, 0x75, 0x7d, 0xbe, 0x18, 0xe6, 0x96, 0x1e, 0x95, 0x70, 0x60}} , - {{0x89, 0x66, 0x3e, 0x1d, 0x4c, 0x5f, 0xfe, 0xc0, 0x04, 0x43, 0xd6, 0x44, 0x19, 0xb5, 0xad, 0xc7, 0x22, 0xdc, 0x71, 0x28, 0x64, 0xde, 0x41, 0x38, 0x27, 0x8f, 0x2c, 0x6b, 0x08, 0xb8, 0xb8, 0x7b}}}, -{{{0x3d, 0x70, 0x27, 0x9d, 0xd9, 0xaf, 0xb1, 0x27, 0xaf, 0xe3, 0x5d, 0x1e, 0x3a, 0x30, 0x54, 0x61, 0x60, 0xe8, 0xc3, 0x26, 0x3a, 0xbc, 0x7e, 0xf5, 0x81, 0xdd, 0x64, 0x01, 0x04, 0xeb, 0xc0, 0x1e}} , - {{0xda, 0x2c, 0xa4, 0xd1, 0xa1, 0xc3, 0x5c, 0x6e, 0x32, 0x07, 0x1f, 0xb8, 0x0e, 0x19, 0x9e, 0x99, 0x29, 0x33, 0x9a, 0xae, 0x7a, 0xed, 0x68, 0x42, 0x69, 0x7c, 0x07, 0xb3, 0x38, 0x2c, 0xf6, 0x3d}}}, -{{{0x64, 0xaa, 0xb5, 0x88, 0x79, 0x65, 0x38, 0x8c, 0x94, 0xd6, 0x62, 0x37, 0x7d, 0x64, 0xcd, 0x3a, 0xeb, 0xff, 0xe8, 0x81, 0x09, 0xc7, 0x6a, 0x50, 0x09, 0x0d, 0x28, 0x03, 0x0d, 0x9a, 0x93, 0x0a}} , - {{0x42, 0xa3, 0xf1, 0xc5, 0xb4, 0x0f, 0xd8, 0xc8, 0x8d, 0x15, 0x31, 0xbd, 0xf8, 0x07, 0x8b, 0xcd, 0x08, 0x8a, 0xfb, 0x18, 0x07, 0xfe, 0x8e, 0x52, 0x86, 0xef, 0xbe, 0xec, 0x49, 0x52, 0x99, 0x08}}}, -{{{0x0f, 0xa9, 0xd5, 0x01, 0xaa, 0x48, 0x4f, 0x28, 0x66, 0x32, 0x1a, 0xba, 0x7c, 0xea, 0x11, 0x80, 0x17, 0x18, 0x9b, 0x56, 0x88, 0x25, 0x06, 0x69, 0x12, 0x2c, 0xea, 0x56, 0x69, 0x41, 0x24, 0x19}} , - {{0xde, 0x21, 0xf0, 0xda, 0x8a, 0xfb, 0xb1, 0xb8, 0xcd, 0xc8, 0x6a, 0x82, 0x19, 0x73, 0xdb, 0xc7, 0xcf, 0x88, 0xeb, 0x96, 0xee, 0x6f, 0xfb, 0x06, 0xd2, 0xcd, 0x7d, 0x7b, 0x12, 0x28, 0x8e, 0x0c}}}, -{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, - {{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, -{{{0x93, 0x44, 0x97, 0xce, 0x28, 0xff, 0x3a, 0x40, 0xc4, 0xf5, 0xf6, 0x9b, 0xf4, 0x6b, 0x07, 0x84, 0xfb, 0x98, 0xd8, 0xec, 0x8c, 0x03, 0x57, 0xec, 0x49, 0xed, 0x63, 0xb6, 0xaa, 0xff, 0x98, 0x28}} , - {{0x3d, 0x16, 0x35, 0xf3, 0x46, 0xbc, 0xb3, 0xf4, 0xc6, 0xb6, 0x4f, 0xfa, 0xf4, 0xa0, 0x13, 0xe6, 0x57, 0x45, 0x93, 0xb9, 0xbc, 0xd6, 0x59, 0xe7, 0x77, 0x94, 0x6c, 0xab, 0x96, 0x3b, 0x4f, 0x09}}}, -{{{0x5a, 0xf7, 0x6b, 0x01, 0x12, 0x4f, 0x51, 0xc1, 0x70, 0x84, 0x94, 0x47, 0xb2, 0x01, 0x6c, 0x71, 0xd7, 0xcc, 0x17, 0x66, 0x0f, 0x59, 0x5d, 0x5d, 0x10, 0x01, 0x57, 0x11, 0xf5, 0xdd, 0xe2, 0x34}} , - {{0x26, 0xd9, 0x1f, 0x5c, 0x58, 0xac, 0x8b, 0x03, 0xd2, 0xc3, 0x85, 0x0f, 0x3a, 0xc3, 0x7f, 0x6d, 0x8e, 0x86, 0xcd, 0x52, 0x74, 0x8f, 0x55, 0x77, 0x17, 0xb7, 0x8e, 0xb7, 0x88, 0xea, 0xda, 0x1b}}}, -{{{0xb6, 0xea, 0x0e, 0x40, 0x93, 0x20, 0x79, 0x35, 0x6a, 0x61, 0x84, 0x5a, 0x07, 0x6d, 0xf9, 0x77, 0x6f, 0xed, 0x69, 0x1c, 0x0d, 0x25, 0x76, 0xcc, 0xf0, 0xdb, 0xbb, 0xc5, 0xad, 0xe2, 0x26, 0x57}} , - {{0xcf, 0xe8, 0x0e, 0x6b, 0x96, 0x7d, 0xed, 0x27, 0xd1, 0x3c, 0xa9, 0xd9, 0x50, 0xa9, 0x98, 0x84, 0x5e, 0x86, 0xef, 0xd6, 0xf0, 0xf8, 0x0e, 0x89, 0x05, 0x2f, 0xd9, 0x5f, 0x15, 0x5f, 0x73, 0x79}}}, -{{{0xc8, 0x5c, 0x16, 0xfe, 0xed, 0x9f, 0x26, 0x56, 0xf6, 0x4b, 0x9f, 0xa7, 0x0a, 0x85, 0xfe, 0xa5, 0x8c, 0x87, 0xdd, 0x98, 0xce, 0x4e, 0xc3, 0x58, 0x55, 0xb2, 0x7b, 0x3d, 0xd8, 0x6b, 0xb5, 0x4c}} , - {{0x65, 0x38, 0xa0, 0x15, 0xfa, 0xa7, 0xb4, 0x8f, 0xeb, 0xc4, 0x86, 0x9b, 0x30, 0xa5, 0x5e, 0x4d, 0xea, 0x8a, 0x9a, 0x9f, 0x1a, 0xd8, 0x5b, 0x53, 0x14, 0x19, 0x25, 0x63, 0xb4, 0x6f, 0x1f, 0x5d}}}, -{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, - {{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, -{{{0xac, 0x8f, 0xbc, 0x1e, 0x7d, 0x8b, 0x5a, 0x0b, 0x8d, 0xaf, 0x76, 0x2e, 0x71, 0xe3, 0x3b, 0x6f, 0x53, 0x2f, 0x3e, 0x90, 0x95, 0xd4, 0x35, 0x14, 0x4f, 0x8c, 0x3c, 0xce, 0x57, 0x1c, 0x76, 0x49}} , - {{0xa8, 0x50, 0xe1, 0x61, 0x6b, 0x57, 0x35, 0xeb, 0x44, 0x0b, 0x0c, 0x6e, 0xf9, 0x25, 0x80, 0x74, 0xf2, 0x8f, 0x6f, 0x7a, 0x3e, 0x7f, 0x2d, 0xf3, 0x4e, 0x09, 0x65, 0x10, 0x5e, 0x03, 0x25, 0x32}}}, -{{{0xa9, 0x60, 0xdc, 0x0f, 0x64, 0xe5, 0x1d, 0xe2, 0x8d, 0x4f, 0x79, 0x2f, 0x0e, 0x24, 0x02, 0x00, 0x05, 0x77, 0x43, 0x25, 0x3d, 0x6a, 0xc7, 0xb7, 0xbf, 0x04, 0x08, 0x65, 0xf4, 0x39, 0x4b, 0x65}} , - {{0x96, 0x19, 0x12, 0x6b, 0x6a, 0xb7, 0xe3, 0xdc, 0x45, 0x9b, 0xdb, 0xb4, 0xa8, 0xae, 0xdc, 0xa8, 0x14, 0x44, 0x65, 0x62, 0xce, 0x34, 0x9a, 0x84, 0x18, 0x12, 0x01, 0xf1, 0xe2, 0x7b, 0xce, 0x50}}}, -{{{0x41, 0x21, 0x30, 0x53, 0x1b, 0x47, 0x01, 0xb7, 0x18, 0xd8, 0x82, 0x57, 0xbd, 0xa3, 0x60, 0xf0, 0x32, 0xf6, 0x5b, 0xf0, 0x30, 0x88, 0x91, 0x59, 0xfd, 0x90, 0xa2, 0xb9, 0x55, 0x93, 0x21, 0x34}} , - {{0x97, 0x67, 0x9e, 0xeb, 0x6a, 0xf9, 0x6e, 0xd6, 0x73, 0xe8, 0x6b, 0x29, 0xec, 0x63, 0x82, 0x00, 0xa8, 0x99, 0x1c, 0x1d, 0x30, 0xc8, 0x90, 0x52, 0x90, 0xb6, 0x6a, 0x80, 0x4e, 0xff, 0x4b, 0x51}}}, -{{{0x0f, 0x7d, 0x63, 0x8c, 0x6e, 0x5c, 0xde, 0x30, 0xdf, 0x65, 0xfa, 0x2e, 0xb0, 0xa3, 0x25, 0x05, 0x54, 0xbd, 0x25, 0xba, 0x06, 0xae, 0xdf, 0x8b, 0xd9, 0x1b, 0xea, 0x38, 0xb3, 0x05, 0x16, 0x09}} , - {{0xc7, 0x8c, 0xbf, 0x64, 0x28, 0xad, 0xf8, 0xa5, 0x5a, 0x6f, 0xc9, 0xba, 0xd5, 0x7f, 0xd5, 0xd6, 0xbd, 0x66, 0x2f, 0x3d, 0xaa, 0x54, 0xf6, 0xba, 0x32, 0x22, 0x9a, 0x1e, 0x52, 0x05, 0xf4, 0x1d}}}, -{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, - {{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, -{{{0xaa, 0x1f, 0xbb, 0xeb, 0xfe, 0xe4, 0x87, 0xfc, 0xb1, 0x2c, 0xb7, 0x88, 0xf4, 0xc6, 0xb9, 0xf5, 0x24, 0x46, 0xf2, 0xa5, 0x9f, 0x8f, 0x8a, 0x93, 0x70, 0x69, 0xd4, 0x56, 0xec, 0xfd, 0x06, 0x46}} , - {{0x4e, 0x66, 0xcf, 0x4e, 0x34, 0xce, 0x0c, 0xd9, 0xa6, 0x50, 0xd6, 0x5e, 0x95, 0xaf, 0xe9, 0x58, 0xfa, 0xee, 0x9b, 0xb8, 0xa5, 0x0f, 0x35, 0xe0, 0x43, 0x82, 0x6d, 0x65, 0xe6, 0xd9, 0x00, 0x0f}}}, -{{{0x7b, 0x75, 0x3a, 0xfc, 0x64, 0xd3, 0x29, 0x7e, 0xdd, 0x49, 0x9a, 0x59, 0x53, 0xbf, 0xb4, 0xa7, 0x52, 0xb3, 0x05, 0xab, 0xc3, 0xaf, 0x16, 0x1a, 0x85, 0x42, 0x32, 0xa2, 0x86, 0xfa, 0x39, 0x43}} , - {{0x0e, 0x4b, 0xa3, 0x63, 0x8a, 0xfe, 0xa5, 0x58, 0xf1, 0x13, 0xbd, 0x9d, 0xaa, 0x7f, 0x76, 0x40, 0x70, 0x81, 0x10, 0x75, 0x99, 0xbb, 0xbe, 0x0b, 0x16, 0xe9, 0xba, 0x62, 0x34, 0xcc, 0x07, 0x6d}}}, -{{{0xc3, 0xf1, 0xc6, 0x93, 0x65, 0xee, 0x0b, 0xbc, 0xea, 0x14, 0xf0, 0xc1, 0xf8, 0x84, 0x89, 0xc2, 0xc9, 0xd7, 0xea, 0x34, 0xca, 0xa7, 0xc4, 0x99, 0xd5, 0x50, 0x69, 0xcb, 0xd6, 0x21, 0x63, 0x7c}} , - {{0x99, 0xeb, 0x7c, 0x31, 0x73, 0x64, 0x67, 0x7f, 0x0c, 0x66, 0xaa, 0x8c, 0x69, 0x91, 0xe2, 0x26, 0xd3, 0x23, 0xe2, 0x76, 0x5d, 0x32, 0x52, 0xdf, 0x5d, 0xc5, 0x8f, 0xb7, 0x7c, 0x84, 0xb3, 0x70}}}, -{{{0xeb, 0x01, 0xc7, 0x36, 0x97, 0x4e, 0xb6, 0xab, 0x5f, 0x0d, 0x2c, 0xba, 0x67, 0x64, 0x55, 0xde, 0xbc, 0xff, 0xa6, 0xec, 0x04, 0xd3, 0x8d, 0x39, 0x56, 0x5e, 0xee, 0xf8, 0xe4, 0x2e, 0x33, 0x62}} , - {{0x65, 0xef, 0xb8, 0x9f, 0xc8, 0x4b, 0xa7, 0xfd, 0x21, 0x49, 0x9b, 0x92, 0x35, 0x82, 0xd6, 0x0a, 0x9b, 0xf2, 0x79, 0xf1, 0x47, 0x2f, 0x6a, 0x7e, 0x9f, 0xcf, 0x18, 0x02, 0x3c, 0xfb, 0x1b, 0x3e}}}, -{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, - {{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, -{{{0x2f, 0x8b, 0xc8, 0x40, 0x51, 0xd1, 0xac, 0x1a, 0x0b, 0xe4, 0xa9, 0xa2, 0x42, 0x21, 0x19, 0x2f, 0x7b, 0x97, 0xbf, 0xf7, 0x57, 0x6d, 0x3f, 0x3d, 0x4f, 0x0f, 0xe2, 0xb2, 0x81, 0x00, 0x9e, 0x7b}} , - {{0x8c, 0x85, 0x2b, 0xc4, 0xfc, 0xf1, 0xab, 0xe8, 0x79, 0x22, 0xc4, 0x84, 0x17, 0x3a, 0xfa, 0x86, 0xa6, 0x7d, 0xf9, 0xf3, 0x6f, 0x03, 0x57, 0x20, 0x4d, 0x79, 0xf9, 0x6e, 0x71, 0x54, 0x38, 0x09}}}, -{{{0x40, 0x29, 0x74, 0xa8, 0x2f, 0x5e, 0xf9, 0x79, 0xa4, 0xf3, 0x3e, 0xb9, 0xfd, 0x33, 0x31, 0xac, 0x9a, 0x69, 0x88, 0x1e, 0x77, 0x21, 0x2d, 0xf3, 0x91, 0x52, 0x26, 0x15, 0xb2, 0xa6, 0xcf, 0x7e}} , - {{0xc6, 0x20, 0x47, 0x6c, 0xa4, 0x7d, 0xcb, 0x63, 0xea, 0x5b, 0x03, 0xdf, 0x3e, 0x88, 0x81, 0x6d, 0xce, 0x07, 0x42, 0x18, 0x60, 0x7e, 0x7b, 0x55, 0xfe, 0x6a, 0xf3, 0xda, 0x5c, 0x8b, 0x95, 0x10}}}, -{{{0x62, 0xe4, 0x0d, 0x03, 0xb4, 0xd7, 0xcd, 0xfa, 0xbd, 0x46, 0xdf, 0x93, 0x71, 0x10, 0x2c, 0xa8, 0x3b, 0xb6, 0x09, 0x05, 0x70, 0x84, 0x43, 0x29, 0xa8, 0x59, 0xf5, 0x8e, 0x10, 0xe4, 0xd7, 0x20}} , - {{0x57, 0x82, 0x1c, 0xab, 0xbf, 0x62, 0x70, 0xe8, 0xc4, 0xcf, 0xf0, 0x28, 0x6e, 0x16, 0x3c, 0x08, 0x78, 0x89, 0x85, 0x46, 0x0f, 0xf6, 0x7f, 0xcf, 0xcb, 0x7e, 0xb8, 0x25, 0xe9, 0x5a, 0xfa, 0x03}}}, -{{{0xfb, 0x95, 0x92, 0x63, 0x50, 0xfc, 0x62, 0xf0, 0xa4, 0x5e, 0x8c, 0x18, 0xc2, 0x17, 0x24, 0xb7, 0x78, 0xc2, 0xa9, 0xe7, 0x6a, 0x32, 0xd6, 0x29, 0x85, 0xaf, 0xcb, 0x8d, 0x91, 0x13, 0xda, 0x6b}} , - {{0x36, 0x0a, 0xc2, 0xb6, 0x4b, 0xa5, 0x5d, 0x07, 0x17, 0x41, 0x31, 0x5f, 0x62, 0x46, 0xf8, 0x92, 0xf9, 0x66, 0x48, 0x73, 0xa6, 0x97, 0x0d, 0x7d, 0x88, 0xee, 0x62, 0xb1, 0x03, 0xa8, 0x3f, 0x2c}}}, -{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, - {{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, -{{{0x4a, 0xb1, 0x70, 0x8a, 0xa9, 0xe8, 0x63, 0x79, 0x00, 0xe2, 0x25, 0x16, 0xca, 0x4b, 0x0f, 0xa4, 0x66, 0xad, 0x19, 0x9f, 0x88, 0x67, 0x0c, 0x8b, 0xc2, 0x4a, 0x5b, 0x2b, 0x6d, 0x95, 0xaf, 0x19}} , - {{0x8b, 0x9d, 0xb6, 0xcc, 0x60, 0xb4, 0x72, 0x4f, 0x17, 0x69, 0x5a, 0x4a, 0x68, 0x34, 0xab, 0xa1, 0x45, 0x32, 0x3c, 0x83, 0x87, 0x72, 0x30, 0x54, 0x77, 0x68, 0xae, 0xfb, 0xb5, 0x8b, 0x22, 0x5e}}}, -{{{0xf1, 0xb9, 0x87, 0x35, 0xc5, 0xbb, 0xb9, 0xcf, 0xf5, 0xd6, 0xcd, 0xd5, 0x0c, 0x7c, 0x0e, 0xe6, 0x90, 0x34, 0xfb, 0x51, 0x42, 0x1e, 0x6d, 0xac, 0x9a, 0x46, 0xc4, 0x97, 0x29, 0x32, 0xbf, 0x45}} , - {{0x66, 0x9e, 0xc6, 0x24, 0xc0, 0xed, 0xa5, 0x5d, 0x88, 0xd4, 0xf0, 0x73, 0x97, 0x7b, 0xea, 0x7f, 0x42, 0xff, 0x21, 0xa0, 0x9b, 0x2f, 0x9a, 0xfd, 0x53, 0x57, 0x07, 0x84, 0x48, 0x88, 0x9d, 0x52}}}, -{{{0xc6, 0x96, 0x48, 0x34, 0x2a, 0x06, 0xaf, 0x94, 0x3d, 0xf4, 0x1a, 0xcf, 0xf2, 0xc0, 0x21, 0xc2, 0x42, 0x5e, 0xc8, 0x2f, 0x35, 0xa2, 0x3e, 0x29, 0xfa, 0x0c, 0x84, 0xe5, 0x89, 0x72, 0x7c, 0x06}} , - {{0x32, 0x65, 0x03, 0xe5, 0x89, 0xa6, 0x6e, 0xb3, 0x5b, 0x8e, 0xca, 0xeb, 0xfe, 0x22, 0x56, 0x8b, 0x5d, 0x14, 0x4b, 0x4d, 0xf9, 0xbe, 0xb5, 0xf5, 0xe6, 0x5c, 0x7b, 0x8b, 0xf4, 0x13, 0x11, 0x34}}}, -{{{0x07, 0xc6, 0x22, 0x15, 0xe2, 0x9c, 0x60, 0xa2, 0x19, 0xd9, 0x27, 0xae, 0x37, 0x4e, 0xa6, 0xc9, 0x80, 0xa6, 0x91, 0x8f, 0x12, 0x49, 0xe5, 0x00, 0x18, 0x47, 0xd1, 0xd7, 0x28, 0x22, 0x63, 0x39}} , - {{0xe8, 0xe2, 0x00, 0x7e, 0xf2, 0x9e, 0x1e, 0x99, 0x39, 0x95, 0x04, 0xbd, 0x1e, 0x67, 0x7b, 0xb2, 0x26, 0xac, 0xe6, 0xaa, 0xe2, 0x46, 0xd5, 0xe4, 0xe8, 0x86, 0xbd, 0xab, 0x7c, 0x55, 0x59, 0x6f}}}, -{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, - {{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, -{{{0x24, 0x64, 0x6e, 0x9b, 0x35, 0x71, 0x78, 0xce, 0x33, 0x03, 0x21, 0x33, 0x36, 0xf1, 0x73, 0x9b, 0xb9, 0x15, 0x8b, 0x2c, 0x69, 0xcf, 0x4d, 0xed, 0x4f, 0x4d, 0x57, 0x14, 0x13, 0x82, 0xa4, 0x4d}} , - {{0x65, 0x6e, 0x0a, 0xa4, 0x59, 0x07, 0x17, 0xf2, 0x6b, 0x4a, 0x1f, 0x6e, 0xf6, 0xb5, 0xbc, 0x62, 0xe4, 0xb6, 0xda, 0xa2, 0x93, 0xbc, 0x29, 0x05, 0xd2, 0xd2, 0x73, 0x46, 0x03, 0x16, 0x40, 0x31}}}, -{{{0x4c, 0x73, 0x6d, 0x15, 0xbd, 0xa1, 0x4d, 0x5c, 0x13, 0x0b, 0x24, 0x06, 0x98, 0x78, 0x1c, 0x5b, 0xeb, 0x1f, 0x18, 0x54, 0x43, 0xd9, 0x55, 0x66, 0xda, 0x29, 0x21, 0xe8, 0xb8, 0x3c, 0x42, 0x22}} , - {{0xb4, 0xcd, 0x08, 0x6f, 0x15, 0x23, 0x1a, 0x0b, 0x22, 0xed, 0xd1, 0xf1, 0xa7, 0xc7, 0x73, 0x45, 0xf3, 0x9e, 0xce, 0x76, 0xb7, 0xf6, 0x39, 0xb6, 0x8e, 0x79, 0xbe, 0xe9, 0x9b, 0xcf, 0x7d, 0x62}}}, -{{{0x92, 0x5b, 0xfc, 0x72, 0xfd, 0xba, 0xf1, 0xfd, 0xa6, 0x7c, 0x95, 0xe3, 0x61, 0x3f, 0xe9, 0x03, 0xd4, 0x2b, 0xd4, 0x20, 0xd9, 0xdb, 0x4d, 0x32, 0x3e, 0xf5, 0x11, 0x64, 0xe3, 0xb4, 0xbe, 0x32}} , - {{0x86, 0x17, 0x90, 0xe7, 0xc9, 0x1f, 0x10, 0xa5, 0x6a, 0x2d, 0x39, 0xd0, 0x3b, 0xc4, 0xa6, 0xe9, 0x59, 0x13, 0xda, 0x1a, 0xe6, 0xa0, 0xb9, 0x3c, 0x50, 0xb8, 0x40, 0x7c, 0x15, 0x36, 0x5a, 0x42}}}, -{{{0xb4, 0x0b, 0x32, 0xab, 0xdc, 0x04, 0x51, 0x55, 0x21, 0x1e, 0x0b, 0x75, 0x99, 0x89, 0x73, 0x35, 0x3a, 0x91, 0x2b, 0xfe, 0xe7, 0x49, 0xea, 0x76, 0xc1, 0xf9, 0x46, 0xb9, 0x53, 0x02, 0x23, 0x04}} , - {{0xfc, 0x5a, 0x1e, 0x1d, 0x74, 0x58, 0x95, 0xa6, 0x8f, 0x7b, 0x97, 0x3e, 0x17, 0x3b, 0x79, 0x2d, 0xa6, 0x57, 0xef, 0x45, 0x02, 0x0b, 0x4d, 0x6e, 0x9e, 0x93, 0x8d, 0x2f, 0xd9, 0x9d, 0xdb, 0x04}}}, -{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, - {{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, -{{{0xc0, 0xd7, 0x56, 0x97, 0x58, 0x91, 0xde, 0x09, 0x4f, 0x9f, 0xbe, 0x63, 0xb0, 0x83, 0x86, 0x43, 0x5d, 0xbc, 0xe0, 0xf3, 0xc0, 0x75, 0xbf, 0x8b, 0x8e, 0xaa, 0xf7, 0x8b, 0x64, 0x6e, 0xb0, 0x63}} , - {{0x16, 0xae, 0x8b, 0xe0, 0x9b, 0x24, 0x68, 0x5c, 0x44, 0xc2, 0xd0, 0x08, 0xb7, 0x7b, 0x62, 0xfd, 0x7f, 0xd8, 0xd4, 0xb7, 0x50, 0xfd, 0x2c, 0x1b, 0xbf, 0x41, 0x95, 0xd9, 0x8e, 0xd8, 0x17, 0x1b}}}, -{{{0x86, 0x55, 0x37, 0x8e, 0xc3, 0x38, 0x48, 0x14, 0xb5, 0x97, 0xd2, 0xa7, 0x54, 0x45, 0xf1, 0x35, 0x44, 0x38, 0x9e, 0xf1, 0x1b, 0xb6, 0x34, 0x00, 0x3c, 0x96, 0xee, 0x29, 0x00, 0xea, 0x2c, 0x0b}} , - {{0xea, 0xda, 0x99, 0x9e, 0x19, 0x83, 0x66, 0x6d, 0xe9, 0x76, 0x87, 0x50, 0xd1, 0xfd, 0x3c, 0x60, 0x87, 0xc6, 0x41, 0xd9, 0x8e, 0xdb, 0x5e, 0xde, 0xaa, 0x9a, 0xd3, 0x28, 0xda, 0x95, 0xea, 0x47}}}, -{{{0xd0, 0x80, 0xba, 0x19, 0xae, 0x1d, 0xa9, 0x79, 0xf6, 0x3f, 0xac, 0x5d, 0x6f, 0x96, 0x1f, 0x2a, 0xce, 0x29, 0xb2, 0xff, 0x37, 0xf1, 0x94, 0x8f, 0x0c, 0xb5, 0x28, 0xba, 0x9a, 0x21, 0xf6, 0x66}} , - {{0x02, 0xfb, 0x54, 0xb8, 0x05, 0xf3, 0x81, 0x52, 0x69, 0x34, 0x46, 0x9d, 0x86, 0x76, 0x8f, 0xd7, 0xf8, 0x6a, 0x66, 0xff, 0xe6, 0xa7, 0x90, 0xf7, 0x5e, 0xcd, 0x6a, 0x9b, 0x55, 0xfc, 0x9d, 0x48}}}, -{{{0xbd, 0xaa, 0x13, 0xe6, 0xcd, 0x45, 0x4a, 0xa4, 0x59, 0x0a, 0x64, 0xb1, 0x98, 0xd6, 0x34, 0x13, 0x04, 0xe6, 0x97, 0x94, 0x06, 0xcb, 0xd4, 0x4e, 0xbb, 0x96, 0xcd, 0xd1, 0x57, 0xd1, 0xe3, 0x06}} , - {{0x7a, 0x6c, 0x45, 0x27, 0xc4, 0x93, 0x7f, 0x7d, 0x7c, 0x62, 0x50, 0x38, 0x3a, 0x6b, 0xb5, 0x88, 0xc6, 0xd9, 0xf1, 0x78, 0x19, 0xb9, 0x39, 0x93, 0x3d, 0xc9, 0xe0, 0x9c, 0x3c, 0xce, 0xf5, 0x72}}}, -{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, - {{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, -{{{0x24, 0xea, 0x23, 0x7d, 0x56, 0x2c, 0xe2, 0x59, 0x0e, 0x85, 0x60, 0x04, 0x88, 0x5a, 0x74, 0x1e, 0x4b, 0xef, 0x13, 0xda, 0x4c, 0xff, 0x83, 0x45, 0x85, 0x3f, 0x08, 0x95, 0x2c, 0x20, 0x13, 0x1f}} , - {{0x48, 0x5f, 0x27, 0x90, 0x5c, 0x02, 0x42, 0xad, 0x78, 0x47, 0x5c, 0xb5, 0x7e, 0x08, 0x85, 0x00, 0xfa, 0x7f, 0xfd, 0xfd, 0xe7, 0x09, 0x11, 0xf2, 0x7e, 0x1b, 0x38, 0x6c, 0x35, 0x6d, 0x33, 0x66}}}, -{{{0x93, 0x03, 0x36, 0x81, 0xac, 0xe4, 0x20, 0x09, 0x35, 0x4c, 0x45, 0xb2, 0x1e, 0x4c, 0x14, 0x21, 0xe6, 0xe9, 0x8a, 0x7b, 0x8d, 0xfe, 0x1e, 0xc6, 0x3e, 0xc1, 0x35, 0xfa, 0xe7, 0x70, 0x4e, 0x1d}} , - {{0x61, 0x2e, 0xc2, 0xdd, 0x95, 0x57, 0xd1, 0xab, 0x80, 0xe8, 0x63, 0x17, 0xb5, 0x48, 0xe4, 0x8a, 0x11, 0x9e, 0x72, 0xbe, 0x85, 0x8d, 0x51, 0x0a, 0xf2, 0x9f, 0xe0, 0x1c, 0xa9, 0x07, 0x28, 0x7b}}}, -{{{0xbb, 0x71, 0x14, 0x5e, 0x26, 0x8c, 0x3d, 0xc8, 0xe9, 0x7c, 0xd3, 0xd6, 0xd1, 0x2f, 0x07, 0x6d, 0xe6, 0xdf, 0xfb, 0x79, 0xd6, 0x99, 0x59, 0x96, 0x48, 0x40, 0x0f, 0x3a, 0x7b, 0xb2, 0xa0, 0x72}} , - {{0x4e, 0x3b, 0x69, 0xc8, 0x43, 0x75, 0x51, 0x6c, 0x79, 0x56, 0xe4, 0xcb, 0xf7, 0xa6, 0x51, 0xc2, 0x2c, 0x42, 0x0b, 0xd4, 0x82, 0x20, 0x1c, 0x01, 0x08, 0x66, 0xd7, 0xbf, 0x04, 0x56, 0xfc, 0x02}}}, -{{{0x24, 0xe8, 0xb7, 0x60, 0xae, 0x47, 0x80, 0xfc, 0xe5, 0x23, 0xe7, 0xc2, 0xc9, 0x85, 0xe6, 0x98, 0xa0, 0x29, 0x4e, 0xe1, 0x84, 0x39, 0x2d, 0x95, 0x2c, 0xf3, 0x45, 0x3c, 0xff, 0xaf, 0x27, 0x4c}} , - {{0x6b, 0xa6, 0xf5, 0x4b, 0x11, 0xbd, 0xba, 0x5b, 0x9e, 0xc4, 0xa4, 0x51, 0x1e, 0xbe, 0xd0, 0x90, 0x3a, 0x9c, 0xc2, 0x26, 0xb6, 0x1e, 0xf1, 0x95, 0x7d, 0xc8, 0x6d, 0x52, 0xe6, 0x99, 0x2c, 0x5f}}}, -{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, - {{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, -{{{0x85, 0xe0, 0x24, 0x32, 0xb4, 0xd1, 0xef, 0xfc, 0x69, 0xa2, 0xbf, 0x8f, 0x72, 0x2c, 0x95, 0xf6, 0xe4, 0x6e, 0x7d, 0x90, 0xf7, 0x57, 0x81, 0xa0, 0xf7, 0xda, 0xef, 0x33, 0x07, 0xe3, 0x6b, 0x78}} , - {{0x36, 0x27, 0x3e, 0xc6, 0x12, 0x07, 0xab, 0x4e, 0xbe, 0x69, 0x9d, 0xb3, 0xbe, 0x08, 0x7c, 0x2a, 0x47, 0x08, 0xfd, 0xd4, 0xcd, 0x0e, 0x27, 0x34, 0x5b, 0x98, 0x34, 0x2f, 0x77, 0x5f, 0x3a, 0x65}}}, -{{{0x13, 0xaa, 0x2e, 0x4c, 0xf0, 0x22, 0xb8, 0x6c, 0xb3, 0x19, 0x4d, 0xeb, 0x6b, 0xd0, 0xa4, 0xc6, 0x9c, 0xdd, 0xc8, 0x5b, 0x81, 0x57, 0x89, 0xdf, 0x33, 0xa9, 0x68, 0x49, 0x80, 0xe4, 0xfe, 0x21}} , - {{0x00, 0x17, 0x90, 0x30, 0xe9, 0xd3, 0x60, 0x30, 0x31, 0xc2, 0x72, 0x89, 0x7a, 0x36, 0xa5, 0xbd, 0x39, 0x83, 0x85, 0x50, 0xa1, 0x5d, 0x6c, 0x41, 0x1d, 0xb5, 0x2c, 0x07, 0x40, 0x77, 0x0b, 0x50}}}, -{{{0x64, 0x34, 0xec, 0xc0, 0x9e, 0x44, 0x41, 0xaf, 0xa0, 0x36, 0x05, 0x6d, 0xea, 0x30, 0x25, 0x46, 0x35, 0x24, 0x9d, 0x86, 0xbd, 0x95, 0xf1, 0x6a, 0x46, 0xd7, 0x94, 0x54, 0xf9, 0x3b, 0xbd, 0x5d}} , - {{0x77, 0x5b, 0xe2, 0x37, 0xc7, 0xe1, 0x7c, 0x13, 0x8c, 0x9f, 0x7b, 0x7b, 0x2a, 0xce, 0x42, 0xa3, 0xb9, 0x2a, 0x99, 0xa8, 0xc0, 0xd8, 0x3c, 0x86, 0xb0, 0xfb, 0xe9, 0x76, 0x77, 0xf7, 0xf5, 0x56}}}, -{{{0xdf, 0xb3, 0x46, 0x11, 0x6e, 0x13, 0xb7, 0x28, 0x4e, 0x56, 0xdd, 0xf1, 0xac, 0xad, 0x58, 0xc3, 0xf8, 0x88, 0x94, 0x5e, 0x06, 0x98, 0xa1, 0xe4, 0x6a, 0xfb, 0x0a, 0x49, 0x5d, 0x8a, 0xfe, 0x77}} , - {{0x46, 0x02, 0xf5, 0xa5, 0xaf, 0xc5, 0x75, 0x6d, 0xba, 0x45, 0x35, 0x0a, 0xfe, 0xc9, 0xac, 0x22, 0x91, 0x8d, 0x21, 0x95, 0x33, 0x03, 0xc0, 0x8a, 0x16, 0xf3, 0x39, 0xe0, 0x01, 0x0f, 0x53, 0x3c}}}, -{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, - {{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, -{{{0x34, 0x75, 0x37, 0x1f, 0x34, 0x4e, 0xa9, 0x1d, 0x68, 0x67, 0xf8, 0x49, 0x98, 0x96, 0xfc, 0x4c, 0x65, 0x97, 0xf7, 0x02, 0x4a, 0x52, 0x6c, 0x01, 0xbd, 0x48, 0xbb, 0x1b, 0xed, 0xa4, 0xe2, 0x53}} , - {{0x59, 0xd5, 0x9b, 0x5a, 0xa2, 0x90, 0xd3, 0xb8, 0x37, 0x4c, 0x55, 0x82, 0x28, 0x08, 0x0f, 0x7f, 0xaa, 0x81, 0x65, 0xe0, 0x0c, 0x52, 0xc9, 0xa3, 0x32, 0x27, 0x64, 0xda, 0xfd, 0x34, 0x23, 0x5a}}}, -{{{0xb5, 0xb0, 0x0c, 0x4d, 0xb3, 0x7b, 0x23, 0xc8, 0x1f, 0x8a, 0x39, 0x66, 0xe6, 0xba, 0x4c, 0x10, 0x37, 0xca, 0x9c, 0x7c, 0x05, 0x9e, 0xff, 0xc0, 0xf8, 0x8e, 0xb1, 0x8f, 0x6f, 0x67, 0x18, 0x26}} , - {{0x4b, 0x41, 0x13, 0x54, 0x23, 0x1a, 0xa4, 0x4e, 0xa9, 0x8b, 0x1e, 0x4b, 0xfc, 0x15, 0x24, 0xbb, 0x7e, 0xcb, 0xb6, 0x1e, 0x1b, 0xf5, 0xf2, 0xc8, 0x56, 0xec, 0x32, 0xa2, 0x60, 0x5b, 0xa0, 0x2a}}}, -{{{0xa4, 0x29, 0x47, 0x86, 0x2e, 0x92, 0x4f, 0x11, 0x4f, 0xf3, 0xb2, 0x5c, 0xd5, 0x3e, 0xa6, 0xb9, 0xc8, 0xe2, 0x33, 0x11, 0x1f, 0x01, 0x8f, 0xb0, 0x9b, 0xc7, 0xa5, 0xff, 0x83, 0x0f, 0x1e, 0x28}} , - {{0x1d, 0x29, 0x7a, 0xa1, 0xec, 0x8e, 0xb5, 0xad, 0xea, 0x02, 0x68, 0x60, 0x74, 0x29, 0x1c, 0xa5, 0xcf, 0xc8, 0x3b, 0x7d, 0x8b, 0x2b, 0x7c, 0xad, 0xa4, 0x40, 0x17, 0x51, 0x59, 0x7c, 0x2e, 0x5d}}}, -{{{0x0a, 0x6c, 0x4f, 0xbc, 0x3e, 0x32, 0xe7, 0x4a, 0x1a, 0x13, 0xc1, 0x49, 0x38, 0xbf, 0xf7, 0xc2, 0xd3, 0x8f, 0x6b, 0xad, 0x52, 0xf7, 0xcf, 0xbc, 0x27, 0xcb, 0x40, 0x67, 0x76, 0xcd, 0x6d, 0x56}} , - {{0xe5, 0xb0, 0x27, 0xad, 0xbe, 0x9b, 0xf2, 0xb5, 0x63, 0xde, 0x3a, 0x23, 0x95, 0xb7, 0x0a, 0x7e, 0xf3, 0x9e, 0x45, 0x6f, 0x19, 0x39, 0x75, 0x8f, 0x39, 0x3d, 0x0f, 0xc0, 0x9f, 0xf1, 0xe9, 0x51}}}, -{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, - {{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, -{{{0x88, 0xaa, 0x14, 0x24, 0x86, 0x94, 0x11, 0x12, 0x3e, 0x1a, 0xb5, 0xcc, 0xbb, 0xe0, 0x9c, 0xd5, 0x9c, 0x6d, 0xba, 0x58, 0x72, 0x8d, 0xfb, 0x22, 0x7b, 0x9f, 0x7c, 0x94, 0x30, 0xb3, 0x51, 0x21}} , - {{0xf6, 0x74, 0x3d, 0xf2, 0xaf, 0xd0, 0x1e, 0x03, 0x7c, 0x23, 0x6b, 0xc9, 0xfc, 0x25, 0x70, 0x90, 0xdc, 0x9a, 0xa4, 0xfb, 0x49, 0xfc, 0x3d, 0x0a, 0x35, 0x38, 0x6f, 0xe4, 0x7e, 0x50, 0x01, 0x2a}}}, -{{{0xd6, 0xe3, 0x96, 0x61, 0x3a, 0xfd, 0xef, 0x9b, 0x1f, 0x90, 0xa4, 0x24, 0x14, 0x5b, 0xc8, 0xde, 0x50, 0xb1, 0x1d, 0xaf, 0xe8, 0x55, 0x8a, 0x87, 0x0d, 0xfe, 0xaa, 0x3b, 0x82, 0x2c, 0x8d, 0x7b}} , - {{0x85, 0x0c, 0xaf, 0xf8, 0x83, 0x44, 0x49, 0xd9, 0x45, 0xcf, 0xf7, 0x48, 0xd9, 0x53, 0xb4, 0xf1, 0x65, 0xa0, 0xe1, 0xc3, 0xb3, 0x15, 0xed, 0x89, 0x9b, 0x4f, 0x62, 0xb3, 0x57, 0xa5, 0x45, 0x1c}}}, -{{{0x8f, 0x12, 0xea, 0xaf, 0xd1, 0x1f, 0x79, 0x10, 0x0b, 0xf6, 0xa3, 0x7b, 0xea, 0xac, 0x8b, 0x57, 0x32, 0x62, 0xe7, 0x06, 0x12, 0x51, 0xa0, 0x3b, 0x43, 0x5e, 0xa4, 0x20, 0x78, 0x31, 0xce, 0x0d}} , - {{0x84, 0x7c, 0xc2, 0xa6, 0x91, 0x23, 0xce, 0xbd, 0xdc, 0xf9, 0xce, 0xd5, 0x75, 0x30, 0x22, 0xe6, 0xf9, 0x43, 0x62, 0x0d, 0xf7, 0x75, 0x9d, 0x7f, 0x8c, 0xff, 0x7d, 0xe4, 0x72, 0xac, 0x9f, 0x1c}}}, -{{{0x88, 0xc1, 0x99, 0xd0, 0x3c, 0x1c, 0x5d, 0xb4, 0xef, 0x13, 0x0f, 0x90, 0xb9, 0x36, 0x2f, 0x95, 0x95, 0xc6, 0xdc, 0xde, 0x0a, 0x51, 0xe2, 0x8d, 0xf3, 0xbc, 0x51, 0xec, 0xdf, 0xb1, 0xa2, 0x5f}} , - {{0x2e, 0x68, 0xa1, 0x23, 0x7d, 0x9b, 0x40, 0x69, 0x85, 0x7b, 0x42, 0xbf, 0x90, 0x4b, 0xd6, 0x40, 0x2f, 0xd7, 0x52, 0x52, 0xb2, 0x21, 0xde, 0x64, 0xbd, 0x88, 0xc3, 0x6d, 0xa5, 0xfa, 0x81, 0x3f}}}, -{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, - {{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, -{{{0xfb, 0xfd, 0x47, 0x7b, 0x8a, 0x66, 0x9e, 0x79, 0x2e, 0x64, 0x82, 0xef, 0xf7, 0x21, 0xec, 0xf6, 0xd8, 0x86, 0x09, 0x31, 0x7c, 0xdd, 0x03, 0x6a, 0x58, 0xa0, 0x77, 0xb7, 0x9b, 0x8c, 0x87, 0x1f}} , - {{0x55, 0x47, 0xe4, 0xa8, 0x3d, 0x55, 0x21, 0x34, 0xab, 0x1d, 0xae, 0xe0, 0xf4, 0xea, 0xdb, 0xc5, 0xb9, 0x58, 0xbf, 0xc4, 0x2a, 0x89, 0x31, 0x1a, 0xf4, 0x2d, 0xe1, 0xca, 0x37, 0x99, 0x47, 0x59}}}, -{{{0xc7, 0xca, 0x63, 0xc1, 0x49, 0xa9, 0x35, 0x45, 0x55, 0x7e, 0xda, 0x64, 0x32, 0x07, 0x50, 0xf7, 0x32, 0xac, 0xde, 0x75, 0x58, 0x9b, 0x11, 0xb2, 0x3a, 0x1f, 0xf5, 0xf7, 0x79, 0x04, 0xe6, 0x08}} , - {{0x46, 0xfa, 0x22, 0x4b, 0xfa, 0xe1, 0xfe, 0x96, 0xfc, 0x67, 0xba, 0x67, 0x97, 0xc4, 0xe7, 0x1b, 0x86, 0x90, 0x5f, 0xee, 0xf4, 0x5b, 0x11, 0xb2, 0xcd, 0xad, 0xee, 0xc2, 0x48, 0x6c, 0x2b, 0x1b}}}, -{{{0xe3, 0x39, 0x62, 0xb4, 0x4f, 0x31, 0x04, 0xc9, 0xda, 0xd5, 0x73, 0x51, 0x57, 0xc5, 0xb8, 0xf3, 0xa3, 0x43, 0x70, 0xe4, 0x61, 0x81, 0x84, 0xe2, 0xbb, 0xbf, 0x4f, 0x9e, 0xa4, 0x5e, 0x74, 0x06}} , - {{0x29, 0xac, 0xff, 0x27, 0xe0, 0x59, 0xbe, 0x39, 0x9c, 0x0d, 0x83, 0xd7, 0x10, 0x0b, 0x15, 0xb7, 0xe1, 0xc2, 0x2c, 0x30, 0x73, 0x80, 0x3a, 0x7d, 0x5d, 0xab, 0x58, 0x6b, 0xc1, 0xf0, 0xf4, 0x22}}}, -{{{0xfe, 0x7f, 0xfb, 0x35, 0x7d, 0xc6, 0x01, 0x23, 0x28, 0xc4, 0x02, 0xac, 0x1f, 0x42, 0xb4, 0x9d, 0xfc, 0x00, 0x94, 0xa5, 0xee, 0xca, 0xda, 0x97, 0x09, 0x41, 0x77, 0x87, 0x5d, 0x7b, 0x87, 0x78}} , - {{0xf5, 0xfb, 0x90, 0x2d, 0x81, 0x19, 0x9e, 0x2f, 0x6d, 0x85, 0x88, 0x8c, 0x40, 0x5c, 0x77, 0x41, 0x4d, 0x01, 0x19, 0x76, 0x60, 0xe8, 0x4c, 0x48, 0xe4, 0x33, 0x83, 0x32, 0x6c, 0xb4, 0x41, 0x03}}}, -{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, - {{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, -{{{0xff, 0x10, 0xc2, 0x09, 0x4f, 0x6e, 0xf4, 0xd2, 0xdf, 0x7e, 0xca, 0x7b, 0x1c, 0x1d, 0xba, 0xa3, 0xb6, 0xda, 0x67, 0x33, 0xd4, 0x87, 0x36, 0x4b, 0x11, 0x20, 0x05, 0xa6, 0x29, 0xc1, 0x87, 0x17}} , - {{0xf6, 0x96, 0xca, 0x2f, 0xda, 0x38, 0xa7, 0x1b, 0xfc, 0xca, 0x7d, 0xfe, 0x08, 0x89, 0xe2, 0x47, 0x2b, 0x6a, 0x5d, 0x4b, 0xfa, 0xa1, 0xb4, 0xde, 0xb6, 0xc2, 0x31, 0x51, 0xf5, 0xe0, 0xa4, 0x0b}}}, -{{{0x5c, 0xe5, 0xc6, 0x04, 0x8e, 0x2b, 0x57, 0xbe, 0x38, 0x85, 0x23, 0xcb, 0xb7, 0xbe, 0x4f, 0xa9, 0xd3, 0x6e, 0x12, 0xaa, 0xd5, 0xb2, 0x2e, 0x93, 0x29, 0x9a, 0x4a, 0x88, 0x18, 0x43, 0xf5, 0x01}} , - {{0x50, 0xfc, 0xdb, 0xa2, 0x59, 0x21, 0x8d, 0xbd, 0x7e, 0x33, 0xae, 0x2f, 0x87, 0x1a, 0xd0, 0x97, 0xc7, 0x0d, 0x4d, 0x63, 0x01, 0xef, 0x05, 0x84, 0xec, 0x40, 0xdd, 0xa8, 0x0a, 0x4f, 0x70, 0x0b}}}, -{{{0x41, 0x69, 0x01, 0x67, 0x5c, 0xd3, 0x8a, 0xc5, 0xcf, 0x3f, 0xd1, 0x57, 0xd1, 0x67, 0x3e, 0x01, 0x39, 0xb5, 0xcb, 0x81, 0x56, 0x96, 0x26, 0xb6, 0xc2, 0xe7, 0x5c, 0xfb, 0x63, 0x97, 0x58, 0x06}} , - {{0x0c, 0x0e, 0xf3, 0xba, 0xf0, 0xe5, 0xba, 0xb2, 0x57, 0x77, 0xc6, 0x20, 0x9b, 0x89, 0x24, 0xbe, 0xf2, 0x9c, 0x8a, 0xba, 0x69, 0xc1, 0xf1, 0xb0, 0x4f, 0x2a, 0x05, 0x9a, 0xee, 0x10, 0x7e, 0x36}}}, -{{{0x3f, 0x26, 0xe9, 0x40, 0xe9, 0x03, 0xad, 0x06, 0x69, 0x91, 0xe0, 0xd1, 0x89, 0x60, 0x84, 0x79, 0xde, 0x27, 0x6d, 0xe6, 0x76, 0xbd, 0xea, 0xe6, 0xae, 0x48, 0xc3, 0x67, 0xc0, 0x57, 0xcd, 0x2f}} , - {{0x7f, 0xc1, 0xdc, 0xb9, 0xc7, 0xbc, 0x86, 0x3d, 0x55, 0x4b, 0x28, 0x7a, 0xfb, 0x4d, 0xc7, 0xf8, 0xbc, 0x67, 0x2a, 0x60, 0x4d, 0x8f, 0x07, 0x0b, 0x1a, 0x17, 0xbf, 0xfa, 0xac, 0xa7, 0x3d, 0x1a}}}, -{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, - {{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, -{{{0x91, 0x3f, 0xed, 0x5e, 0x18, 0x78, 0x3f, 0x23, 0x2c, 0x0d, 0x8c, 0x44, 0x00, 0xe8, 0xfb, 0xe9, 0x8e, 0xd6, 0xd1, 0x36, 0x58, 0x57, 0x9e, 0xae, 0x4b, 0x5c, 0x0b, 0x07, 0xbc, 0x6b, 0x55, 0x2b}} , - {{0x6f, 0x4d, 0x17, 0xd7, 0xe1, 0x84, 0xd9, 0x78, 0xb1, 0x90, 0xfd, 0x2e, 0xb3, 0xb5, 0x19, 0x3f, 0x1b, 0xfa, 0xc0, 0x68, 0xb3, 0xdd, 0x00, 0x2e, 0x89, 0xbd, 0x7e, 0x80, 0x32, 0x13, 0xa0, 0x7b}}}, -{{{0x1a, 0x6f, 0x40, 0xaf, 0x44, 0x44, 0xb0, 0x43, 0x8f, 0x0d, 0xd0, 0x1e, 0xc4, 0x0b, 0x19, 0x5d, 0x8e, 0xfe, 0xc1, 0xf3, 0xc5, 0x5c, 0x91, 0xf8, 0x04, 0x4e, 0xbe, 0x90, 0xb4, 0x47, 0x5c, 0x3f}} , - {{0xb0, 0x3b, 0x2c, 0xf3, 0xfe, 0x32, 0x71, 0x07, 0x3f, 0xaa, 0xba, 0x45, 0x60, 0xa8, 0x8d, 0xea, 0x54, 0xcb, 0x39, 0x10, 0xb4, 0xf2, 0x8b, 0xd2, 0x14, 0x82, 0x42, 0x07, 0x8e, 0xe9, 0x7c, 0x53}}}, -{{{0xb0, 0xae, 0xc1, 0x8d, 0xc9, 0x8f, 0xb9, 0x7a, 0x77, 0xef, 0xba, 0x79, 0xa0, 0x3c, 0xa8, 0xf5, 0x6a, 0xe2, 0x3f, 0x5d, 0x00, 0xe3, 0x4b, 0x45, 0x24, 0x7b, 0x43, 0x78, 0x55, 0x1d, 0x2b, 0x1e}} , - {{0x01, 0xb8, 0xd6, 0x16, 0x67, 0xa0, 0x15, 0xb9, 0xe1, 0x58, 0xa4, 0xa7, 0x31, 0x37, 0x77, 0x2f, 0x8b, 0x12, 0x9f, 0xf4, 0x3f, 0xc7, 0x36, 0x66, 0xd2, 0xa8, 0x56, 0xf7, 0x7f, 0x74, 0xc6, 0x41}}}, -{{{0x5d, 0xf8, 0xb4, 0xa8, 0x30, 0xdd, 0xcc, 0x38, 0xa5, 0xd3, 0xca, 0xd8, 0xd1, 0xf8, 0xb2, 0x31, 0x91, 0xd4, 0x72, 0x05, 0x57, 0x4a, 0x3b, 0x82, 0x4a, 0xc6, 0x68, 0x20, 0xe2, 0x18, 0x41, 0x61}} , - {{0x19, 0xd4, 0x8d, 0x47, 0x29, 0x12, 0x65, 0xb0, 0x11, 0x78, 0x47, 0xb5, 0xcb, 0xa3, 0xa5, 0xfa, 0x05, 0x85, 0x54, 0xa9, 0x33, 0x97, 0x8d, 0x2b, 0xc2, 0xfe, 0x99, 0x35, 0x28, 0xe5, 0xeb, 0x63}}}, -{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, - {{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, -{{{0xb1, 0x3f, 0x3f, 0xef, 0xd8, 0xf4, 0xfc, 0xb3, 0xa0, 0x60, 0x50, 0x06, 0x2b, 0x29, 0x52, 0x70, 0x15, 0x0b, 0x24, 0x24, 0xf8, 0x5f, 0x79, 0x18, 0xcc, 0xff, 0x89, 0x99, 0x84, 0xa1, 0xae, 0x13}} , - {{0x44, 0x1f, 0xb8, 0xc2, 0x01, 0xc1, 0x30, 0x19, 0x55, 0x05, 0x60, 0x10, 0xa4, 0x6c, 0x2d, 0x67, 0x70, 0xe5, 0x25, 0x1b, 0xf2, 0xbf, 0xdd, 0xfb, 0x70, 0x2b, 0xa1, 0x8c, 0x9c, 0x94, 0x84, 0x08}}}, -{{{0xe7, 0xc4, 0x43, 0x4d, 0xc9, 0x2b, 0x69, 0x5d, 0x1d, 0x3c, 0xaf, 0xbb, 0x43, 0x38, 0x4e, 0x98, 0x3d, 0xed, 0x0d, 0x21, 0x03, 0xfd, 0xf0, 0x99, 0x47, 0x04, 0xb0, 0x98, 0x69, 0x55, 0x72, 0x0f}} , - {{0x5e, 0xdf, 0x15, 0x53, 0x3b, 0x86, 0x80, 0xb0, 0xf1, 0x70, 0x68, 0x8f, 0x66, 0x7c, 0x0e, 0x49, 0x1a, 0xd8, 0x6b, 0xfe, 0x4e, 0xef, 0xca, 0x47, 0xd4, 0x03, 0xc1, 0x37, 0x50, 0x9c, 0xc1, 0x16}}}, -{{{0xcd, 0x24, 0xc6, 0x3e, 0x0c, 0x82, 0x9b, 0x91, 0x2b, 0x61, 0x4a, 0xb2, 0x0f, 0x88, 0x55, 0x5f, 0x5a, 0x57, 0xff, 0xe5, 0x74, 0x0b, 0x13, 0x43, 0x00, 0xd8, 0x6b, 0xcf, 0xd2, 0x15, 0x03, 0x2c}} , - {{0xdc, 0xff, 0x15, 0x61, 0x2f, 0x4a, 0x2f, 0x62, 0xf2, 0x04, 0x2f, 0xb5, 0x0c, 0xb7, 0x1e, 0x3f, 0x74, 0x1a, 0x0f, 0xd7, 0xea, 0xcd, 0xd9, 0x7d, 0xf6, 0x12, 0x0e, 0x2f, 0xdb, 0x5a, 0x3b, 0x16}}}, -{{{0x1b, 0x37, 0x47, 0xe3, 0xf5, 0x9e, 0xea, 0x2c, 0x2a, 0xe7, 0x82, 0x36, 0xf4, 0x1f, 0x81, 0x47, 0x92, 0x4b, 0x69, 0x0e, 0x11, 0x8c, 0x5d, 0x53, 0x5b, 0x81, 0x27, 0x08, 0xbc, 0xa0, 0xae, 0x25}} , - {{0x69, 0x32, 0xa1, 0x05, 0x11, 0x42, 0x00, 0xd2, 0x59, 0xac, 0x4d, 0x62, 0x8b, 0x13, 0xe2, 0x50, 0x5d, 0xa0, 0x9d, 0x9b, 0xfd, 0xbb, 0x12, 0x41, 0x75, 0x41, 0x9e, 0xcc, 0xdc, 0xc7, 0xdc, 0x5d}}}, -{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, - {{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, -{{{0xd9, 0xe3, 0x38, 0x06, 0x46, 0x70, 0x82, 0x5e, 0x28, 0x49, 0x79, 0xff, 0x25, 0xd2, 0x4e, 0x29, 0x8d, 0x06, 0xb0, 0x23, 0xae, 0x9b, 0x66, 0xe4, 0x7d, 0xc0, 0x70, 0x91, 0xa3, 0xfc, 0xec, 0x4e}} , - {{0x62, 0x12, 0x37, 0x6a, 0x30, 0xf6, 0x1e, 0xfb, 0x14, 0x5c, 0x0d, 0x0e, 0xb7, 0x81, 0x6a, 0xe7, 0x08, 0x05, 0xac, 0xaa, 0x38, 0x46, 0xe2, 0x73, 0xea, 0x4b, 0x07, 0x81, 0x43, 0x7c, 0x9e, 0x5e}}}, -{{{0xfc, 0xf9, 0x21, 0x4f, 0x2e, 0x76, 0x9b, 0x1f, 0x28, 0x60, 0x77, 0x43, 0x32, 0x9d, 0xbe, 0x17, 0x30, 0x2a, 0xc6, 0x18, 0x92, 0x66, 0x62, 0x30, 0x98, 0x40, 0x11, 0xa6, 0x7f, 0x18, 0x84, 0x28}} , - {{0x3f, 0xab, 0xd3, 0xf4, 0x8a, 0x76, 0xa1, 0x3c, 0xca, 0x2d, 0x49, 0xc3, 0xea, 0x08, 0x0b, 0x85, 0x17, 0x2a, 0xc3, 0x6c, 0x08, 0xfd, 0x57, 0x9f, 0x3d, 0x5f, 0xdf, 0x67, 0x68, 0x42, 0x00, 0x32}}}, -{{{0x51, 0x60, 0x1b, 0x06, 0x4f, 0x8a, 0x21, 0xba, 0x38, 0xa8, 0xba, 0xd6, 0x40, 0xf6, 0xe9, 0x9b, 0x76, 0x4d, 0x56, 0x21, 0x5b, 0x0a, 0x9b, 0x2e, 0x4f, 0x3d, 0x81, 0x32, 0x08, 0x9f, 0x97, 0x5b}} , - {{0xe5, 0x44, 0xec, 0x06, 0x9d, 0x90, 0x79, 0x9f, 0xd3, 0xe0, 0x79, 0xaf, 0x8f, 0x10, 0xfd, 0xdd, 0x04, 0xae, 0x27, 0x97, 0x46, 0x33, 0x79, 0xea, 0xb8, 0x4e, 0xca, 0x5a, 0x59, 0x57, 0xe1, 0x0e}}}, -{{{0x1a, 0xda, 0xf3, 0xa5, 0x41, 0x43, 0x28, 0xfc, 0x7e, 0xe7, 0x71, 0xea, 0xc6, 0x3b, 0x59, 0xcc, 0x2e, 0xd3, 0x40, 0xec, 0xb3, 0x13, 0x6f, 0x44, 0xcd, 0x13, 0xb2, 0x37, 0xf2, 0x6e, 0xd9, 0x1c}} , - {{0xe3, 0xdb, 0x60, 0xcd, 0x5c, 0x4a, 0x18, 0x0f, 0xef, 0x73, 0x36, 0x71, 0x8c, 0xf6, 0x11, 0xb4, 0xd8, 0xce, 0x17, 0x5e, 0x4f, 0x26, 0x77, 0x97, 0x5f, 0xcb, 0xef, 0x91, 0xeb, 0x6a, 0x62, 0x7a}}}, -{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, - {{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, -{{{0x18, 0x4a, 0xa2, 0x97, 0x08, 0x81, 0x2d, 0x83, 0xc4, 0xcc, 0xf0, 0x83, 0x7e, 0xec, 0x0d, 0x95, 0x4c, 0x5b, 0xfb, 0xfa, 0x98, 0x80, 0x4a, 0x66, 0x56, 0x0c, 0x51, 0xb3, 0xf2, 0x04, 0x5d, 0x27}} , - {{0x3b, 0xb9, 0xb8, 0x06, 0x5a, 0x2e, 0xfe, 0xc3, 0x82, 0x37, 0x9c, 0xa3, 0x11, 0x1f, 0x9c, 0xa6, 0xda, 0x63, 0x48, 0x9b, 0xad, 0xde, 0x2d, 0xa6, 0xbc, 0x6e, 0x32, 0xda, 0x27, 0x65, 0xdd, 0x57}}}, -{{{0x84, 0x4f, 0x37, 0x31, 0x7d, 0x2e, 0xbc, 0xad, 0x87, 0x07, 0x2a, 0x6b, 0x37, 0xfc, 0x5f, 0xeb, 0x4e, 0x75, 0x35, 0xa6, 0xde, 0xab, 0x0a, 0x19, 0x3a, 0xb7, 0xb1, 0xef, 0x92, 0x6a, 0x3b, 0x3c}} , - {{0x3b, 0xb2, 0x94, 0x6d, 0x39, 0x60, 0xac, 0xee, 0xe7, 0x81, 0x1a, 0x3b, 0x76, 0x87, 0x5c, 0x05, 0x94, 0x2a, 0x45, 0xb9, 0x80, 0xe9, 0x22, 0xb1, 0x07, 0xcb, 0x40, 0x9e, 0x70, 0x49, 0x6d, 0x12}}}, -{{{0xfd, 0x18, 0x78, 0x84, 0xa8, 0x4c, 0x7d, 0x6e, 0x59, 0xa6, 0xe5, 0x74, 0xf1, 0x19, 0xa6, 0x84, 0x2e, 0x51, 0xc1, 0x29, 0x13, 0xf2, 0x14, 0x6b, 0x5d, 0x53, 0x51, 0xf7, 0xef, 0xbf, 0x01, 0x22}} , - {{0xa4, 0x4b, 0x62, 0x4c, 0xe6, 0xfd, 0x72, 0x07, 0xf2, 0x81, 0xfc, 0xf2, 0xbd, 0x12, 0x7c, 0x68, 0x76, 0x2a, 0xba, 0xf5, 0x65, 0xb1, 0x1f, 0x17, 0x0a, 0x38, 0xb0, 0xbf, 0xc0, 0xf8, 0xf4, 0x2a}}}, -{{{0x55, 0x60, 0x55, 0x5b, 0xe4, 0x1d, 0x71, 0x4c, 0x9d, 0x5b, 0x9f, 0x70, 0xa6, 0x85, 0x9a, 0x2c, 0xa0, 0xe2, 0x32, 0x48, 0xce, 0x9e, 0x2a, 0xa5, 0x07, 0x3b, 0xc7, 0x6c, 0x86, 0x77, 0xde, 0x3c}} , - {{0xf7, 0x18, 0x7a, 0x96, 0x7e, 0x43, 0x57, 0xa9, 0x55, 0xfc, 0x4e, 0xb6, 0x72, 0x00, 0xf2, 0xe4, 0xd7, 0x52, 0xd3, 0xd3, 0xb6, 0x85, 0xf6, 0x71, 0xc7, 0x44, 0x3f, 0x7f, 0xd7, 0xb3, 0xf2, 0x79}}}, -{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, - {{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, -{{{0x46, 0xca, 0xa7, 0x55, 0x7b, 0x79, 0xf3, 0xca, 0x5a, 0x65, 0xf6, 0xed, 0x50, 0x14, 0x7b, 0xe4, 0xc4, 0x2a, 0x65, 0x9e, 0xe2, 0xf9, 0xca, 0xa7, 0x22, 0x26, 0x53, 0xcb, 0x21, 0x5b, 0xa7, 0x31}} , - {{0x90, 0xd7, 0xc5, 0x26, 0x08, 0xbd, 0xb0, 0x53, 0x63, 0x58, 0xc3, 0x31, 0x5e, 0x75, 0x46, 0x15, 0x91, 0xa6, 0xf8, 0x2f, 0x1a, 0x08, 0x65, 0x88, 0x2f, 0x98, 0x04, 0xf1, 0x7c, 0x6e, 0x00, 0x77}}}, -{{{0x81, 0x21, 0x61, 0x09, 0xf6, 0x4e, 0xf1, 0x92, 0xee, 0x63, 0x61, 0x73, 0x87, 0xc7, 0x54, 0x0e, 0x42, 0x4b, 0xc9, 0x47, 0xd1, 0xb8, 0x7e, 0x91, 0x75, 0x37, 0x99, 0x28, 0xb8, 0xdd, 0x7f, 0x50}} , - {{0x89, 0x8f, 0xc0, 0xbe, 0x5d, 0xd6, 0x9f, 0xa0, 0xf0, 0x9d, 0x81, 0xce, 0x3a, 0x7b, 0x98, 0x58, 0xbb, 0xd7, 0x78, 0xc8, 0x3f, 0x13, 0xf1, 0x74, 0x19, 0xdf, 0xf8, 0x98, 0x89, 0x5d, 0xfa, 0x5f}}}, -{{{0x9e, 0x35, 0x85, 0x94, 0x47, 0x1f, 0x90, 0x15, 0x26, 0xd0, 0x84, 0xed, 0x8a, 0x80, 0xf7, 0x63, 0x42, 0x86, 0x27, 0xd7, 0xf4, 0x75, 0x58, 0xdc, 0x9c, 0xc0, 0x22, 0x7e, 0x20, 0x35, 0xfd, 0x1f}} , - {{0x68, 0x0e, 0x6f, 0x97, 0xba, 0x70, 0xbb, 0xa3, 0x0e, 0xe5, 0x0b, 0x12, 0xf4, 0xa2, 0xdc, 0x47, 0xf8, 0xe6, 0xd0, 0x23, 0x6c, 0x33, 0xa8, 0x99, 0x46, 0x6e, 0x0f, 0x44, 0xba, 0x76, 0x48, 0x0f}}}, -{{{0xa3, 0x2a, 0x61, 0x37, 0xe2, 0x59, 0x12, 0x0e, 0x27, 0xba, 0x64, 0x43, 0xae, 0xc0, 0x42, 0x69, 0x79, 0xa4, 0x1e, 0x29, 0x8b, 0x15, 0xeb, 0xf8, 0xaf, 0xd4, 0xa2, 0x68, 0x33, 0xb5, 0x7a, 0x24}} , - {{0x2c, 0x19, 0x33, 0xdd, 0x1b, 0xab, 0xec, 0x01, 0xb0, 0x23, 0xf8, 0x42, 0x2b, 0x06, 0x88, 0xea, 0x3d, 0x2d, 0x00, 0x2a, 0x78, 0x45, 0x4d, 0x38, 0xed, 0x2e, 0x2e, 0x44, 0x49, 0xed, 0xcb, 0x33}}}, -{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, - {{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, -{{{0xa0, 0x68, 0xe8, 0x41, 0x8f, 0x91, 0xf8, 0x11, 0x13, 0x90, 0x2e, 0xa7, 0xab, 0x30, 0xef, 0xad, 0xa0, 0x61, 0x00, 0x88, 0xef, 0xdb, 0xce, 0x5b, 0x5c, 0xbb, 0x62, 0xc8, 0x56, 0xf9, 0x00, 0x73}} , - {{0x3f, 0x60, 0xc1, 0x82, 0x2d, 0xa3, 0x28, 0x58, 0x24, 0x9e, 0x9f, 0xe3, 0x70, 0xcc, 0x09, 0x4e, 0x1a, 0x3f, 0x11, 0x11, 0x15, 0x07, 0x3c, 0xa4, 0x41, 0xe0, 0x65, 0xa3, 0x0a, 0x41, 0x6d, 0x11}}}, -{{{0x31, 0x40, 0x01, 0x52, 0x56, 0x94, 0x5b, 0x28, 0x8a, 0xaa, 0x52, 0xee, 0xd8, 0x0a, 0x05, 0x8d, 0xcd, 0xb5, 0xaa, 0x2e, 0x38, 0xaa, 0xb7, 0x87, 0xf7, 0x2b, 0xfb, 0x04, 0xcb, 0x84, 0x3d, 0x54}} , - {{0x20, 0xef, 0x59, 0xde, 0xa4, 0x2b, 0x93, 0x6e, 0x2e, 0xec, 0x42, 0x9a, 0xd4, 0x2d, 0xf4, 0x46, 0x58, 0x27, 0x2b, 0x18, 0x8f, 0x83, 0x3d, 0x69, 0x9e, 0xd4, 0x3e, 0xb6, 0xc5, 0xfd, 0x58, 0x03}}}, -{{{0x33, 0x89, 0xc9, 0x63, 0x62, 0x1c, 0x17, 0xb4, 0x60, 0xc4, 0x26, 0x68, 0x09, 0xc3, 0x2e, 0x37, 0x0f, 0x7b, 0xb4, 0x9c, 0xb6, 0xf9, 0xfb, 0xd4, 0x51, 0x78, 0xc8, 0x63, 0xea, 0x77, 0x47, 0x07}} , - {{0x32, 0xb4, 0x18, 0x47, 0x79, 0xcb, 0xd4, 0x5a, 0x07, 0x14, 0x0f, 0xa0, 0xd5, 0xac, 0xd0, 0x41, 0x40, 0xab, 0x61, 0x23, 0xe5, 0x2a, 0x2a, 0x6f, 0xf7, 0xa8, 0xd4, 0x76, 0xef, 0xe7, 0x45, 0x6c}}}, -{{{0xa1, 0x5e, 0x60, 0x4f, 0xfb, 0xe1, 0x70, 0x6a, 0x1f, 0x55, 0x4f, 0x09, 0xb4, 0x95, 0x33, 0x36, 0xc6, 0x81, 0x01, 0x18, 0x06, 0x25, 0x27, 0xa4, 0xb4, 0x24, 0xa4, 0x86, 0x03, 0x4c, 0xac, 0x02}} , - {{0x77, 0x38, 0xde, 0xd7, 0x60, 0x48, 0x07, 0xf0, 0x74, 0xa8, 0xff, 0x54, 0xe5, 0x30, 0x43, 0xff, 0x77, 0xfb, 0x21, 0x07, 0xff, 0xb2, 0x07, 0x6b, 0xe4, 0xe5, 0x30, 0xfc, 0x19, 0x6c, 0xa3, 0x01}}}, -{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, - {{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, -{{{0x13, 0xc5, 0x2c, 0xac, 0xd3, 0x83, 0x82, 0x7c, 0x29, 0xf7, 0x05, 0xa5, 0x00, 0xb6, 0x1f, 0x86, 0x55, 0xf4, 0xd6, 0x2f, 0x0c, 0x99, 0xd0, 0x65, 0x9b, 0x6b, 0x46, 0x0d, 0x43, 0xf8, 0x16, 0x28}} , - {{0x1e, 0x7f, 0xb4, 0x74, 0x7e, 0xb1, 0x89, 0x4f, 0x18, 0x5a, 0xab, 0x64, 0x06, 0xdf, 0x45, 0x87, 0xe0, 0x6a, 0xc6, 0xf0, 0x0e, 0xc9, 0x24, 0x35, 0x38, 0xea, 0x30, 0x54, 0xb4, 0xc4, 0x52, 0x54}}}, -{{{0xe9, 0x9f, 0xdc, 0x3f, 0xc1, 0x89, 0x44, 0x74, 0x27, 0xe4, 0xc1, 0x90, 0xff, 0x4a, 0xa7, 0x3c, 0xee, 0xcd, 0xf4, 0x1d, 0x25, 0x94, 0x7f, 0x63, 0x16, 0x48, 0xbc, 0x64, 0xfe, 0x95, 0xc4, 0x0c}} , - {{0x8b, 0x19, 0x75, 0x6e, 0x03, 0x06, 0x5e, 0x6a, 0x6f, 0x1a, 0x8c, 0xe3, 0xd3, 0x28, 0xf2, 0xe0, 0xb9, 0x7a, 0x43, 0x69, 0xe6, 0xd3, 0xc0, 0xfe, 0x7e, 0x97, 0xab, 0x6c, 0x7b, 0x8e, 0x13, 0x42}}}, -{{{0xd4, 0xca, 0x70, 0x3d, 0xab, 0xfb, 0x5f, 0x5e, 0x00, 0x0c, 0xcc, 0x77, 0x22, 0xf8, 0x78, 0x55, 0xae, 0x62, 0x35, 0xfb, 0x9a, 0xc6, 0x03, 0xe4, 0x0c, 0xee, 0xab, 0xc7, 0xc0, 0x89, 0x87, 0x54}} , - {{0x32, 0xad, 0xae, 0x85, 0x58, 0x43, 0xb8, 0xb1, 0xe6, 0x3e, 0x00, 0x9c, 0x78, 0x88, 0x56, 0xdb, 0x9c, 0xfc, 0x79, 0xf6, 0xf9, 0x41, 0x5f, 0xb7, 0xbc, 0x11, 0xf9, 0x20, 0x36, 0x1c, 0x53, 0x2b}}}, -{{{0x5a, 0x20, 0x5b, 0xa1, 0xa5, 0x44, 0x91, 0x24, 0x02, 0x63, 0x12, 0x64, 0xb8, 0x55, 0xf6, 0xde, 0x2c, 0xdb, 0x47, 0xb8, 0xc6, 0x0a, 0xc3, 0x00, 0x78, 0x93, 0xd8, 0xf5, 0xf5, 0x18, 0x28, 0x0a}} , - {{0xd6, 0x1b, 0x9a, 0x6c, 0xe5, 0x46, 0xea, 0x70, 0x96, 0x8d, 0x4e, 0x2a, 0x52, 0x21, 0x26, 0x4b, 0xb1, 0xbb, 0x0f, 0x7c, 0xa9, 0x9b, 0x04, 0xbb, 0x51, 0x08, 0xf1, 0x9a, 0xa4, 0x76, 0x7c, 0x18}}}, -{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, - {{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, -{{{0xfa, 0x94, 0xf7, 0x40, 0xd0, 0xd7, 0xeb, 0xa9, 0x82, 0x36, 0xd5, 0x15, 0xb9, 0x33, 0x7a, 0xbf, 0x8a, 0xf2, 0x63, 0xaa, 0x37, 0xf5, 0x59, 0xac, 0xbd, 0xbb, 0x32, 0x36, 0xbe, 0x73, 0x99, 0x38}} , - {{0x2c, 0xb3, 0xda, 0x7a, 0xd8, 0x3d, 0x99, 0xca, 0xd2, 0xf4, 0xda, 0x99, 0x8e, 0x4f, 0x98, 0xb7, 0xf4, 0xae, 0x3e, 0x9f, 0x8e, 0x35, 0x60, 0xa4, 0x33, 0x75, 0xa4, 0x04, 0x93, 0xb1, 0x6b, 0x4d}}}, -{{{0x97, 0x9d, 0xa8, 0xcd, 0x97, 0x7b, 0x9d, 0xb9, 0xe7, 0xa5, 0xef, 0xfd, 0xa8, 0x42, 0x6b, 0xc3, 0x62, 0x64, 0x7d, 0xa5, 0x1b, 0xc9, 0x9e, 0xd2, 0x45, 0xb9, 0xee, 0x03, 0xb0, 0xbf, 0xc0, 0x68}} , - {{0xed, 0xb7, 0x84, 0x2c, 0xf6, 0xd3, 0xa1, 0x6b, 0x24, 0x6d, 0x87, 0x56, 0x97, 0x59, 0x79, 0x62, 0x9f, 0xac, 0xed, 0xf3, 0xc9, 0x89, 0x21, 0x2e, 0x04, 0xb3, 0xcc, 0x2f, 0xbe, 0xd6, 0x0a, 0x4b}}}, -{{{0x39, 0x61, 0x05, 0xed, 0x25, 0x89, 0x8b, 0x5d, 0x1b, 0xcb, 0x0c, 0x55, 0xf4, 0x6a, 0x00, 0x8a, 0x46, 0xe8, 0x1e, 0xc6, 0x83, 0xc8, 0x5a, 0x76, 0xdb, 0xcc, 0x19, 0x7a, 0xcc, 0x67, 0x46, 0x0b}} , - {{0x53, 0xcf, 0xc2, 0xa1, 0xad, 0x6a, 0xf3, 0xcd, 0x8f, 0xc9, 0xde, 0x1c, 0xf8, 0x6c, 0x8f, 0xf8, 0x76, 0x42, 0xe7, 0xfe, 0xb2, 0x72, 0x21, 0x0a, 0x66, 0x74, 0x8f, 0xb7, 0xeb, 0xe4, 0x6f, 0x01}}}, -{{{0x22, 0x8c, 0x6b, 0xbe, 0xfc, 0x4d, 0x70, 0x62, 0x6e, 0x52, 0x77, 0x99, 0x88, 0x7e, 0x7b, 0x57, 0x7a, 0x0d, 0xfe, 0xdc, 0x72, 0x92, 0xf1, 0x68, 0x1d, 0x97, 0xd7, 0x7c, 0x8d, 0x53, 0x10, 0x37}} , - {{0x53, 0x88, 0x77, 0x02, 0xca, 0x27, 0xa8, 0xe5, 0x45, 0xe2, 0xa8, 0x48, 0x2a, 0xab, 0x18, 0xca, 0xea, 0x2d, 0x2a, 0x54, 0x17, 0x37, 0x32, 0x09, 0xdc, 0xe0, 0x4a, 0xb7, 0x7d, 0x82, 0x10, 0x7d}}}, -{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, - {{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, -{{{0x8a, 0x64, 0x1e, 0x14, 0x0a, 0x57, 0xd4, 0xda, 0x5c, 0x96, 0x9b, 0x01, 0x4c, 0x67, 0xbf, 0x8b, 0x30, 0xfe, 0x08, 0xdb, 0x0d, 0xd5, 0xa8, 0xd7, 0x09, 0x11, 0x85, 0xa2, 0xd3, 0x45, 0xfb, 0x7e}} , - {{0xda, 0x8c, 0xc2, 0xd0, 0xac, 0x18, 0xe8, 0x52, 0x36, 0xd4, 0x21, 0xa3, 0xdd, 0x57, 0x22, 0x79, 0xb7, 0xf8, 0x71, 0x9d, 0xc6, 0x91, 0x70, 0x86, 0x56, 0xbf, 0xa1, 0x11, 0x8b, 0x19, 0xe1, 0x0f}}}, -{{{0x18, 0x32, 0x98, 0x2c, 0x8f, 0x91, 0xae, 0x12, 0xf0, 0x8c, 0xea, 0xf3, 0x3c, 0xb9, 0x5d, 0xe4, 0x69, 0xed, 0xb2, 0x47, 0x18, 0xbd, 0xce, 0x16, 0x52, 0x5c, 0x23, 0xe2, 0xa5, 0x25, 0x52, 0x5d}} , - {{0xb9, 0xb1, 0xe7, 0x5d, 0x4e, 0xbc, 0xee, 0xbb, 0x40, 0x81, 0x77, 0x82, 0x19, 0xab, 0xb5, 0xc6, 0xee, 0xab, 0x5b, 0x6b, 0x63, 0x92, 0x8a, 0x34, 0x8d, 0xcd, 0xee, 0x4f, 0x49, 0xe5, 0xc9, 0x7e}}}, -{{{0x21, 0xac, 0x8b, 0x22, 0xcd, 0xc3, 0x9a, 0xe9, 0x5e, 0x78, 0xbd, 0xde, 0xba, 0xad, 0xab, 0xbf, 0x75, 0x41, 0x09, 0xc5, 0x58, 0xa4, 0x7d, 0x92, 0xb0, 0x7f, 0xf2, 0xa1, 0xd1, 0xc0, 0xb3, 0x6d}} , - {{0x62, 0x4f, 0xd0, 0x75, 0x77, 0xba, 0x76, 0x77, 0xd7, 0xb8, 0xd8, 0x92, 0x6f, 0x98, 0x34, 0x3d, 0xd6, 0x4e, 0x1c, 0x0f, 0xf0, 0x8f, 0x2e, 0xf1, 0xb3, 0xbd, 0xb1, 0xb9, 0xec, 0x99, 0xb4, 0x07}}}, -{{{0x60, 0x57, 0x2e, 0x9a, 0x72, 0x1d, 0x6b, 0x6e, 0x58, 0x33, 0x24, 0x8c, 0x48, 0x39, 0x46, 0x8e, 0x89, 0x6a, 0x88, 0x51, 0x23, 0x62, 0xb5, 0x32, 0x09, 0x36, 0xe3, 0x57, 0xf5, 0x98, 0xde, 0x6f}} , - {{0x8b, 0x2c, 0x00, 0x48, 0x4a, 0xf9, 0x5b, 0x87, 0x69, 0x52, 0xe5, 0x5b, 0xd1, 0xb1, 0xe5, 0x25, 0x25, 0xe0, 0x9c, 0xc2, 0x13, 0x44, 0xe8, 0xb9, 0x0a, 0x70, 0xad, 0xbd, 0x0f, 0x51, 0x94, 0x69}}}, -{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, - {{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, -{{{0xa2, 0xdc, 0xab, 0xa9, 0x25, 0x2d, 0xac, 0x5f, 0x03, 0x33, 0x08, 0xe7, 0x7e, 0xfe, 0x95, 0x36, 0x3c, 0x5b, 0x3a, 0xd3, 0x05, 0x82, 0x1c, 0x95, 0x2d, 0xd8, 0x77, 0x7e, 0x02, 0xd9, 0x5b, 0x70}} , - {{0xc2, 0xfe, 0x1b, 0x0c, 0x67, 0xcd, 0xd6, 0xe0, 0x51, 0x8e, 0x2c, 0xe0, 0x79, 0x88, 0xf0, 0xcf, 0x41, 0x4a, 0xad, 0x23, 0xd4, 0x46, 0xca, 0x94, 0xa1, 0xc3, 0xeb, 0x28, 0x06, 0xfa, 0x17, 0x14}}}, -{{{0x7b, 0xaa, 0x70, 0x0a, 0x4b, 0xfb, 0xf5, 0xbf, 0x80, 0xc5, 0xcf, 0x08, 0x7a, 0xdd, 0xa1, 0xf4, 0x9d, 0x54, 0x50, 0x53, 0x23, 0x77, 0x23, 0xf5, 0x34, 0xa5, 0x22, 0xd1, 0x0d, 0x96, 0x2e, 0x47}} , - {{0xcc, 0xb7, 0x32, 0x89, 0x57, 0xd0, 0x98, 0x75, 0xe4, 0x37, 0x99, 0xa9, 0xe8, 0xba, 0xed, 0xba, 0xeb, 0xc7, 0x4f, 0x15, 0x76, 0x07, 0x0c, 0x4c, 0xef, 0x9f, 0x52, 0xfc, 0x04, 0x5d, 0x58, 0x10}}}, -{{{0xce, 0x82, 0xf0, 0x8f, 0x79, 0x02, 0xa8, 0xd1, 0xda, 0x14, 0x09, 0x48, 0xee, 0x8a, 0x40, 0x98, 0x76, 0x60, 0x54, 0x5a, 0xde, 0x03, 0x24, 0xf5, 0xe6, 0x2f, 0xe1, 0x03, 0xbf, 0x68, 0x82, 0x7f}} , - {{0x64, 0xe9, 0x28, 0xc7, 0xa4, 0xcf, 0x2a, 0xf9, 0x90, 0x64, 0x72, 0x2c, 0x8b, 0xeb, 0xec, 0xa0, 0xf2, 0x7d, 0x35, 0xb5, 0x90, 0x4d, 0x7f, 0x5b, 0x4a, 0x49, 0xe4, 0xb8, 0x3b, 0xc8, 0xa1, 0x2f}}}, -{{{0x8b, 0xc5, 0xcc, 0x3d, 0x69, 0xa6, 0xa1, 0x18, 0x44, 0xbc, 0x4d, 0x77, 0x37, 0xc7, 0x86, 0xec, 0x0c, 0xc9, 0xd6, 0x44, 0xa9, 0x23, 0x27, 0xb9, 0x03, 0x34, 0xa7, 0x0a, 0xd5, 0xc7, 0x34, 0x37}} , - {{0xf9, 0x7e, 0x3e, 0x66, 0xee, 0xf9, 0x99, 0x28, 0xff, 0xad, 0x11, 0xd8, 0xe2, 0x66, 0xc5, 0xcd, 0x0f, 0x0d, 0x0b, 0x6a, 0xfc, 0x7c, 0x24, 0xa8, 0x4f, 0xa8, 0x5e, 0x80, 0x45, 0x8b, 0x6c, 0x41}}}, -{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, - {{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, -{{{0xef, 0x1e, 0xec, 0xf7, 0x8d, 0x77, 0xf2, 0xea, 0xdb, 0x60, 0x03, 0x21, 0xc0, 0xff, 0x5e, 0x67, 0xc3, 0x71, 0x0b, 0x21, 0xb4, 0x41, 0xa0, 0x68, 0x38, 0xc6, 0x01, 0xa3, 0xd3, 0x51, 0x3c, 0x3c}} , - {{0x92, 0xf8, 0xd6, 0x4b, 0xef, 0x42, 0x13, 0xb2, 0x4a, 0xc4, 0x2e, 0x72, 0x3f, 0xc9, 0x11, 0xbd, 0x74, 0x02, 0x0e, 0xf5, 0x13, 0x9d, 0x83, 0x1a, 0x1b, 0xd5, 0x54, 0xde, 0xc4, 0x1e, 0x16, 0x6c}}}, -{{{0x27, 0x52, 0xe4, 0x63, 0xaa, 0x94, 0xe6, 0xc3, 0x28, 0x9c, 0xc6, 0x56, 0xac, 0xfa, 0xb6, 0xbd, 0xe2, 0xcc, 0x76, 0xc6, 0x27, 0x27, 0xa2, 0x8e, 0x78, 0x2b, 0x84, 0x72, 0x10, 0xbd, 0x4e, 0x2a}} , - {{0xea, 0xa7, 0x23, 0xef, 0x04, 0x61, 0x80, 0x50, 0xc9, 0x6e, 0xa5, 0x96, 0xd1, 0xd1, 0xc8, 0xc3, 0x18, 0xd7, 0x2d, 0xfd, 0x26, 0xbd, 0xcb, 0x7b, 0x92, 0x51, 0x0e, 0x4a, 0x65, 0x57, 0xb8, 0x49}}}, -{{{0xab, 0x55, 0x36, 0xc3, 0xec, 0x63, 0x55, 0x11, 0x55, 0xf6, 0xa5, 0xc7, 0x01, 0x5f, 0xfe, 0x79, 0xd8, 0x0a, 0xf7, 0x03, 0xd8, 0x98, 0x99, 0xf5, 0xd0, 0x00, 0x54, 0x6b, 0x66, 0x28, 0xf5, 0x25}} , - {{0x7a, 0x8d, 0xa1, 0x5d, 0x70, 0x5d, 0x51, 0x27, 0xee, 0x30, 0x65, 0x56, 0x95, 0x46, 0xde, 0xbd, 0x03, 0x75, 0xb4, 0x57, 0x59, 0x89, 0xeb, 0x02, 0x9e, 0xcc, 0x89, 0x19, 0xa7, 0xcb, 0x17, 0x67}}}, -{{{0x6a, 0xeb, 0xfc, 0x9a, 0x9a, 0x10, 0xce, 0xdb, 0x3a, 0x1c, 0x3c, 0x6a, 0x9d, 0xea, 0x46, 0xbc, 0x45, 0x49, 0xac, 0xe3, 0x41, 0x12, 0x7c, 0xf0, 0xf7, 0x4f, 0xf9, 0xf7, 0xff, 0x2c, 0x89, 0x04}} , - {{0x30, 0x31, 0x54, 0x1a, 0x46, 0xca, 0xe6, 0xc6, 0xcb, 0xe2, 0xc3, 0xc1, 0x8b, 0x75, 0x81, 0xbe, 0xee, 0xf8, 0xa3, 0x11, 0x1c, 0x25, 0xa3, 0xa7, 0x35, 0x51, 0x55, 0xe2, 0x25, 0xaa, 0xe2, 0x3a}}}, -{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, - {{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, -{{{0xb4, 0x48, 0x10, 0x9f, 0x8a, 0x09, 0x76, 0xfa, 0xf0, 0x7a, 0xb0, 0x70, 0xf7, 0x83, 0x80, 0x52, 0x84, 0x2b, 0x26, 0xa2, 0xc4, 0x5d, 0x4f, 0xba, 0xb1, 0xc8, 0x40, 0x0d, 0x78, 0x97, 0xc4, 0x60}} , - {{0xd4, 0xb1, 0x6c, 0x08, 0xc7, 0x40, 0x38, 0x73, 0x5f, 0x0b, 0xf3, 0x76, 0x5d, 0xb2, 0xa5, 0x2f, 0x57, 0x57, 0x07, 0xed, 0x08, 0xa2, 0x6c, 0x4f, 0x08, 0x02, 0xb5, 0x0e, 0xee, 0x44, 0xfa, 0x22}}}, -{{{0x0f, 0x00, 0x3f, 0xa6, 0x04, 0x19, 0x56, 0x65, 0x31, 0x7f, 0x8b, 0xeb, 0x0d, 0xe1, 0x47, 0x89, 0x97, 0x16, 0x53, 0xfa, 0x81, 0xa7, 0xaa, 0xb2, 0xbf, 0x67, 0xeb, 0x72, 0x60, 0x81, 0x0d, 0x48}} , - {{0x7e, 0x13, 0x33, 0xcd, 0xa8, 0x84, 0x56, 0x1e, 0x67, 0xaf, 0x6b, 0x43, 0xac, 0x17, 0xaf, 0x16, 0xc0, 0x52, 0x99, 0x49, 0x5b, 0x87, 0x73, 0x7e, 0xb5, 0x43, 0xda, 0x6b, 0x1d, 0x0f, 0x2d, 0x55}}}, -{{{0xe9, 0x58, 0x1f, 0xff, 0x84, 0x3f, 0x93, 0x1c, 0xcb, 0xe1, 0x30, 0x69, 0xa5, 0x75, 0x19, 0x7e, 0x14, 0x5f, 0xf8, 0xfc, 0x09, 0xdd, 0xa8, 0x78, 0x9d, 0xca, 0x59, 0x8b, 0xd1, 0x30, 0x01, 0x13}} , - {{0xff, 0x76, 0x03, 0xc5, 0x4b, 0x89, 0x99, 0x70, 0x00, 0x59, 0x70, 0x9c, 0xd5, 0xd9, 0x11, 0x89, 0x5a, 0x46, 0xfe, 0xef, 0xdc, 0xd9, 0x55, 0x2b, 0x45, 0xa7, 0xb0, 0x2d, 0xfb, 0x24, 0xc2, 0x29}}}, -{{{0x38, 0x06, 0xf8, 0x0b, 0xac, 0x82, 0xc4, 0x97, 0x2b, 0x90, 0xe0, 0xf7, 0xa8, 0xab, 0x6c, 0x08, 0x80, 0x66, 0x90, 0x46, 0xf7, 0x26, 0x2d, 0xf8, 0xf1, 0xc4, 0x6b, 0x4a, 0x82, 0x98, 0x8e, 0x37}} , - {{0x8e, 0xb4, 0xee, 0xb8, 0xd4, 0x3f, 0xb2, 0x1b, 0xe0, 0x0a, 0x3d, 0x75, 0x34, 0x28, 0xa2, 0x8e, 0xc4, 0x92, 0x7b, 0xfe, 0x60, 0x6e, 0x6d, 0xb8, 0x31, 0x1d, 0x62, 0x0d, 0x78, 0x14, 0x42, 0x11}}}, -{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, - {{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, -{{{0x5e, 0xa8, 0xd8, 0x04, 0x9b, 0x73, 0xc9, 0xc9, 0xdc, 0x0d, 0x73, 0xbf, 0x0a, 0x0a, 0x73, 0xff, 0x18, 0x1f, 0x9c, 0x51, 0xaa, 0xc6, 0xf1, 0x83, 0x25, 0xfd, 0xab, 0xa3, 0x11, 0xd3, 0x01, 0x24}} , - {{0x4d, 0xe3, 0x7e, 0x38, 0x62, 0x5e, 0x64, 0xbb, 0x2b, 0x53, 0xb5, 0x03, 0x68, 0xc4, 0xf2, 0x2b, 0x5a, 0x03, 0x32, 0x99, 0x4a, 0x41, 0x9a, 0xe1, 0x1a, 0xae, 0x8c, 0x48, 0xf3, 0x24, 0x32, 0x65}}}, -{{{0xe8, 0xdd, 0xad, 0x3a, 0x8c, 0xea, 0xf4, 0xb3, 0xb2, 0xe5, 0x73, 0xf2, 0xed, 0x8b, 0xbf, 0xed, 0xb1, 0x0c, 0x0c, 0xfb, 0x2b, 0xf1, 0x01, 0x48, 0xe8, 0x26, 0x03, 0x8e, 0x27, 0x4d, 0x96, 0x72}} , - {{0xc8, 0x09, 0x3b, 0x60, 0xc9, 0x26, 0x4d, 0x7c, 0xf2, 0x9c, 0xd4, 0xa1, 0x3b, 0x26, 0xc2, 0x04, 0x33, 0x44, 0x76, 0x3c, 0x02, 0xbb, 0x11, 0x42, 0x0c, 0x22, 0xb7, 0xc6, 0xe1, 0xac, 0xb4, 0x0e}}}, -{{{0x6f, 0x85, 0xe7, 0xef, 0xde, 0x67, 0x30, 0xfc, 0xbf, 0x5a, 0xe0, 0x7b, 0x7a, 0x2a, 0x54, 0x6b, 0x5d, 0x62, 0x85, 0xa1, 0xf8, 0x16, 0x88, 0xec, 0x61, 0xb9, 0x96, 0xb5, 0xef, 0x2d, 0x43, 0x4d}} , - {{0x7c, 0x31, 0x33, 0xcc, 0xe4, 0xcf, 0x6c, 0xff, 0x80, 0x47, 0x77, 0xd1, 0xd8, 0xe9, 0x69, 0x97, 0x98, 0x7f, 0x20, 0x57, 0x1d, 0x1d, 0x4f, 0x08, 0x27, 0xc8, 0x35, 0x57, 0x40, 0xc6, 0x21, 0x0c}}}, -{{{0xd2, 0x8e, 0x9b, 0xfa, 0x42, 0x8e, 0xdf, 0x8f, 0xc7, 0x86, 0xf9, 0xa4, 0xca, 0x70, 0x00, 0x9d, 0x21, 0xbf, 0xec, 0x57, 0x62, 0x30, 0x58, 0x8c, 0x0d, 0x35, 0xdb, 0x5d, 0x8b, 0x6a, 0xa0, 0x5a}} , - {{0xc1, 0x58, 0x7c, 0x0d, 0x20, 0xdd, 0x11, 0x26, 0x5f, 0x89, 0x3b, 0x97, 0x58, 0xf8, 0x8b, 0xe3, 0xdf, 0x32, 0xe2, 0xfc, 0xd8, 0x67, 0xf2, 0xa5, 0x37, 0x1e, 0x6d, 0xec, 0x7c, 0x27, 0x20, 0x79}}}, -{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, - {{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, -{{{0xd0, 0xe9, 0xc0, 0xfa, 0x95, 0x45, 0x23, 0x96, 0xf1, 0x2c, 0x79, 0x25, 0x14, 0xce, 0x40, 0x14, 0x44, 0x2c, 0x36, 0x50, 0xd9, 0x63, 0x56, 0xb7, 0x56, 0x3b, 0x9e, 0xa7, 0xef, 0x89, 0xbb, 0x0e}} , - {{0xce, 0x7f, 0xdc, 0x0a, 0xcc, 0x82, 0x1c, 0x0a, 0x78, 0x71, 0xe8, 0x74, 0x8d, 0x01, 0x30, 0x0f, 0xa7, 0x11, 0x4c, 0xdf, 0x38, 0xd7, 0xa7, 0x0d, 0xf8, 0x48, 0x52, 0x00, 0x80, 0x7b, 0x5f, 0x0e}}}, -{{{0x25, 0x83, 0xe6, 0x94, 0x7b, 0x81, 0xb2, 0x91, 0xae, 0x0e, 0x05, 0xc9, 0xa3, 0x68, 0x2d, 0xd9, 0x88, 0x25, 0x19, 0x2a, 0x61, 0x61, 0x21, 0x97, 0x15, 0xa1, 0x35, 0xa5, 0x46, 0xc8, 0xa2, 0x0e}} , - {{0x1b, 0x03, 0x0d, 0x8b, 0x5a, 0x1b, 0x97, 0x4b, 0xf2, 0x16, 0x31, 0x3d, 0x1f, 0x33, 0xa0, 0x50, 0x3a, 0x18, 0xbe, 0x13, 0xa1, 0x76, 0xc1, 0xba, 0x1b, 0xf1, 0x05, 0x7b, 0x33, 0xa8, 0x82, 0x3b}}}, -{{{0xba, 0x36, 0x7b, 0x6d, 0xa9, 0xea, 0x14, 0x12, 0xc5, 0xfa, 0x91, 0x00, 0xba, 0x9b, 0x99, 0xcc, 0x56, 0x02, 0xe9, 0xa0, 0x26, 0x40, 0x66, 0x8c, 0xc4, 0xf8, 0x85, 0x33, 0x68, 0xe7, 0x03, 0x20}} , - {{0x50, 0x5b, 0xff, 0xa9, 0xb2, 0xf1, 0xf1, 0x78, 0xcf, 0x14, 0xa4, 0xa9, 0xfc, 0x09, 0x46, 0x94, 0x54, 0x65, 0x0d, 0x9c, 0x5f, 0x72, 0x21, 0xe2, 0x97, 0xa5, 0x2d, 0x81, 0xce, 0x4a, 0x5f, 0x79}}}, -{{{0x3d, 0x5f, 0x5c, 0xd2, 0xbc, 0x7d, 0x77, 0x0e, 0x2a, 0x6d, 0x22, 0x45, 0x84, 0x06, 0xc4, 0xdd, 0xc6, 0xa6, 0xc6, 0xd7, 0x49, 0xad, 0x6d, 0x87, 0x91, 0x0e, 0x3a, 0x67, 0x1d, 0x2c, 0x1d, 0x56}} , - {{0xfe, 0x7a, 0x74, 0xcf, 0xd4, 0xd2, 0xe5, 0x19, 0xde, 0xd0, 0xdb, 0x70, 0x23, 0x69, 0xe6, 0x6d, 0xec, 0xec, 0xcc, 0x09, 0x33, 0x6a, 0x77, 0xdc, 0x6b, 0x22, 0x76, 0x5d, 0x92, 0x09, 0xac, 0x2d}}}, -{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, - {{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, -{{{0x23, 0x15, 0x17, 0xeb, 0xd3, 0xdb, 0x12, 0x5e, 0x01, 0xf0, 0x91, 0xab, 0x2c, 0x41, 0xce, 0xac, 0xed, 0x1b, 0x4b, 0x2d, 0xbc, 0xdb, 0x17, 0x66, 0x89, 0x46, 0xad, 0x4b, 0x1e, 0x6f, 0x0b, 0x14}} , - {{0x11, 0xce, 0xbf, 0xb6, 0x77, 0x2d, 0x48, 0x22, 0x18, 0x4f, 0xa3, 0x5d, 0x4a, 0xb0, 0x70, 0x12, 0x3e, 0x54, 0xd7, 0xd8, 0x0e, 0x2b, 0x27, 0xdc, 0x53, 0xff, 0xca, 0x8c, 0x59, 0xb3, 0x4e, 0x44}}}, -{{{0x07, 0x76, 0x61, 0x0f, 0x66, 0xb2, 0x21, 0x39, 0x7e, 0xc0, 0xec, 0x45, 0x28, 0x82, 0xa1, 0x29, 0x32, 0x44, 0x35, 0x13, 0x5e, 0x61, 0x5e, 0x54, 0xcb, 0x7c, 0xef, 0xf6, 0x41, 0xcf, 0x9f, 0x0a}} , - {{0xdd, 0xf9, 0xda, 0x84, 0xc3, 0xe6, 0x8a, 0x9f, 0x24, 0xd2, 0x96, 0x5d, 0x39, 0x6f, 0x58, 0x8c, 0xc1, 0x56, 0x93, 0xab, 0xb5, 0x79, 0x3b, 0xd2, 0xa8, 0x73, 0x16, 0xed, 0xfa, 0xb4, 0x2f, 0x73}}}, -{{{0x8b, 0xb1, 0x95, 0xe5, 0x92, 0x50, 0x35, 0x11, 0x76, 0xac, 0xf4, 0x4d, 0x24, 0xc3, 0x32, 0xe6, 0xeb, 0xfe, 0x2c, 0x87, 0xc4, 0xf1, 0x56, 0xc4, 0x75, 0x24, 0x7a, 0x56, 0x85, 0x5a, 0x3a, 0x13}} , - {{0x0d, 0x16, 0xac, 0x3c, 0x4a, 0x58, 0x86, 0x3a, 0x46, 0x7f, 0x6c, 0xa3, 0x52, 0x6e, 0x37, 0xe4, 0x96, 0x9c, 0xe9, 0x5c, 0x66, 0x41, 0x67, 0xe4, 0xfb, 0x79, 0x0c, 0x05, 0xf6, 0x64, 0xd5, 0x7c}}}, -{{{0x28, 0xc1, 0xe1, 0x54, 0x73, 0xf2, 0xbf, 0x76, 0x74, 0x19, 0x19, 0x1b, 0xe4, 0xb9, 0xa8, 0x46, 0x65, 0x73, 0xf3, 0x77, 0x9b, 0x29, 0x74, 0x5b, 0xc6, 0x89, 0x6c, 0x2c, 0x7c, 0xf8, 0xb3, 0x0f}} , - {{0xf7, 0xd5, 0xe9, 0x74, 0x5d, 0xb8, 0x25, 0x16, 0xb5, 0x30, 0xbc, 0x84, 0xc5, 0xf0, 0xad, 0xca, 0x12, 0x28, 0xbc, 0x9d, 0xd4, 0xfa, 0x82, 0xe6, 0xe3, 0xbf, 0xa2, 0x15, 0x2c, 0xd4, 0x34, 0x10}}}, -{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, - {{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, -{{{0x61, 0xb1, 0x46, 0xba, 0x0e, 0x31, 0xa5, 0x67, 0x6c, 0x7f, 0xd6, 0xd9, 0x27, 0x85, 0x0f, 0x79, 0x14, 0xc8, 0x6c, 0x2f, 0x5f, 0x5b, 0x9c, 0x35, 0x3d, 0x38, 0x86, 0x77, 0x65, 0x55, 0x6a, 0x7b}} , - {{0xd3, 0xb0, 0x3a, 0x66, 0x60, 0x1b, 0x43, 0xf1, 0x26, 0x58, 0x99, 0x09, 0x8f, 0x2d, 0xa3, 0x14, 0x71, 0x85, 0xdb, 0xed, 0xf6, 0x26, 0xd5, 0x61, 0x9a, 0x73, 0xac, 0x0e, 0xea, 0xac, 0xb7, 0x0c}}}, -{{{0x5e, 0xf4, 0xe5, 0x17, 0x0e, 0x10, 0x9f, 0xe7, 0x43, 0x5f, 0x67, 0x5c, 0xac, 0x4b, 0xe5, 0x14, 0x41, 0xd2, 0xbf, 0x48, 0xf5, 0x14, 0xb0, 0x71, 0xc6, 0x61, 0xc1, 0xb2, 0x70, 0x58, 0xd2, 0x5a}} , - {{0x2d, 0xba, 0x16, 0x07, 0x92, 0x94, 0xdc, 0xbd, 0x50, 0x2b, 0xc9, 0x7f, 0x42, 0x00, 0xba, 0x61, 0xed, 0xf8, 0x43, 0xed, 0xf5, 0xf9, 0x40, 0x60, 0xb2, 0xb0, 0x82, 0xcb, 0xed, 0x75, 0xc7, 0x65}}}, -{{{0x80, 0xba, 0x0d, 0x09, 0x40, 0xa7, 0x39, 0xa6, 0x67, 0x34, 0x7e, 0x66, 0xbe, 0x56, 0xfb, 0x53, 0x78, 0xc4, 0x46, 0xe8, 0xed, 0x68, 0x6c, 0x7f, 0xce, 0xe8, 0x9f, 0xce, 0xa2, 0x64, 0x58, 0x53}} , - {{0xe8, 0xc1, 0xa9, 0xc2, 0x7b, 0x59, 0x21, 0x33, 0xe2, 0x43, 0x73, 0x2b, 0xac, 0x2d, 0xc1, 0x89, 0x3b, 0x15, 0xe2, 0xd5, 0xc0, 0x97, 0x8a, 0xfd, 0x6f, 0x36, 0x33, 0xb7, 0xb9, 0xc3, 0x88, 0x09}}}, -{{{0xd0, 0xb6, 0x56, 0x30, 0x5c, 0xae, 0xb3, 0x75, 0x44, 0xa4, 0x83, 0x51, 0x6e, 0x01, 0x65, 0xef, 0x45, 0x76, 0xe6, 0xf5, 0xa2, 0x0d, 0xd4, 0x16, 0x3b, 0x58, 0x2f, 0xf2, 0x2f, 0x36, 0x18, 0x3f}} , - {{0xfd, 0x2f, 0xe0, 0x9b, 0x1e, 0x8c, 0xc5, 0x18, 0xa9, 0xca, 0xd4, 0x2b, 0x35, 0xb6, 0x95, 0x0a, 0x9f, 0x7e, 0xfb, 0xc4, 0xef, 0x88, 0x7b, 0x23, 0x43, 0xec, 0x2f, 0x0d, 0x0f, 0x7a, 0xfc, 0x5c}}}, -{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, - {{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, -{{{0x8d, 0xd2, 0xda, 0xc7, 0x44, 0xd6, 0x7a, 0xdb, 0x26, 0x7d, 0x1d, 0xb8, 0xe1, 0xde, 0x9d, 0x7a, 0x7d, 0x17, 0x7e, 0x1c, 0x37, 0x04, 0x8d, 0x2d, 0x7c, 0x5e, 0x18, 0x38, 0x1e, 0xaf, 0xc7, 0x1b}} , - {{0x33, 0x48, 0x31, 0x00, 0x59, 0xf6, 0xf2, 0xca, 0x0f, 0x27, 0x1b, 0x63, 0x12, 0x7e, 0x02, 0x1d, 0x49, 0xc0, 0x5d, 0x79, 0x87, 0xef, 0x5e, 0x7a, 0x2f, 0x1f, 0x66, 0x55, 0xd8, 0x09, 0xd9, 0x61}}}, -{{{0x54, 0x83, 0x02, 0x18, 0x82, 0x93, 0x99, 0x07, 0xd0, 0xa7, 0xda, 0xd8, 0x75, 0x89, 0xfa, 0xf2, 0xd9, 0xa3, 0xb8, 0x6b, 0x5a, 0x35, 0x28, 0xd2, 0x6b, 0x59, 0xc2, 0xf8, 0x45, 0xe2, 0xbc, 0x06}} , - {{0x65, 0xc0, 0xa3, 0x88, 0x51, 0x95, 0xfc, 0x96, 0x94, 0x78, 0xe8, 0x0d, 0x8b, 0x41, 0xc9, 0xc2, 0x58, 0x48, 0x75, 0x10, 0x2f, 0xcd, 0x2a, 0xc9, 0xa0, 0x6d, 0x0f, 0xdd, 0x9c, 0x98, 0x26, 0x3d}}}, -{{{0x2f, 0x66, 0x29, 0x1b, 0x04, 0x89, 0xbd, 0x7e, 0xee, 0x6e, 0xdd, 0xb7, 0x0e, 0xef, 0xb0, 0x0c, 0xb4, 0xfc, 0x7f, 0xc2, 0xc9, 0x3a, 0x3c, 0x64, 0xef, 0x45, 0x44, 0xaf, 0x8a, 0x90, 0x65, 0x76}} , - {{0xa1, 0x4c, 0x70, 0x4b, 0x0e, 0xa0, 0x83, 0x70, 0x13, 0xa4, 0xaf, 0xb8, 0x38, 0x19, 0x22, 0x65, 0x09, 0xb4, 0x02, 0x4f, 0x06, 0xf8, 0x17, 0xce, 0x46, 0x45, 0xda, 0x50, 0x7c, 0x8a, 0xd1, 0x4e}}}, -{{{0xf7, 0xd4, 0x16, 0x6c, 0x4e, 0x95, 0x9d, 0x5d, 0x0f, 0x91, 0x2b, 0x52, 0xfe, 0x5c, 0x34, 0xe5, 0x30, 0xe6, 0xa4, 0x3b, 0xf3, 0xf3, 0x34, 0x08, 0xa9, 0x4a, 0xa0, 0xb5, 0x6e, 0xb3, 0x09, 0x0a}} , - {{0x26, 0xd9, 0x5e, 0xa3, 0x0f, 0xeb, 0xa2, 0xf3, 0x20, 0x3b, 0x37, 0xd4, 0xe4, 0x9e, 0xce, 0x06, 0x3d, 0x53, 0xed, 0xae, 0x2b, 0xeb, 0xb6, 0x24, 0x0a, 0x11, 0xa3, 0x0f, 0xd6, 0x7f, 0xa4, 0x3a}}}, -{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, - {{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, -{{{0xdb, 0x9f, 0x2c, 0xfc, 0xd6, 0xb2, 0x1e, 0x2e, 0x52, 0x7a, 0x06, 0x87, 0x2d, 0x86, 0x72, 0x2b, 0x6d, 0x90, 0x77, 0x46, 0x43, 0xb5, 0x7a, 0xf8, 0x60, 0x7d, 0x91, 0x60, 0x5b, 0x9d, 0x9e, 0x07}} , - {{0x97, 0x87, 0xc7, 0x04, 0x1c, 0x38, 0x01, 0x39, 0x58, 0xc7, 0x85, 0xa3, 0xfc, 0x64, 0x00, 0x64, 0x25, 0xa2, 0xbf, 0x50, 0x94, 0xca, 0x26, 0x31, 0x45, 0x0a, 0x24, 0xd2, 0x51, 0x29, 0x51, 0x16}}}, -{{{0x4d, 0x4a, 0xd7, 0x98, 0x71, 0x57, 0xac, 0x7d, 0x8b, 0x37, 0xbd, 0x63, 0xff, 0x87, 0xb1, 0x49, 0x95, 0x20, 0x7c, 0xcf, 0x7c, 0x59, 0xc4, 0x91, 0x9c, 0xef, 0xd0, 0xdb, 0x60, 0x09, 0x9d, 0x46}} , - {{0xcb, 0x78, 0x94, 0x90, 0xe4, 0x45, 0xb3, 0xf6, 0xd9, 0xf6, 0x57, 0x74, 0xd5, 0xf8, 0x83, 0x4f, 0x39, 0xc9, 0xbd, 0x88, 0xc2, 0x57, 0x21, 0x1f, 0x24, 0x32, 0x68, 0xf8, 0xc7, 0x21, 0x5f, 0x0b}}}, -{{{0x2a, 0x36, 0x68, 0xfc, 0x5f, 0xb6, 0x4f, 0xa5, 0xe3, 0x9d, 0x24, 0x2f, 0xc0, 0x93, 0x61, 0xcf, 0xf8, 0x0a, 0xed, 0xe1, 0xdb, 0x27, 0xec, 0x0e, 0x14, 0x32, 0x5f, 0x8e, 0xa1, 0x62, 0x41, 0x16}} , - {{0x95, 0x21, 0x01, 0xce, 0x95, 0x5b, 0x0e, 0x57, 0xc7, 0xb9, 0x62, 0xb5, 0x28, 0xca, 0x11, 0xec, 0xb4, 0x46, 0x06, 0x73, 0x26, 0xff, 0xfb, 0x66, 0x7d, 0xee, 0x5f, 0xb2, 0x56, 0xfd, 0x2a, 0x08}}}, -{{{0x92, 0x67, 0x77, 0x56, 0xa1, 0xff, 0xc4, 0xc5, 0x95, 0xf0, 0xe3, 0x3a, 0x0a, 0xca, 0x94, 0x4d, 0x9e, 0x7e, 0x3d, 0xb9, 0x6e, 0xb6, 0xb0, 0xce, 0xa4, 0x30, 0x89, 0x99, 0xe9, 0xad, 0x11, 0x59}} , - {{0xf6, 0x48, 0x95, 0xa1, 0x6f, 0x5f, 0xb7, 0xa5, 0xbb, 0x30, 0x00, 0x1c, 0xd2, 0x8a, 0xd6, 0x25, 0x26, 0x1b, 0xb2, 0x0d, 0x37, 0x6a, 0x05, 0xf4, 0x9d, 0x3e, 0x17, 0x2a, 0x43, 0xd2, 0x3a, 0x06}}}, -{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, - {{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, -{{{0x32, 0x99, 0x93, 0xd1, 0x9a, 0x72, 0xf3, 0xa9, 0x16, 0xbd, 0xb4, 0x4c, 0xdd, 0xf9, 0xd4, 0xb2, 0x64, 0x9a, 0xd3, 0x05, 0xe4, 0xa3, 0x73, 0x1c, 0xcb, 0x7e, 0x57, 0x67, 0xff, 0x04, 0xb3, 0x10}} , - {{0xb9, 0x4b, 0xa4, 0xad, 0xd0, 0x6d, 0x61, 0x23, 0xb4, 0xaf, 0x34, 0xa9, 0xaa, 0x65, 0xec, 0xd9, 0x69, 0xe3, 0x85, 0xcd, 0xcc, 0xe7, 0xb0, 0x9b, 0x41, 0xc1, 0x1c, 0xf9, 0xa0, 0xfa, 0xb7, 0x13}}}, -{{{0x04, 0xfd, 0x88, 0x3c, 0x0c, 0xd0, 0x09, 0x52, 0x51, 0x4f, 0x06, 0x19, 0xcc, 0xc3, 0xbb, 0xde, 0x80, 0xc5, 0x33, 0xbc, 0xf9, 0xf3, 0x17, 0x36, 0xdd, 0xc6, 0xde, 0xe8, 0x9b, 0x5d, 0x79, 0x1b}} , - {{0x65, 0x0a, 0xbe, 0x51, 0x57, 0xad, 0x50, 0x79, 0x08, 0x71, 0x9b, 0x07, 0x95, 0x8f, 0xfb, 0xae, 0x4b, 0x38, 0xba, 0xcf, 0x53, 0x2a, 0x86, 0x1e, 0xc0, 0x50, 0x5c, 0x67, 0x1b, 0xf6, 0x87, 0x6c}}}, -{{{0x4f, 0x00, 0xb2, 0x66, 0x55, 0xed, 0x4a, 0xed, 0x8d, 0xe1, 0x66, 0x18, 0xb2, 0x14, 0x74, 0x8d, 0xfd, 0x1a, 0x36, 0x0f, 0x26, 0x5c, 0x8b, 0x89, 0xf3, 0xab, 0xf2, 0xf3, 0x24, 0x67, 0xfd, 0x70}} , - {{0xfd, 0x4e, 0x2a, 0xc1, 0x3a, 0xca, 0x8f, 0x00, 0xd8, 0xec, 0x74, 0x67, 0xef, 0x61, 0xe0, 0x28, 0xd0, 0x96, 0xf4, 0x48, 0xde, 0x81, 0xe3, 0xef, 0xdc, 0xaa, 0x7d, 0xf3, 0xb6, 0x55, 0xa6, 0x65}}}, -{{{0xeb, 0xcb, 0xc5, 0x70, 0x91, 0x31, 0x10, 0x93, 0x0d, 0xc8, 0xd0, 0xef, 0x62, 0xe8, 0x6f, 0x82, 0xe3, 0x69, 0x3d, 0x91, 0x7f, 0x31, 0xe1, 0x26, 0x35, 0x3c, 0x4a, 0x2f, 0xab, 0xc4, 0x9a, 0x5e}} , - {{0xab, 0x1b, 0xb5, 0xe5, 0x2b, 0xc3, 0x0e, 0x29, 0xb0, 0xd0, 0x73, 0xe6, 0x4f, 0x64, 0xf2, 0xbc, 0xe4, 0xe4, 0xe1, 0x9a, 0x52, 0x33, 0x2f, 0xbd, 0xcc, 0x03, 0xee, 0x8a, 0xfa, 0x00, 0x5f, 0x50}}}, -{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, - {{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, -{{{0xf6, 0xdb, 0x0d, 0x22, 0x3d, 0xb5, 0x14, 0x75, 0x31, 0xf0, 0x81, 0xe2, 0xb9, 0x37, 0xa2, 0xa9, 0x84, 0x11, 0x9a, 0x07, 0xb5, 0x53, 0x89, 0x78, 0xa9, 0x30, 0x27, 0xa1, 0xf1, 0x4e, 0x5c, 0x2e}} , - {{0x8b, 0x00, 0x54, 0xfb, 0x4d, 0xdc, 0xcb, 0x17, 0x35, 0x40, 0xff, 0xb7, 0x8c, 0xfe, 0x4a, 0xe4, 0x4e, 0x99, 0x4e, 0xa8, 0x74, 0x54, 0x5d, 0x5c, 0x96, 0xa3, 0x12, 0x55, 0x36, 0x31, 0x17, 0x5c}}}, -{{{0xce, 0x24, 0xef, 0x7b, 0x86, 0xf2, 0x0f, 0x77, 0xe8, 0x5c, 0x7d, 0x87, 0x38, 0x2d, 0xef, 0xaf, 0xf2, 0x8c, 0x72, 0x2e, 0xeb, 0xb6, 0x55, 0x4b, 0x6e, 0xf1, 0x4e, 0x8a, 0x0e, 0x9a, 0x6c, 0x4c}} , - {{0x25, 0xea, 0x86, 0xc2, 0xd1, 0x4f, 0xb7, 0x3e, 0xa8, 0x5c, 0x8d, 0x66, 0x81, 0x25, 0xed, 0xc5, 0x4c, 0x05, 0xb9, 0xd8, 0xd6, 0x70, 0xbe, 0x73, 0x82, 0xe8, 0xa1, 0xe5, 0x1e, 0x71, 0xd5, 0x26}}}, -{{{0x4e, 0x6d, 0xc3, 0xa7, 0x4f, 0x22, 0x45, 0x26, 0xa2, 0x7e, 0x16, 0xf7, 0xf7, 0x63, 0xdc, 0x86, 0x01, 0x2a, 0x71, 0x38, 0x5c, 0x33, 0xc3, 0xce, 0x30, 0xff, 0xf9, 0x2c, 0x91, 0x71, 0x8a, 0x72}} , - {{0x8c, 0x44, 0x09, 0x28, 0xd5, 0x23, 0xc9, 0x8f, 0xf3, 0x84, 0x45, 0xc6, 0x9a, 0x5e, 0xff, 0xd2, 0xc7, 0x57, 0x93, 0xa3, 0xc1, 0x69, 0xdd, 0x62, 0x0f, 0xda, 0x5c, 0x30, 0x59, 0x5d, 0xe9, 0x4c}}}, -{{{0x92, 0x7e, 0x50, 0x27, 0x72, 0xd7, 0x0c, 0xd6, 0x69, 0x96, 0x81, 0x35, 0x84, 0x94, 0x35, 0x8b, 0x6c, 0xaa, 0x62, 0x86, 0x6e, 0x1c, 0x15, 0xf3, 0x6c, 0xb3, 0xff, 0x65, 0x1b, 0xa2, 0x9b, 0x59}} , - {{0xe2, 0xa9, 0x65, 0x88, 0xc4, 0x50, 0xfa, 0xbb, 0x3b, 0x6e, 0x5f, 0x44, 0x01, 0xca, 0x97, 0xd4, 0xdd, 0xf6, 0xcd, 0x3f, 0x3f, 0xe5, 0x97, 0x67, 0x2b, 0x8c, 0x66, 0x0f, 0x35, 0x9b, 0xf5, 0x07}}}, -{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, - {{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, -{{{0xf1, 0x59, 0x27, 0xd8, 0xdb, 0x5a, 0x11, 0x5e, 0x82, 0xf3, 0x38, 0xff, 0x1c, 0xed, 0xfe, 0x3f, 0x64, 0x54, 0x3f, 0x7f, 0xd1, 0x81, 0xed, 0xef, 0x65, 0xc5, 0xcb, 0xfd, 0xe1, 0x80, 0xcd, 0x11}} , - {{0xe0, 0xdb, 0x22, 0x28, 0xe6, 0xff, 0x61, 0x9d, 0x41, 0x14, 0x2d, 0x3b, 0x26, 0x22, 0xdf, 0xf1, 0x34, 0x81, 0xe9, 0x45, 0xee, 0x0f, 0x98, 0x8b, 0xa6, 0x3f, 0xef, 0xf7, 0x43, 0x19, 0xf1, 0x43}}}, -{{{0xee, 0xf3, 0x00, 0xa1, 0x50, 0xde, 0xc0, 0xb6, 0x01, 0xe3, 0x8c, 0x3c, 0x4d, 0x31, 0xd2, 0xb0, 0x58, 0xcd, 0xed, 0x10, 0x4a, 0x7a, 0xef, 0x80, 0xa9, 0x19, 0x32, 0xf3, 0xd8, 0x33, 0x8c, 0x06}} , - {{0xcb, 0x7d, 0x4f, 0xff, 0x30, 0xd8, 0x12, 0x3b, 0x39, 0x1c, 0x06, 0xf9, 0x4c, 0x34, 0x35, 0x71, 0xb5, 0x16, 0x94, 0x67, 0xdf, 0xee, 0x11, 0xde, 0xa4, 0x1d, 0x88, 0x93, 0x35, 0xa9, 0x32, 0x10}}}, -{{{0xe9, 0xc3, 0xbc, 0x7b, 0x5c, 0xfc, 0xb2, 0xf9, 0xc9, 0x2f, 0xe5, 0xba, 0x3a, 0x0b, 0xab, 0x64, 0x38, 0x6f, 0x5b, 0x4b, 0x93, 0xda, 0x64, 0xec, 0x4d, 0x3d, 0xa0, 0xf5, 0xbb, 0xba, 0x47, 0x48}} , - {{0x60, 0xbc, 0x45, 0x1f, 0x23, 0xa2, 0x3b, 0x70, 0x76, 0xe6, 0x97, 0x99, 0x4f, 0x77, 0x54, 0x67, 0x30, 0x9a, 0xe7, 0x66, 0xd6, 0xcd, 0x2e, 0x51, 0x24, 0x2c, 0x42, 0x4a, 0x11, 0xfe, 0x6f, 0x7e}}}, -{{{0x87, 0xc0, 0xb1, 0xf0, 0xa3, 0x6f, 0x0c, 0x93, 0xa9, 0x0a, 0x72, 0xef, 0x5c, 0xbe, 0x65, 0x35, 0xa7, 0x6a, 0x4e, 0x2c, 0xbf, 0x21, 0x23, 0xe8, 0x2f, 0x97, 0xc7, 0x3e, 0xc8, 0x17, 0xac, 0x1e}} , - {{0x7b, 0xef, 0x21, 0xe5, 0x40, 0xcc, 0x1e, 0xdc, 0xd6, 0xbd, 0x97, 0x7a, 0x7c, 0x75, 0x86, 0x7a, 0x25, 0x5a, 0x6e, 0x7c, 0xe5, 0x51, 0x3c, 0x1b, 0x5b, 0x82, 0x9a, 0x07, 0x60, 0xa1, 0x19, 0x04}}}, -{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, - {{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, -{{{0x96, 0x88, 0xa6, 0xab, 0x8f, 0xe3, 0x3a, 0x49, 0xf8, 0xfe, 0x34, 0xe7, 0x6a, 0xb2, 0xfe, 0x40, 0x26, 0x74, 0x57, 0x4c, 0xf6, 0xd4, 0x99, 0xce, 0x5d, 0x7b, 0x2f, 0x67, 0xd6, 0x5a, 0xe4, 0x4e}} , - {{0x5c, 0x82, 0xb3, 0xbd, 0x55, 0x25, 0xf6, 0x6a, 0x93, 0xa4, 0x02, 0xc6, 0x7d, 0x5c, 0xb1, 0x2b, 0x5b, 0xff, 0xfb, 0x56, 0xf8, 0x01, 0x41, 0x90, 0xc6, 0xb6, 0xac, 0x4f, 0xfe, 0xa7, 0x41, 0x70}}}, -{{{0xdb, 0xfa, 0x9b, 0x2c, 0xd4, 0x23, 0x67, 0x2c, 0x8a, 0x63, 0x6c, 0x07, 0x26, 0x48, 0x4f, 0xc2, 0x03, 0xd2, 0x53, 0x20, 0x28, 0xed, 0x65, 0x71, 0x47, 0xa9, 0x16, 0x16, 0x12, 0xbc, 0x28, 0x33}} , - {{0x39, 0xc0, 0xfa, 0xfa, 0xcd, 0x33, 0x43, 0xc7, 0x97, 0x76, 0x9b, 0x93, 0x91, 0x72, 0xeb, 0xc5, 0x18, 0x67, 0x4c, 0x11, 0xf0, 0xf4, 0xe5, 0x73, 0xb2, 0x5c, 0x1b, 0xc2, 0x26, 0x3f, 0xbf, 0x2b}}}, -{{{0x86, 0xe6, 0x8c, 0x1d, 0xdf, 0xca, 0xfc, 0xd5, 0xf8, 0x3a, 0xc3, 0x44, 0x72, 0xe6, 0x78, 0x9d, 0x2b, 0x97, 0xf8, 0x28, 0x45, 0xb4, 0x20, 0xc9, 0x2a, 0x8c, 0x67, 0xaa, 0x11, 0xc5, 0x5b, 0x2f}} , - {{0x17, 0x0f, 0x86, 0x52, 0xd7, 0x9d, 0xc3, 0x44, 0x51, 0x76, 0x32, 0x65, 0xb4, 0x37, 0x81, 0x99, 0x46, 0x37, 0x62, 0xed, 0xcf, 0x64, 0x9d, 0x72, 0x40, 0x7a, 0x4c, 0x0b, 0x76, 0x2a, 0xfb, 0x56}}}, -{{{0x33, 0xa7, 0x90, 0x7c, 0xc3, 0x6f, 0x17, 0xa5, 0xa0, 0x67, 0x72, 0x17, 0xea, 0x7e, 0x63, 0x14, 0x83, 0xde, 0xc1, 0x71, 0x2d, 0x41, 0x32, 0x7a, 0xf3, 0xd1, 0x2b, 0xd8, 0x2a, 0xa6, 0x46, 0x36}} , - {{0xac, 0xcc, 0x6b, 0x7c, 0xf9, 0xb8, 0x8b, 0x08, 0x5c, 0xd0, 0x7d, 0x8f, 0x73, 0xea, 0x20, 0xda, 0x86, 0xca, 0x00, 0xc7, 0xad, 0x73, 0x4d, 0xe9, 0xe8, 0xa9, 0xda, 0x1f, 0x03, 0x06, 0xdd, 0x24}}}, -{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, - {{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, -{{{0x9c, 0xb2, 0x61, 0x0a, 0x98, 0x2a, 0xa5, 0xd7, 0xee, 0xa9, 0xac, 0x65, 0xcb, 0x0a, 0x1e, 0xe2, 0xbe, 0xdc, 0x85, 0x59, 0x0f, 0x9c, 0xa6, 0x57, 0x34, 0xa5, 0x87, 0xeb, 0x7b, 0x1e, 0x0c, 0x3c}} , - {{0x2f, 0xbd, 0x84, 0x63, 0x0d, 0xb5, 0xa0, 0xf0, 0x4b, 0x9e, 0x93, 0xc6, 0x34, 0x9a, 0x34, 0xff, 0x73, 0x19, 0x2f, 0x6e, 0x54, 0x45, 0x2c, 0x92, 0x31, 0x76, 0x34, 0xf1, 0xb2, 0x26, 0xe8, 0x74}}}, -{{{0x0a, 0x67, 0x90, 0x6d, 0x0c, 0x4c, 0xcc, 0xc0, 0xe6, 0xbd, 0xa7, 0x5e, 0x55, 0x8c, 0xcd, 0x58, 0x9b, 0x11, 0xa2, 0xbb, 0x4b, 0xb1, 0x43, 0x04, 0x3c, 0x55, 0xed, 0x23, 0xfe, 0xcd, 0xb1, 0x53}} , - {{0x05, 0xfb, 0x75, 0xf5, 0x01, 0xaf, 0x38, 0x72, 0x58, 0xfc, 0x04, 0x29, 0x34, 0x7a, 0x67, 0xa2, 0x08, 0x50, 0x6e, 0xd0, 0x2b, 0x73, 0xd5, 0xb8, 0xe4, 0x30, 0x96, 0xad, 0x45, 0xdf, 0xa6, 0x5c}}}, -{{{0x0d, 0x88, 0x1a, 0x90, 0x7e, 0xdc, 0xd8, 0xfe, 0xc1, 0x2f, 0x5d, 0x67, 0xee, 0x67, 0x2f, 0xed, 0x6f, 0x55, 0x43, 0x5f, 0x87, 0x14, 0x35, 0x42, 0xd3, 0x75, 0xae, 0xd5, 0xd3, 0x85, 0x1a, 0x76}} , - {{0x87, 0xc8, 0xa0, 0x6e, 0xe1, 0xb0, 0xad, 0x6a, 0x4a, 0x34, 0x71, 0xed, 0x7c, 0xd6, 0x44, 0x03, 0x65, 0x4a, 0x5c, 0x5c, 0x04, 0xf5, 0x24, 0x3f, 0xb0, 0x16, 0x5e, 0x8c, 0xb2, 0xd2, 0xc5, 0x20}}}, -{{{0x98, 0x83, 0xc2, 0x37, 0xa0, 0x41, 0xa8, 0x48, 0x5c, 0x5f, 0xbf, 0xc8, 0xfa, 0x24, 0xe0, 0x59, 0x2c, 0xbd, 0xf6, 0x81, 0x7e, 0x88, 0xe6, 0xca, 0x04, 0xd8, 0x5d, 0x60, 0xbb, 0x74, 0xa7, 0x0b}} , - {{0x21, 0x13, 0x91, 0xbf, 0x77, 0x7a, 0x33, 0xbc, 0xe9, 0x07, 0x39, 0x0a, 0xdd, 0x7d, 0x06, 0x10, 0x9a, 0xee, 0x47, 0x73, 0x1b, 0x15, 0x5a, 0xfb, 0xcd, 0x4d, 0xd0, 0xd2, 0x3a, 0x01, 0xba, 0x54}}}, -{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, - {{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, -{{{0x48, 0xd5, 0x39, 0x4a, 0x0b, 0x20, 0x6a, 0x43, 0xa0, 0x07, 0x82, 0x5e, 0x49, 0x7c, 0xc9, 0x47, 0xf1, 0x7c, 0x37, 0xb9, 0x23, 0xef, 0x6b, 0x46, 0x45, 0x8c, 0x45, 0x76, 0xdf, 0x14, 0x6b, 0x6e}} , - {{0x42, 0xc9, 0xca, 0x29, 0x4c, 0x76, 0x37, 0xda, 0x8a, 0x2d, 0x7c, 0x3a, 0x58, 0xf2, 0x03, 0xb4, 0xb5, 0xb9, 0x1a, 0x13, 0x2d, 0xde, 0x5f, 0x6b, 0x9d, 0xba, 0x52, 0xc9, 0x5d, 0xb3, 0xf3, 0x30}}}, -{{{0x4c, 0x6f, 0xfe, 0x6b, 0x0c, 0x62, 0xd7, 0x48, 0x71, 0xef, 0xb1, 0x85, 0x79, 0xc0, 0xed, 0x24, 0xb1, 0x08, 0x93, 0x76, 0x8e, 0xf7, 0x38, 0x8e, 0xeb, 0xfe, 0x80, 0x40, 0xaf, 0x90, 0x64, 0x49}} , - {{0x4a, 0x88, 0xda, 0xc1, 0x98, 0x44, 0x3c, 0x53, 0x4e, 0xdb, 0x4b, 0xb9, 0x12, 0x5f, 0xcd, 0x08, 0x04, 0xef, 0x75, 0xe7, 0xb1, 0x3a, 0xe5, 0x07, 0xfa, 0xca, 0x65, 0x7b, 0x72, 0x10, 0x64, 0x7f}}}, -{{{0x3d, 0x81, 0xf0, 0xeb, 0x16, 0xfd, 0x58, 0x33, 0x8d, 0x7c, 0x1a, 0xfb, 0x20, 0x2c, 0x8a, 0xee, 0x90, 0xbb, 0x33, 0x6d, 0x45, 0xe9, 0x8e, 0x99, 0x85, 0xe1, 0x08, 0x1f, 0xc5, 0xf1, 0xb5, 0x46}} , - {{0xe4, 0xe7, 0x43, 0x4b, 0xa0, 0x3f, 0x2b, 0x06, 0xba, 0x17, 0xae, 0x3d, 0xe6, 0xce, 0xbd, 0xb8, 0xed, 0x74, 0x11, 0x35, 0xec, 0x96, 0xfe, 0x31, 0xe3, 0x0e, 0x7a, 0x4e, 0xc9, 0x1d, 0xcb, 0x20}}}, -{{{0xe0, 0x67, 0xe9, 0x7b, 0xdb, 0x96, 0x5c, 0xb0, 0x32, 0xd0, 0x59, 0x31, 0x90, 0xdc, 0x92, 0x97, 0xac, 0x09, 0x38, 0x31, 0x0f, 0x7e, 0xd6, 0x5d, 0xd0, 0x06, 0xb6, 0x1f, 0xea, 0xf0, 0x5b, 0x07}} , - {{0x81, 0x9f, 0xc7, 0xde, 0x6b, 0x41, 0x22, 0x35, 0x14, 0x67, 0x77, 0x3e, 0x90, 0x81, 0xb0, 0xd9, 0x85, 0x4c, 0xca, 0x9b, 0x3f, 0x04, 0x59, 0xd6, 0xaa, 0x17, 0xc3, 0x88, 0x34, 0x37, 0xba, 0x43}}}, -{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, - {{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, -{{{0x4c, 0xb6, 0x69, 0xc8, 0x81, 0x95, 0x94, 0x33, 0x92, 0x34, 0xe9, 0x3c, 0x84, 0x0d, 0x3d, 0x5a, 0x37, 0x9c, 0x22, 0xa0, 0xaa, 0x65, 0xce, 0xb4, 0xc2, 0x2d, 0x66, 0x67, 0x02, 0xff, 0x74, 0x10}} , - {{0x22, 0xb0, 0xd5, 0xe6, 0xc7, 0xef, 0xb1, 0xa7, 0x13, 0xda, 0x60, 0xb4, 0x80, 0xc1, 0x42, 0x7d, 0x10, 0x70, 0x97, 0x04, 0x4d, 0xda, 0x23, 0x89, 0xc2, 0x0e, 0x68, 0xcb, 0xde, 0xe0, 0x9b, 0x29}}}, -{{{0x33, 0xfe, 0x42, 0x2a, 0x36, 0x2b, 0x2e, 0x36, 0x64, 0x5c, 0x8b, 0xcc, 0x81, 0x6a, 0x15, 0x08, 0xa1, 0x27, 0xe8, 0x57, 0xe5, 0x78, 0x8e, 0xf2, 0x58, 0x19, 0x12, 0x42, 0xae, 0xc4, 0x63, 0x3e}} , - {{0x78, 0x96, 0x9c, 0xa7, 0xca, 0x80, 0xae, 0x02, 0x85, 0xb1, 0x7c, 0x04, 0x5c, 0xc1, 0x5b, 0x26, 0xc1, 0xba, 0xed, 0xa5, 0x59, 0x70, 0x85, 0x8c, 0x8c, 0xe8, 0x87, 0xac, 0x6a, 0x28, 0x99, 0x35}}}, -{{{0x9f, 0x04, 0x08, 0x28, 0xbe, 0x87, 0xda, 0x80, 0x28, 0x38, 0xde, 0x9f, 0xcd, 0xe4, 0xe3, 0x62, 0xfb, 0x2e, 0x46, 0x8d, 0x01, 0xb3, 0x06, 0x51, 0xd4, 0x19, 0x3b, 0x11, 0xfa, 0xe2, 0xad, 0x1e}} , - {{0xa0, 0x20, 0x99, 0x69, 0x0a, 0xae, 0xa3, 0x70, 0x4e, 0x64, 0x80, 0xb7, 0x85, 0x9c, 0x87, 0x54, 0x43, 0x43, 0x55, 0x80, 0x6d, 0x8d, 0x7c, 0xa9, 0x64, 0xca, 0x6c, 0x2e, 0x21, 0xd8, 0xc8, 0x6c}}}, -{{{0x91, 0x4a, 0x07, 0xad, 0x08, 0x75, 0xc1, 0x4f, 0xa4, 0xb2, 0xc3, 0x6f, 0x46, 0x3e, 0xb1, 0xce, 0x52, 0xab, 0x67, 0x09, 0x54, 0x48, 0x6b, 0x6c, 0xd7, 0x1d, 0x71, 0x76, 0xcb, 0xff, 0xdd, 0x31}} , - {{0x36, 0x88, 0xfa, 0xfd, 0xf0, 0x36, 0x6f, 0x07, 0x74, 0x88, 0x50, 0xd0, 0x95, 0x38, 0x4a, 0x48, 0x2e, 0x07, 0x64, 0x97, 0x11, 0x76, 0x01, 0x1a, 0x27, 0x4d, 0x8e, 0x25, 0x9a, 0x9b, 0x1c, 0x22}}}, -{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, - {{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, -{{{0xbe, 0x57, 0xbd, 0x0e, 0x0f, 0xac, 0x5e, 0x76, 0xa3, 0x71, 0xad, 0x2b, 0x10, 0x45, 0x02, 0xec, 0x59, 0xd5, 0x5d, 0xa9, 0x44, 0xcc, 0x25, 0x4c, 0xb3, 0x3c, 0x5b, 0x69, 0x07, 0x55, 0x26, 0x6b}} , - {{0x30, 0x6b, 0xd4, 0xa7, 0x51, 0x29, 0xe3, 0xf9, 0x7a, 0x75, 0x2a, 0x82, 0x2f, 0xd6, 0x1d, 0x99, 0x2b, 0x80, 0xd5, 0x67, 0x1e, 0x15, 0x9d, 0xca, 0xfd, 0xeb, 0xac, 0x97, 0x35, 0x09, 0x7f, 0x3f}}}, -{{{0x35, 0x0d, 0x34, 0x0a, 0xb8, 0x67, 0x56, 0x29, 0x20, 0xf3, 0x19, 0x5f, 0xe2, 0x83, 0x42, 0x73, 0x53, 0xa8, 0xc5, 0x02, 0x19, 0x33, 0xb4, 0x64, 0xbd, 0xc3, 0x87, 0x8c, 0xd7, 0x76, 0xed, 0x25}} , - {{0x47, 0x39, 0x37, 0x76, 0x0d, 0x1d, 0x0c, 0xf5, 0x5a, 0x6d, 0x43, 0x88, 0x99, 0x15, 0xb4, 0x52, 0x0f, 0x2a, 0xb3, 0xb0, 0x3f, 0xa6, 0xb3, 0x26, 0xb3, 0xc7, 0x45, 0xf5, 0x92, 0x5f, 0x9b, 0x17}}}, -{{{0x9d, 0x23, 0xbd, 0x15, 0xfe, 0x52, 0x52, 0x15, 0x26, 0x79, 0x86, 0xba, 0x06, 0x56, 0x66, 0xbb, 0x8c, 0x2e, 0x10, 0x11, 0xd5, 0x4a, 0x18, 0x52, 0xda, 0x84, 0x44, 0xf0, 0x3e, 0xe9, 0x8c, 0x35}} , - {{0xad, 0xa0, 0x41, 0xec, 0xc8, 0x4d, 0xb9, 0xd2, 0x6e, 0x96, 0x4e, 0x5b, 0xc5, 0xc2, 0xa0, 0x1b, 0xcf, 0x0c, 0xbf, 0x17, 0x66, 0x57, 0xc1, 0x17, 0x90, 0x45, 0x71, 0xc2, 0xe1, 0x24, 0xeb, 0x27}}}, -{{{0x2c, 0xb9, 0x42, 0xa4, 0xaf, 0x3b, 0x42, 0x0e, 0xc2, 0x0f, 0xf2, 0xea, 0x83, 0xaf, 0x9a, 0x13, 0x17, 0xb0, 0xbd, 0x89, 0x17, 0xe3, 0x72, 0xcb, 0x0e, 0x76, 0x7e, 0x41, 0x63, 0x04, 0x88, 0x71}} , - {{0x75, 0x78, 0x38, 0x86, 0x57, 0xdd, 0x9f, 0xee, 0x54, 0x70, 0x65, 0xbf, 0xf1, 0x2c, 0xe0, 0x39, 0x0d, 0xe3, 0x89, 0xfd, 0x8e, 0x93, 0x4f, 0x43, 0xdc, 0xd5, 0x5b, 0xde, 0xf9, 0x98, 0xe5, 0x7b}}}, -{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, - {{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, -{{{0xe7, 0x3b, 0x65, 0x11, 0xdf, 0xb2, 0xf2, 0x63, 0x94, 0x12, 0x6f, 0x5c, 0x9e, 0x77, 0xc1, 0xb6, 0xd8, 0xab, 0x58, 0x7a, 0x1d, 0x95, 0x73, 0xdd, 0xe7, 0xe3, 0x6f, 0xf2, 0x03, 0x1d, 0xdb, 0x76}} , - {{0xae, 0x06, 0x4e, 0x2c, 0x52, 0x1b, 0xbc, 0x5a, 0x5a, 0xa5, 0xbe, 0x27, 0xbd, 0xeb, 0xe1, 0x14, 0x17, 0x68, 0x26, 0x07, 0x03, 0xd1, 0x18, 0x0b, 0xdf, 0xf1, 0x06, 0x5c, 0xa6, 0x1b, 0xb9, 0x24}}}, -{{{0xc5, 0x66, 0x80, 0x13, 0x0e, 0x48, 0x8c, 0x87, 0x31, 0x84, 0xb4, 0x60, 0xed, 0xc5, 0xec, 0xb6, 0xc5, 0x05, 0x33, 0x5f, 0x2f, 0x7d, 0x40, 0xb6, 0x32, 0x1d, 0x38, 0x74, 0x1b, 0xf1, 0x09, 0x3d}} , - {{0xd4, 0x69, 0x82, 0xbc, 0x8d, 0xf8, 0x34, 0x36, 0x75, 0x55, 0x18, 0x55, 0x58, 0x3c, 0x79, 0xaf, 0x26, 0x80, 0xab, 0x9b, 0x95, 0x00, 0xf1, 0xcb, 0xda, 0xc1, 0x9f, 0xf6, 0x2f, 0xa2, 0xf4, 0x45}}}, -{{{0x17, 0xbe, 0xeb, 0x85, 0xed, 0x9e, 0xcd, 0x56, 0xf5, 0x17, 0x45, 0x42, 0xb4, 0x1f, 0x44, 0x4c, 0x05, 0x74, 0x15, 0x47, 0x00, 0xc6, 0x6a, 0x3d, 0x24, 0x09, 0x0d, 0x58, 0xb1, 0x42, 0xd7, 0x04}} , - {{0x8d, 0xbd, 0xa3, 0xc4, 0x06, 0x9b, 0x1f, 0x90, 0x58, 0x60, 0x74, 0xb2, 0x00, 0x3b, 0x3c, 0xd2, 0xda, 0x82, 0xbb, 0x10, 0x90, 0x69, 0x92, 0xa9, 0xb4, 0x30, 0x81, 0xe3, 0x7c, 0xa8, 0x89, 0x45}}}, -{{{0x3f, 0xdc, 0x05, 0xcb, 0x41, 0x3c, 0xc8, 0x23, 0x04, 0x2c, 0x38, 0x99, 0xe3, 0x68, 0x55, 0xf9, 0xd3, 0x32, 0xc7, 0xbf, 0xfa, 0xd4, 0x1b, 0x5d, 0xde, 0xdc, 0x10, 0x42, 0xc0, 0x42, 0xd9, 0x75}} , - {{0x2d, 0xab, 0x35, 0x4e, 0x87, 0xc4, 0x65, 0x97, 0x67, 0x24, 0xa4, 0x47, 0xad, 0x3f, 0x8e, 0xf3, 0xcb, 0x31, 0x17, 0x77, 0xc5, 0xe2, 0xd7, 0x8f, 0x3c, 0xc1, 0xcd, 0x56, 0x48, 0xc1, 0x6c, 0x69}}}, -{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, - {{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, -{{{0x14, 0xae, 0x5f, 0x88, 0x7b, 0xa5, 0x90, 0xdf, 0x10, 0xb2, 0x8b, 0x5e, 0x24, 0x17, 0xc3, 0xa3, 0xd4, 0x0f, 0x92, 0x61, 0x1a, 0x19, 0x5a, 0xad, 0x76, 0xbd, 0xd8, 0x1c, 0xdd, 0xe0, 0x12, 0x6d}} , - {{0x8e, 0xbd, 0x70, 0x8f, 0x02, 0xa3, 0x24, 0x4d, 0x5a, 0x67, 0xc4, 0xda, 0xf7, 0x20, 0x0f, 0x81, 0x5b, 0x7a, 0x05, 0x24, 0x67, 0x83, 0x0b, 0x2a, 0x80, 0xe7, 0xfd, 0x74, 0x4b, 0x9e, 0x5c, 0x0d}}}, -{{{0x94, 0xd5, 0x5f, 0x1f, 0xa2, 0xfb, 0xeb, 0xe1, 0x07, 0x34, 0xf8, 0x20, 0xad, 0x81, 0x30, 0x06, 0x2d, 0xa1, 0x81, 0x95, 0x36, 0xcf, 0x11, 0x0b, 0xaf, 0xc1, 0x2b, 0x9a, 0x6c, 0x55, 0xc1, 0x16}} , - {{0x36, 0x4f, 0xf1, 0x5e, 0x74, 0x35, 0x13, 0x28, 0xd7, 0x11, 0xcf, 0xb8, 0xde, 0x93, 0xb3, 0x05, 0xb8, 0xb5, 0x73, 0xe9, 0xeb, 0xad, 0x19, 0x1e, 0x89, 0x0f, 0x8b, 0x15, 0xd5, 0x8c, 0xe3, 0x23}}}, -{{{0x33, 0x79, 0xe7, 0x18, 0xe6, 0x0f, 0x57, 0x93, 0x15, 0xa0, 0xa7, 0xaa, 0xc4, 0xbf, 0x4f, 0x30, 0x74, 0x95, 0x5e, 0x69, 0x4a, 0x5b, 0x45, 0xe4, 0x00, 0xeb, 0x23, 0x74, 0x4c, 0xdf, 0x6b, 0x45}} , - {{0x97, 0x29, 0x6c, 0xc4, 0x42, 0x0b, 0xdd, 0xc0, 0x29, 0x5c, 0x9b, 0x34, 0x97, 0xd0, 0xc7, 0x79, 0x80, 0x63, 0x74, 0xe4, 0x8e, 0x37, 0xb0, 0x2b, 0x7c, 0xe8, 0x68, 0x6c, 0xc3, 0x82, 0x97, 0x57}}}, -{{{0x22, 0xbe, 0x83, 0xb6, 0x4b, 0x80, 0x6b, 0x43, 0x24, 0x5e, 0xef, 0x99, 0x9b, 0xa8, 0xfc, 0x25, 0x8d, 0x3b, 0x03, 0x94, 0x2b, 0x3e, 0xe7, 0x95, 0x76, 0x9b, 0xcc, 0x15, 0xdb, 0x32, 0xe6, 0x66}} , - {{0x84, 0xf0, 0x4a, 0x13, 0xa6, 0xd6, 0xfa, 0x93, 0x46, 0x07, 0xf6, 0x7e, 0x5c, 0x6d, 0x5e, 0xf6, 0xa6, 0xe7, 0x48, 0xf0, 0x06, 0xea, 0xff, 0x90, 0xc1, 0xcc, 0x4c, 0x19, 0x9c, 0x3c, 0x4e, 0x53}}}, -{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, - {{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, -{{{0x2a, 0x50, 0xe3, 0x07, 0x15, 0x59, 0xf2, 0x8b, 0x81, 0xf2, 0xf3, 0xd3, 0x6c, 0x99, 0x8c, 0x70, 0x67, 0xec, 0xcc, 0xee, 0x9e, 0x59, 0x45, 0x59, 0x7d, 0x47, 0x75, 0x69, 0xf5, 0x24, 0x93, 0x5d}} , - {{0x6a, 0x4f, 0x1b, 0xbe, 0x6b, 0x30, 0xcf, 0x75, 0x46, 0xe3, 0x7b, 0x9d, 0xfc, 0xcd, 0xd8, 0x5c, 0x1f, 0xb4, 0xc8, 0xe2, 0x24, 0xec, 0x1a, 0x28, 0x05, 0x32, 0x57, 0xfd, 0x3c, 0x5a, 0x98, 0x10}}}, -{{{0xa3, 0xdb, 0xf7, 0x30, 0xd8, 0xc2, 0x9a, 0xe1, 0xd3, 0xce, 0x22, 0xe5, 0x80, 0x1e, 0xd9, 0xe4, 0x1f, 0xab, 0xc0, 0x71, 0x1a, 0x86, 0x0e, 0x27, 0x99, 0x5b, 0xfa, 0x76, 0x99, 0xb0, 0x08, 0x3c}} , - {{0x2a, 0x93, 0xd2, 0x85, 0x1b, 0x6a, 0x5d, 0xa6, 0xee, 0xd1, 0xd1, 0x33, 0xbd, 0x6a, 0x36, 0x73, 0x37, 0x3a, 0x44, 0xb4, 0xec, 0xa9, 0x7a, 0xde, 0x83, 0x40, 0xd7, 0xdf, 0x28, 0xba, 0xa2, 0x30}}}, -{{{0xd3, 0xb5, 0x6d, 0x05, 0x3f, 0x9f, 0xf3, 0x15, 0x8d, 0x7c, 0xca, 0xc9, 0xfc, 0x8a, 0x7c, 0x94, 0xb0, 0x63, 0x36, 0x9b, 0x78, 0xd1, 0x91, 0x1f, 0x93, 0xd8, 0x57, 0x43, 0xde, 0x76, 0xa3, 0x43}} , - {{0x9b, 0x35, 0xe2, 0xa9, 0x3d, 0x32, 0x1e, 0xbb, 0x16, 0x28, 0x70, 0xe9, 0x45, 0x2f, 0x8f, 0x70, 0x7f, 0x08, 0x7e, 0x53, 0xc4, 0x7a, 0xbf, 0xf7, 0xe1, 0xa4, 0x6a, 0xd8, 0xac, 0x64, 0x1b, 0x11}}}, -{{{0xb2, 0xeb, 0x47, 0x46, 0x18, 0x3e, 0x1f, 0x99, 0x0c, 0xcc, 0xf1, 0x2c, 0xe0, 0xe7, 0x8f, 0xe0, 0x01, 0x7e, 0x65, 0xb8, 0x0c, 0xd0, 0xfb, 0xc8, 0xb9, 0x90, 0x98, 0x33, 0x61, 0x3b, 0xd8, 0x27}} , - {{0xa0, 0xbe, 0x72, 0x3a, 0x50, 0x4b, 0x74, 0xab, 0x01, 0xc8, 0x93, 0xc5, 0xe4, 0xc7, 0x08, 0x6c, 0xb4, 0xca, 0xee, 0xeb, 0x8e, 0xd7, 0x4e, 0x26, 0xc6, 0x1d, 0xe2, 0x71, 0xaf, 0x89, 0xa0, 0x2a}}}, -{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, - {{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, -{{{0x98, 0x0b, 0xe4, 0xde, 0xdb, 0xa8, 0xfa, 0x82, 0x74, 0x06, 0x52, 0x6d, 0x08, 0x52, 0x8a, 0xff, 0x62, 0xc5, 0x6a, 0x44, 0x0f, 0x51, 0x8c, 0x1f, 0x6e, 0xb6, 0xc6, 0x2c, 0x81, 0xd3, 0x76, 0x46}} , - {{0xf4, 0x29, 0x74, 0x2e, 0x80, 0xa7, 0x1a, 0x8f, 0xf6, 0xbd, 0xd6, 0x8e, 0xbf, 0xc1, 0x95, 0x2a, 0xeb, 0xa0, 0x7f, 0x45, 0xa0, 0x50, 0x14, 0x05, 0xb1, 0x57, 0x4c, 0x74, 0xb7, 0xe2, 0x89, 0x7d}}}, -{{{0x07, 0xee, 0xa7, 0xad, 0xb7, 0x09, 0x0b, 0x49, 0x4e, 0xbf, 0xca, 0xe5, 0x21, 0xe6, 0xe6, 0xaf, 0xd5, 0x67, 0xf3, 0xce, 0x7e, 0x7c, 0x93, 0x7b, 0x5a, 0x10, 0x12, 0x0e, 0x6c, 0x06, 0x11, 0x75}} , - {{0xd5, 0xfc, 0x86, 0xa3, 0x3b, 0xa3, 0x3e, 0x0a, 0xfb, 0x0b, 0xf7, 0x36, 0xb1, 0x5b, 0xda, 0x70, 0xb7, 0x00, 0xa7, 0xda, 0x88, 0x8f, 0x84, 0xa8, 0xbc, 0x1c, 0x39, 0xb8, 0x65, 0xf3, 0x4d, 0x60}}}, -{{{0x96, 0x9d, 0x31, 0xf4, 0xa2, 0xbe, 0x81, 0xb9, 0xa5, 0x59, 0x9e, 0xba, 0x07, 0xbe, 0x74, 0x58, 0xd8, 0xeb, 0xc5, 0x9f, 0x3d, 0xd1, 0xf4, 0xae, 0xce, 0x53, 0xdf, 0x4f, 0xc7, 0x2a, 0x89, 0x4d}} , - {{0x29, 0xd8, 0xf2, 0xaa, 0xe9, 0x0e, 0xf7, 0x2e, 0x5f, 0x9d, 0x8a, 0x5b, 0x09, 0xed, 0xc9, 0x24, 0x22, 0xf4, 0x0f, 0x25, 0x8f, 0x1c, 0x84, 0x6e, 0x34, 0x14, 0x6c, 0xea, 0xb3, 0x86, 0x5d, 0x04}}}, -{{{0x07, 0x98, 0x61, 0xe8, 0x6a, 0xd2, 0x81, 0x49, 0x25, 0xd5, 0x5b, 0x18, 0xc7, 0x35, 0x52, 0x51, 0xa4, 0x46, 0xad, 0x18, 0x0d, 0xc9, 0x5f, 0x18, 0x91, 0x3b, 0xb4, 0xc0, 0x60, 0x59, 0x8d, 0x66}} , - {{0x03, 0x1b, 0x79, 0x53, 0x6e, 0x24, 0xae, 0x57, 0xd9, 0x58, 0x09, 0x85, 0x48, 0xa2, 0xd3, 0xb5, 0xe2, 0x4d, 0x11, 0x82, 0xe6, 0x86, 0x3c, 0xe9, 0xb1, 0x00, 0x19, 0xc2, 0x57, 0xf7, 0x66, 0x7a}}}, -{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, - {{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, -{{{0x0f, 0xe3, 0x89, 0x03, 0xd7, 0x22, 0x95, 0x9f, 0xca, 0xb4, 0x8d, 0x9e, 0x6d, 0x97, 0xff, 0x8d, 0x21, 0x59, 0x07, 0xef, 0x03, 0x2d, 0x5e, 0xf8, 0x44, 0x46, 0xe7, 0x85, 0x80, 0xc5, 0x89, 0x50}} , - {{0x8b, 0xd8, 0x53, 0x86, 0x24, 0x86, 0x29, 0x52, 0x01, 0xfa, 0x20, 0xc3, 0x4e, 0x95, 0xcb, 0xad, 0x7b, 0x34, 0x94, 0x30, 0xb7, 0x7a, 0xfa, 0x96, 0x41, 0x60, 0x2b, 0xcb, 0x59, 0xb9, 0xca, 0x50}}}, -{{{0xc2, 0x5b, 0x9b, 0x78, 0x23, 0x1b, 0x3a, 0x88, 0x94, 0x5f, 0x0a, 0x9b, 0x98, 0x2b, 0x6e, 0x53, 0x11, 0xf6, 0xff, 0xc6, 0x7d, 0x42, 0xcc, 0x02, 0x80, 0x40, 0x0d, 0x1e, 0xfb, 0xaf, 0x61, 0x07}} , - {{0xb0, 0xe6, 0x2f, 0x81, 0x70, 0xa1, 0x2e, 0x39, 0x04, 0x7c, 0xc4, 0x2c, 0x87, 0x45, 0x4a, 0x5b, 0x69, 0x97, 0xac, 0x6d, 0x2c, 0x10, 0x42, 0x7c, 0x3b, 0x15, 0x70, 0x60, 0x0e, 0x11, 0x6d, 0x3a}}}, -{{{0x9b, 0x18, 0x80, 0x5e, 0xdb, 0x05, 0xbd, 0xc6, 0xb7, 0x3c, 0xc2, 0x40, 0x4d, 0x5d, 0xce, 0x97, 0x8a, 0x34, 0x15, 0xab, 0x28, 0x5d, 0x10, 0xf0, 0x37, 0x0c, 0xcc, 0x16, 0xfa, 0x1f, 0x33, 0x0d}} , - {{0x19, 0xf9, 0x35, 0xaa, 0x59, 0x1a, 0x0c, 0x5c, 0x06, 0xfc, 0x6a, 0x0b, 0x97, 0x53, 0x36, 0xfc, 0x2a, 0xa5, 0x5a, 0x9b, 0x30, 0xef, 0x23, 0xaf, 0x39, 0x5d, 0x9a, 0x6b, 0x75, 0x57, 0x48, 0x0b}}}, -{{{0x26, 0xdc, 0x76, 0x3b, 0xfc, 0xf9, 0x9c, 0x3f, 0x89, 0x0b, 0x62, 0x53, 0xaf, 0x83, 0x01, 0x2e, 0xbc, 0x6a, 0xc6, 0x03, 0x0d, 0x75, 0x2a, 0x0d, 0xe6, 0x94, 0x54, 0xcf, 0xb3, 0xe5, 0x96, 0x25}} , - {{0xfe, 0x82, 0xb1, 0x74, 0x31, 0x8a, 0xa7, 0x6f, 0x56, 0xbd, 0x8d, 0xf4, 0xe0, 0x94, 0x51, 0x59, 0xde, 0x2c, 0x5a, 0xf4, 0x84, 0x6b, 0x4a, 0x88, 0x93, 0xc0, 0x0c, 0x9a, 0xac, 0xa7, 0xa0, 0x68}}}, -{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, - {{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, -{{{0x25, 0x0d, 0xd6, 0xc7, 0x23, 0x47, 0x10, 0xad, 0xc7, 0x08, 0x5c, 0x87, 0x87, 0x93, 0x98, 0x18, 0xb8, 0xd3, 0x9c, 0xac, 0x5a, 0x3d, 0xc5, 0x75, 0xf8, 0x49, 0x32, 0x14, 0xcc, 0x51, 0x96, 0x24}} , - {{0x65, 0x9c, 0x5d, 0xf0, 0x37, 0x04, 0xf0, 0x34, 0x69, 0x2a, 0xf0, 0xa5, 0x64, 0xca, 0xde, 0x2b, 0x5b, 0x15, 0x10, 0xd2, 0xab, 0x06, 0xdd, 0xc4, 0xb0, 0xb6, 0x5b, 0xc1, 0x17, 0xdf, 0x8f, 0x02}}}, -{{{0xbd, 0x59, 0x3d, 0xbf, 0x5c, 0x31, 0x44, 0x2c, 0x32, 0x94, 0x04, 0x60, 0x84, 0x0f, 0xad, 0x00, 0xb6, 0x8f, 0xc9, 0x1d, 0xcc, 0x5c, 0xa2, 0x49, 0x0e, 0x50, 0x91, 0x08, 0x9a, 0x43, 0x55, 0x05}} , - {{0x5d, 0x93, 0x55, 0xdf, 0x9b, 0x12, 0x19, 0xec, 0x93, 0x85, 0x42, 0x9e, 0x66, 0x0f, 0x9d, 0xaf, 0x99, 0xaf, 0x26, 0x89, 0xbc, 0x61, 0xfd, 0xff, 0xce, 0x4b, 0xf4, 0x33, 0x95, 0xc9, 0x35, 0x58}}}, -{{{0x12, 0x55, 0xf9, 0xda, 0xcb, 0x44, 0xa7, 0xdc, 0x57, 0xe2, 0xf9, 0x9a, 0xe6, 0x07, 0x23, 0x60, 0x54, 0xa7, 0x39, 0xa5, 0x9b, 0x84, 0x56, 0x6e, 0xaa, 0x8b, 0x8f, 0xb0, 0x2c, 0x87, 0xaf, 0x67}} , - {{0x00, 0xa9, 0x4c, 0xb2, 0x12, 0xf8, 0x32, 0xa8, 0x7a, 0x00, 0x4b, 0x49, 0x32, 0xba, 0x1f, 0x5d, 0x44, 0x8e, 0x44, 0x7a, 0xdc, 0x11, 0xfb, 0x39, 0x08, 0x57, 0x87, 0xa5, 0x12, 0x42, 0x93, 0x0e}}}, -{{{0x17, 0xb4, 0xae, 0x72, 0x59, 0xd0, 0xaa, 0xa8, 0x16, 0x8b, 0x63, 0x11, 0xb3, 0x43, 0x04, 0xda, 0x0c, 0xa8, 0xb7, 0x68, 0xdd, 0x4e, 0x54, 0xe7, 0xaf, 0x5d, 0x5d, 0x05, 0x76, 0x36, 0xec, 0x0d}} , - {{0x6d, 0x7c, 0x82, 0x32, 0x38, 0x55, 0x57, 0x74, 0x5b, 0x7d, 0xc3, 0xc4, 0xfb, 0x06, 0x29, 0xf0, 0x13, 0x55, 0x54, 0xc6, 0xa7, 0xdc, 0x4c, 0x9f, 0x98, 0x49, 0x20, 0xa8, 0xc3, 0x8d, 0xfa, 0x48}}}, -{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, - {{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, -{{{0x87, 0x47, 0x9d, 0xe9, 0x25, 0xd5, 0xe3, 0x47, 0x78, 0xdf, 0x85, 0xa7, 0x85, 0x5e, 0x7a, 0x4c, 0x5f, 0x79, 0x1a, 0xf3, 0xa2, 0xb2, 0x28, 0xa0, 0x9c, 0xdd, 0x30, 0x40, 0xd4, 0x38, 0xbd, 0x28}} , - {{0xfc, 0xbb, 0xd5, 0x78, 0x6d, 0x1d, 0xd4, 0x99, 0xb4, 0xaa, 0x44, 0x44, 0x7a, 0x1b, 0xd8, 0xfe, 0xb4, 0x99, 0xb9, 0xcc, 0xe7, 0xc4, 0xd3, 0x3a, 0x73, 0x83, 0x41, 0x5c, 0x40, 0xd7, 0x2d, 0x55}}}, -{{{0x26, 0xe1, 0x7b, 0x5f, 0xe5, 0xdc, 0x3f, 0x7d, 0xa1, 0xa7, 0x26, 0x44, 0x22, 0x23, 0xc0, 0x8f, 0x7d, 0xf1, 0xb5, 0x11, 0x47, 0x7b, 0x19, 0xd4, 0x75, 0x6f, 0x1e, 0xa5, 0x27, 0xfe, 0xc8, 0x0e}} , - {{0xd3, 0x11, 0x3d, 0xab, 0xef, 0x2c, 0xed, 0xb1, 0x3d, 0x7c, 0x32, 0x81, 0x6b, 0xfe, 0xf8, 0x1c, 0x3c, 0x7b, 0xc0, 0x61, 0xdf, 0xb8, 0x75, 0x76, 0x7f, 0xaa, 0xd8, 0x93, 0xaf, 0x3d, 0xe8, 0x3d}}}, -{{{0xfd, 0x5b, 0x4e, 0x8d, 0xb6, 0x7e, 0x82, 0x9b, 0xef, 0xce, 0x04, 0x69, 0x51, 0x52, 0xff, 0xef, 0xa0, 0x52, 0xb5, 0x79, 0x17, 0x5e, 0x2f, 0xde, 0xd6, 0x3c, 0x2d, 0xa0, 0x43, 0xb4, 0x0b, 0x19}} , - {{0xc0, 0x61, 0x48, 0x48, 0x17, 0xf4, 0x9e, 0x18, 0x51, 0x2d, 0xea, 0x2f, 0xf2, 0xf2, 0xe0, 0xa3, 0x14, 0xb7, 0x8b, 0x3a, 0x30, 0xf5, 0x81, 0xc1, 0x5d, 0x71, 0x39, 0x62, 0x55, 0x1f, 0x60, 0x5a}}}, -{{{0xe5, 0x89, 0x8a, 0x76, 0x6c, 0xdb, 0x4d, 0x0a, 0x5b, 0x72, 0x9d, 0x59, 0x6e, 0x63, 0x63, 0x18, 0x7c, 0xe3, 0xfa, 0xe2, 0xdb, 0xa1, 0x8d, 0xf4, 0xa5, 0xd7, 0x16, 0xb2, 0xd0, 0xb3, 0x3f, 0x39}} , - {{0xce, 0x60, 0x09, 0x6c, 0xf5, 0x76, 0x17, 0x24, 0x80, 0x3a, 0x96, 0xc7, 0x94, 0x2e, 0xf7, 0x6b, 0xef, 0xb5, 0x05, 0x96, 0xef, 0xd3, 0x7b, 0x51, 0xda, 0x05, 0x44, 0x67, 0xbc, 0x07, 0x21, 0x4e}}}, -{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, - {{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, -{{{0xe9, 0x73, 0x6f, 0x21, 0xb9, 0xde, 0x22, 0x7d, 0xeb, 0x97, 0x31, 0x10, 0xa3, 0xea, 0xe1, 0xc6, 0x37, 0xeb, 0x8f, 0x43, 0x58, 0xde, 0x41, 0x64, 0x0e, 0x3e, 0x07, 0x99, 0x3d, 0xf1, 0xdf, 0x1e}} , - {{0xf8, 0xad, 0x43, 0xc2, 0x17, 0x06, 0xe2, 0xe4, 0xa9, 0x86, 0xcd, 0x18, 0xd7, 0x78, 0xc8, 0x74, 0x66, 0xd2, 0x09, 0x18, 0xa5, 0xf1, 0xca, 0xa6, 0x62, 0x92, 0xc1, 0xcb, 0x00, 0xeb, 0x42, 0x2e}}}, -{{{0x7b, 0x34, 0x24, 0x4c, 0xcf, 0x38, 0xe5, 0x6c, 0x0a, 0x01, 0x2c, 0x22, 0x0b, 0x24, 0x38, 0xad, 0x24, 0x7e, 0x19, 0xf0, 0x6c, 0xf9, 0x31, 0xf4, 0x35, 0x11, 0xf6, 0x46, 0x33, 0x3a, 0x23, 0x59}} , - {{0x20, 0x0b, 0xa1, 0x08, 0x19, 0xad, 0x39, 0x54, 0xea, 0x3e, 0x23, 0x09, 0xb6, 0xe2, 0xd2, 0xbc, 0x4d, 0xfc, 0x9c, 0xf0, 0x13, 0x16, 0x22, 0x3f, 0xb9, 0xd2, 0x11, 0x86, 0x90, 0x55, 0xce, 0x3c}}}, -{{{0xc4, 0x0b, 0x4b, 0x62, 0x99, 0x37, 0x84, 0x3f, 0x74, 0xa2, 0xf9, 0xce, 0xe2, 0x0b, 0x0f, 0x2a, 0x3d, 0xa3, 0xe3, 0xdb, 0x5a, 0x9d, 0x93, 0xcc, 0xa5, 0xef, 0x82, 0x91, 0x1d, 0xe6, 0x6c, 0x68}} , - {{0xa3, 0x64, 0x17, 0x9b, 0x8b, 0xc8, 0x3a, 0x61, 0xe6, 0x9d, 0xc6, 0xed, 0x7b, 0x03, 0x52, 0x26, 0x9d, 0x3a, 0xb3, 0x13, 0xcc, 0x8a, 0xfd, 0x2c, 0x1a, 0x1d, 0xed, 0x13, 0xd0, 0x55, 0x57, 0x0e}}}, -{{{0x1a, 0xea, 0xbf, 0xfd, 0x4a, 0x3c, 0x8e, 0xec, 0x29, 0x7e, 0x77, 0x77, 0x12, 0x99, 0xd7, 0x84, 0xf9, 0x55, 0x7f, 0xf1, 0x8b, 0xb4, 0xd2, 0x95, 0xa3, 0x8d, 0xf0, 0x8a, 0xa7, 0xeb, 0x82, 0x4b}} , - {{0x2c, 0x28, 0xf4, 0x3a, 0xf6, 0xde, 0x0a, 0xe0, 0x41, 0x44, 0x23, 0xf8, 0x3f, 0x03, 0x64, 0x9f, 0xc3, 0x55, 0x4c, 0xc6, 0xc1, 0x94, 0x1c, 0x24, 0x5d, 0x5f, 0x92, 0x45, 0x96, 0x57, 0x37, 0x14}}}, -{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, - {{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, -{{{0xc1, 0xcd, 0x90, 0x66, 0xb9, 0x76, 0xa0, 0x5b, 0xa5, 0x85, 0x75, 0x23, 0xf9, 0x89, 0xa5, 0x82, 0xb2, 0x6f, 0xb1, 0xeb, 0xc4, 0x69, 0x6f, 0x18, 0x5a, 0xed, 0x94, 0x3d, 0x9d, 0xd9, 0x2c, 0x1a}} , - {{0x35, 0xb0, 0xe6, 0x73, 0x06, 0xb7, 0x37, 0xe0, 0xf8, 0xb0, 0x22, 0xe8, 0xd2, 0xed, 0x0b, 0xef, 0xe6, 0xc6, 0x5a, 0x99, 0x9e, 0x1a, 0x9f, 0x04, 0x97, 0xe4, 0x4d, 0x0b, 0xbe, 0xba, 0x44, 0x40}}}, -{{{0xc1, 0x56, 0x96, 0x91, 0x5f, 0x1f, 0xbb, 0x54, 0x6f, 0x88, 0x89, 0x0a, 0xb2, 0xd6, 0x41, 0x42, 0x6a, 0x82, 0xee, 0x14, 0xaa, 0x76, 0x30, 0x65, 0x0f, 0x67, 0x39, 0xa6, 0x51, 0x7c, 0x49, 0x24}} , - {{0x35, 0xa3, 0x78, 0xd1, 0x11, 0x0f, 0x75, 0xd3, 0x70, 0x46, 0xdb, 0x20, 0x51, 0xcb, 0x92, 0x80, 0x54, 0x10, 0x74, 0x36, 0x86, 0xa9, 0xd7, 0xa3, 0x08, 0x78, 0xf1, 0x01, 0x29, 0xf8, 0x80, 0x3b}}}, -{{{0xdb, 0xa7, 0x9d, 0x9d, 0xbf, 0xa0, 0xcc, 0xed, 0x53, 0xa2, 0xa2, 0x19, 0x39, 0x48, 0x83, 0x19, 0x37, 0x58, 0xd1, 0x04, 0x28, 0x40, 0xf7, 0x8a, 0xc2, 0x08, 0xb7, 0xa5, 0x42, 0xcf, 0x53, 0x4c}} , - {{0xa7, 0xbb, 0xf6, 0x8e, 0xad, 0xdd, 0xf7, 0x90, 0xdd, 0x5f, 0x93, 0x89, 0xae, 0x04, 0x37, 0xe6, 0x9a, 0xb7, 0xe8, 0xc0, 0xdf, 0x16, 0x2a, 0xbf, 0xc4, 0x3a, 0x3c, 0x41, 0xd5, 0x89, 0x72, 0x5a}}}, -{{{0x1f, 0x96, 0xff, 0x34, 0x2c, 0x13, 0x21, 0xcb, 0x0a, 0x89, 0x85, 0xbe, 0xb3, 0x70, 0x9e, 0x1e, 0xde, 0x97, 0xaf, 0x96, 0x30, 0xf7, 0x48, 0x89, 0x40, 0x8d, 0x07, 0xf1, 0x25, 0xf0, 0x30, 0x58}} , - {{0x1e, 0xd4, 0x93, 0x57, 0xe2, 0x17, 0xe7, 0x9d, 0xab, 0x3c, 0x55, 0x03, 0x82, 0x2f, 0x2b, 0xdb, 0x56, 0x1e, 0x30, 0x2e, 0x24, 0x47, 0x6e, 0xe6, 0xff, 0x33, 0x24, 0x2c, 0x75, 0x51, 0xd4, 0x67}}}, -{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, - {{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, -{{{0x2b, 0x06, 0xd9, 0xa1, 0x5d, 0xe1, 0xf4, 0xd1, 0x1e, 0x3c, 0x9a, 0xc6, 0x29, 0x2b, 0x13, 0x13, 0x78, 0xc0, 0xd8, 0x16, 0x17, 0x2d, 0x9e, 0xa9, 0xc9, 0x79, 0x57, 0xab, 0x24, 0x91, 0x92, 0x19}} , - {{0x69, 0xfb, 0xa1, 0x9c, 0xa6, 0x75, 0x49, 0x7d, 0x60, 0x73, 0x40, 0x42, 0xc4, 0x13, 0x0a, 0x95, 0x79, 0x1e, 0x04, 0x83, 0x94, 0x99, 0x9b, 0x1e, 0x0c, 0xe8, 0x1f, 0x54, 0xef, 0xcb, 0xc0, 0x52}}}, -{{{0x14, 0x89, 0x73, 0xa1, 0x37, 0x87, 0x6a, 0x7a, 0xcf, 0x1d, 0xd9, 0x2e, 0x1a, 0x67, 0xed, 0x74, 0xc0, 0xf0, 0x9c, 0x33, 0xdd, 0xdf, 0x08, 0xbf, 0x7b, 0xd1, 0x66, 0xda, 0xe6, 0xc9, 0x49, 0x08}} , - {{0xe9, 0xdd, 0x5e, 0x55, 0xb0, 0x0a, 0xde, 0x21, 0x4c, 0x5a, 0x2e, 0xd4, 0x80, 0x3a, 0x57, 0x92, 0x7a, 0xf1, 0xc4, 0x2c, 0x40, 0xaf, 0x2f, 0xc9, 0x92, 0x03, 0xe5, 0x5a, 0xbc, 0xdc, 0xf4, 0x09}}}, -{{{0xf3, 0xe1, 0x2b, 0x7c, 0x05, 0x86, 0x80, 0x93, 0x4a, 0xad, 0xb4, 0x8f, 0x7e, 0x99, 0x0c, 0xfd, 0xcd, 0xef, 0xd1, 0xff, 0x2c, 0x69, 0x34, 0x13, 0x41, 0x64, 0xcf, 0x3b, 0xd0, 0x90, 0x09, 0x1e}} , - {{0x9d, 0x45, 0xd6, 0x80, 0xe6, 0x45, 0xaa, 0xf4, 0x15, 0xaa, 0x5c, 0x34, 0x87, 0x99, 0xa2, 0x8c, 0x26, 0x84, 0x62, 0x7d, 0xb6, 0x29, 0xc0, 0x52, 0xea, 0xf5, 0x81, 0x18, 0x0f, 0x35, 0xa9, 0x0e}}}, -{{{0xe7, 0x20, 0x72, 0x7c, 0x6d, 0x94, 0x5f, 0x52, 0x44, 0x54, 0xe3, 0xf1, 0xb2, 0xb0, 0x36, 0x46, 0x0f, 0xae, 0x92, 0xe8, 0x70, 0x9d, 0x6e, 0x79, 0xb1, 0xad, 0x37, 0xa9, 0x5f, 0xc0, 0xde, 0x03}} , - {{0x15, 0x55, 0x37, 0xc6, 0x1c, 0x27, 0x1c, 0x6d, 0x14, 0x4f, 0xca, 0xa4, 0xc4, 0x88, 0x25, 0x46, 0x39, 0xfc, 0x5a, 0xe5, 0xfe, 0x29, 0x11, 0x69, 0xf5, 0x72, 0x84, 0x4d, 0x78, 0x9f, 0x94, 0x15}}}, -{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, - {{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}, -{{{0xec, 0xd3, 0xff, 0x57, 0x0b, 0xb0, 0xb2, 0xdc, 0xf8, 0x4f, 0xe2, 0x12, 0xd5, 0x36, 0xbe, 0x6b, 0x09, 0x43, 0x6d, 0xa3, 0x4d, 0x90, 0x2d, 0xb8, 0x74, 0xe8, 0x71, 0x45, 0x19, 0x8b, 0x0c, 0x6a}} , - {{0xb8, 0x42, 0x1c, 0x03, 0xad, 0x2c, 0x03, 0x8e, 0xac, 0xd7, 0x98, 0x29, 0x13, 0xc6, 0x02, 0x29, 0xb5, 0xd4, 0xe7, 0xcf, 0xcc, 0x8b, 0x83, 0xec, 0x35, 0xc7, 0x9c, 0x74, 0xb7, 0xad, 0x85, 0x5f}}}, -{{{0x78, 0x84, 0xe1, 0x56, 0x45, 0x69, 0x68, 0x5a, 0x4f, 0xb8, 0xb1, 0x29, 0xff, 0x33, 0x03, 0x31, 0xb7, 0xcb, 0x96, 0x25, 0xe6, 0xe6, 0x41, 0x98, 0x1a, 0xbb, 0x03, 0x56, 0xf2, 0xb2, 0x91, 0x34}} , - {{0x2c, 0x6c, 0xf7, 0x66, 0xa4, 0x62, 0x6b, 0x39, 0xb3, 0xba, 0x65, 0xd3, 0x1c, 0xf8, 0x11, 0xaa, 0xbe, 0xdc, 0x80, 0x59, 0x87, 0xf5, 0x7b, 0xe5, 0xe3, 0xb3, 0x3e, 0x39, 0xda, 0xbe, 0x88, 0x09}}}, -{{{0x8b, 0xf1, 0xa0, 0xf5, 0xdc, 0x29, 0xb4, 0xe2, 0x07, 0xc6, 0x7a, 0x00, 0xd0, 0x89, 0x17, 0x51, 0xd4, 0xbb, 0xd4, 0x22, 0xea, 0x7e, 0x7d, 0x7c, 0x24, 0xea, 0xf2, 0xe8, 0x22, 0x12, 0x95, 0x06}} , - {{0xda, 0x7c, 0xa4, 0x0c, 0xf4, 0xba, 0x6e, 0xe1, 0x89, 0xb5, 0x59, 0xca, 0xf1, 0xc0, 0x29, 0x36, 0x09, 0x44, 0xe2, 0x7f, 0xd1, 0x63, 0x15, 0x99, 0xea, 0x25, 0xcf, 0x0c, 0x9d, 0xc0, 0x44, 0x6f}}}, -{{{0x1d, 0x86, 0x4e, 0xcf, 0xf7, 0x37, 0x10, 0x25, 0x8f, 0x12, 0xfb, 0x19, 0xfb, 0xe0, 0xed, 0x10, 0xc8, 0xe2, 0xf5, 0x75, 0xb1, 0x33, 0xc0, 0x96, 0x0d, 0xfb, 0x15, 0x6c, 0x0d, 0x07, 0x5f, 0x05}} , - {{0x69, 0x3e, 0x47, 0x97, 0x2c, 0xaf, 0x52, 0x7c, 0x78, 0x83, 0xad, 0x1b, 0x39, 0x82, 0x2f, 0x02, 0x6f, 0x47, 0xdb, 0x2a, 0xb0, 0xe1, 0x91, 0x99, 0x55, 0xb8, 0x99, 0x3a, 0xa0, 0x44, 0x11, 0x51}}} diff --git a/src/libnacl/crypto_sign/ed25519/ref/implementors b/src/libnacl/crypto_sign/ed25519/ref/implementors deleted file mode 100644 index 9b5399a3..00000000 --- a/src/libnacl/crypto_sign/ed25519/ref/implementors +++ /dev/null @@ -1,5 +0,0 @@ -Daniel J. Bernstein -Niels Duif -Tanja Lange -lead: Peter Schwabe -Bo-Yin Yang diff --git a/src/libnacl/crypto_sign/ed25519/ref/sc25519.c b/src/libnacl/crypto_sign/ed25519/ref/sc25519.c deleted file mode 100644 index 4c304307..00000000 --- a/src/libnacl/crypto_sign/ed25519/ref/sc25519.c +++ /dev/null @@ -1,298 +0,0 @@ -#include "sc25519.h" - -/*Arithmetic modulo the group order m = 2^252 + 27742317777372353535851937790883648493 = 7237005577332262213973186563042994240857116359379907606001950938285454250989 */ - -static const crypto_uint32 m[32] = {0xED, 0xD3, 0xF5, 0x5C, 0x1A, 0x63, 0x12, 0x58, 0xD6, 0x9C, 0xF7, 0xA2, 0xDE, 0xF9, 0xDE, 0x14, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10}; - -static const crypto_uint32 mu[33] = {0x1B, 0x13, 0x2C, 0x0A, 0xA3, 0xE5, 0x9C, 0xED, 0xA7, 0x29, 0x63, 0x08, 0x5D, 0x21, 0x06, 0x21, - 0xEB, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F}; - -static crypto_uint32 lt(crypto_uint32 a,crypto_uint32 b) /* 16-bit inputs */ -{ - unsigned int x = a; - x -= (unsigned int) b; /* 0..65535: no; 4294901761..4294967295: yes */ - x >>= 31; /* 0: no; 1: yes */ - return x; -} - -/* Reduce coefficients of r before calling reduce_add_sub */ -static void reduce_add_sub(sc25519 *r) -{ - crypto_uint32 pb = 0; - crypto_uint32 b; - crypto_uint32 mask; - int i; - unsigned char t[32]; - - for(i=0;i<32;i++) - { - pb += m[i]; - b = lt(r->v[i],pb); - t[i] = r->v[i]-pb+(b<<8); - pb = b; - } - mask = b - 1; - for(i=0;i<32;i++) - r->v[i] ^= mask & (r->v[i] ^ t[i]); -} - -/* Reduce coefficients of x before calling barrett_reduce */ -static void barrett_reduce(sc25519 *r, const crypto_uint32 x[64]) -{ - /* See HAC, Alg. 14.42 */ - int i,j; - crypto_uint32 q2[66]; - crypto_uint32 *q3 = q2 + 33; - crypto_uint32 r1[33]; - crypto_uint32 r2[33]; - crypto_uint32 carry; - crypto_uint32 pb = 0; - crypto_uint32 b; - - for (i = 0;i < 66;++i) q2[i] = 0; - for (i = 0;i < 33;++i) r2[i] = 0; - - for(i=0;i<33;i++) - for(j=0;j<33;j++) - if(i+j >= 31) q2[i+j] += mu[i]*x[j+31]; - carry = q2[31] >> 8; - q2[32] += carry; - carry = q2[32] >> 8; - q2[33] += carry; - - for(i=0;i<33;i++)r1[i] = x[i]; - for(i=0;i<32;i++) - for(j=0;j<33;j++) - if(i+j < 33) r2[i+j] += m[i]*q3[j]; - - for(i=0;i<32;i++) - { - carry = r2[i] >> 8; - r2[i+1] += carry; - r2[i] &= 0xff; - } - - for(i=0;i<32;i++) - { - pb += r2[i]; - b = lt(r1[i],pb); - r->v[i] = r1[i]-pb+(b<<8); - pb = b; - } - - /* XXX: Can it really happen that r<0?, See HAC, Alg 14.42, Step 3 - * If so: Handle it here! - */ - - reduce_add_sub(r); - reduce_add_sub(r); -} - -void sc25519_from32bytes(sc25519 *r, const unsigned char x[32]) -{ - int i; - crypto_uint32 t[64]; - for(i=0;i<32;i++) t[i] = x[i]; - for(i=32;i<64;++i) t[i] = 0; - barrett_reduce(r, t); -} - -void shortsc25519_from16bytes(shortsc25519 *r, const unsigned char x[16]) -{ - int i; - for(i=0;i<16;i++) r->v[i] = x[i]; -} - -void sc25519_from64bytes(sc25519 *r, const unsigned char x[64]) -{ - int i; - crypto_uint32 t[64]; - for(i=0;i<64;i++) t[i] = x[i]; - barrett_reduce(r, t); -} - -void sc25519_from_shortsc(sc25519 *r, const shortsc25519 *x) -{ - int i; - for(i=0;i<16;i++) - r->v[i] = x->v[i]; - for(i=0;i<16;i++) - r->v[16+i] = 0; -} - -void sc25519_to32bytes(unsigned char r[32], const sc25519 *x) -{ - int i; - for(i=0;i<32;i++) r[i] = x->v[i]; -} - -int sc25519_iszero_vartime(const sc25519 *x) -{ - int i; - for(i=0;i<32;i++) - if(x->v[i] != 0) return 0; - return 1; -} - -int sc25519_isshort_vartime(const sc25519 *x) -{ - int i; - for(i=31;i>15;i--) - if(x->v[i] != 0) return 0; - return 1; -} - -int sc25519_lt_vartime(const sc25519 *x, const sc25519 *y) -{ - int i; - for(i=31;i>=0;i--) - { - if(x->v[i] < y->v[i]) return 1; - if(x->v[i] > y->v[i]) return 0; - } - return 0; -} - -void sc25519_add(sc25519 *r, const sc25519 *x, const sc25519 *y) -{ - int i, carry; - for(i=0;i<32;i++) r->v[i] = x->v[i] + y->v[i]; - for(i=0;i<31;i++) - { - carry = r->v[i] >> 8; - r->v[i+1] += carry; - r->v[i] &= 0xff; - } - reduce_add_sub(r); -} - -void sc25519_sub_nored(sc25519 *r, const sc25519 *x, const sc25519 *y) -{ - crypto_uint32 b = 0; - crypto_uint32 t; - int i; - for(i=0;i<32;i++) - { - t = x->v[i] - y->v[i] - b; - r->v[i] = t & 255; - b = (t >> 8) & 1; - } -} - -void sc25519_mul(sc25519 *r, const sc25519 *x, const sc25519 *y) -{ - int i,j,carry; - crypto_uint32 t[64]; - for(i=0;i<64;i++)t[i] = 0; - - for(i=0;i<32;i++) - for(j=0;j<32;j++) - t[i+j] += x->v[i] * y->v[j]; - - /* Reduce coefficients */ - for(i=0;i<63;i++) - { - carry = t[i] >> 8; - t[i+1] += carry; - t[i] &= 0xff; - } - - barrett_reduce(r, t); -} - -void sc25519_mul_shortsc(sc25519 *r, const sc25519 *x, const shortsc25519 *y) -{ - sc25519 t; - sc25519_from_shortsc(&t, y); - sc25519_mul(r, x, &t); -} - -void sc25519_window3(signed char r[85], const sc25519 *s) -{ - char carry; - int i; - for(i=0;i<10;i++) - { - r[8*i+0] = s->v[3*i+0] & 7; - r[8*i+1] = (s->v[3*i+0] >> 3) & 7; - r[8*i+2] = (s->v[3*i+0] >> 6) & 7; - r[8*i+2] ^= (s->v[3*i+1] << 2) & 7; - r[8*i+3] = (s->v[3*i+1] >> 1) & 7; - r[8*i+4] = (s->v[3*i+1] >> 4) & 7; - r[8*i+5] = (s->v[3*i+1] >> 7) & 7; - r[8*i+5] ^= (s->v[3*i+2] << 1) & 7; - r[8*i+6] = (s->v[3*i+2] >> 2) & 7; - r[8*i+7] = (s->v[3*i+2] >> 5) & 7; - } - r[8*i+0] = s->v[3*i+0] & 7; - r[8*i+1] = (s->v[3*i+0] >> 3) & 7; - r[8*i+2] = (s->v[3*i+0] >> 6) & 7; - r[8*i+2] ^= (s->v[3*i+1] << 2) & 7; - r[8*i+3] = (s->v[3*i+1] >> 1) & 7; - r[8*i+4] = (s->v[3*i+1] >> 4) & 7; - - /* Making it signed */ - carry = 0; - for(i=0;i<84;i++) - { - r[i] += carry; - r[i+1] += r[i] >> 3; - r[i] &= 7; - carry = r[i] >> 2; - r[i] -= carry<<3; - } - r[84] += carry; -} - -void sc25519_window5(signed char r[51], const sc25519 *s) -{ - char carry; - int i; - for(i=0;i<6;i++) - { - r[8*i+0] = s->v[5*i+0] & 31; - r[8*i+1] = (s->v[5*i+0] >> 5) & 31; - r[8*i+1] ^= (s->v[5*i+1] << 3) & 31; - r[8*i+2] = (s->v[5*i+1] >> 2) & 31; - r[8*i+3] = (s->v[5*i+1] >> 7) & 31; - r[8*i+3] ^= (s->v[5*i+2] << 1) & 31; - r[8*i+4] = (s->v[5*i+2] >> 4) & 31; - r[8*i+4] ^= (s->v[5*i+3] << 4) & 31; - r[8*i+5] = (s->v[5*i+3] >> 1) & 31; - r[8*i+6] = (s->v[5*i+3] >> 6) & 31; - r[8*i+6] ^= (s->v[5*i+4] << 2) & 31; - r[8*i+7] = (s->v[5*i+4] >> 3) & 31; - } - r[8*i+0] = s->v[5*i+0] & 31; - r[8*i+1] = (s->v[5*i+0] >> 5) & 31; - r[8*i+1] ^= (s->v[5*i+1] << 3) & 31; - r[8*i+2] = (s->v[5*i+1] >> 2) & 31; - - /* Making it signed */ - carry = 0; - for(i=0;i<50;i++) - { - r[i] += carry; - r[i+1] += r[i] >> 5; - r[i] &= 31; - carry = r[i] >> 4; - r[i] -= carry<<5; - } - r[50] += carry; -} - -void sc25519_2interleave2(unsigned char r[127], const sc25519 *s1, const sc25519 *s2) -{ - int i; - for(i=0;i<31;i++) - { - r[4*i] = ( s1->v[i] & 3) ^ (( s2->v[i] & 3) << 2); - r[4*i+1] = ((s1->v[i] >> 2) & 3) ^ (((s2->v[i] >> 2) & 3) << 2); - r[4*i+2] = ((s1->v[i] >> 4) & 3) ^ (((s2->v[i] >> 4) & 3) << 2); - r[4*i+3] = ((s1->v[i] >> 6) & 3) ^ (((s2->v[i] >> 6) & 3) << 2); - } - r[124] = ( s1->v[31] & 3) ^ (( s2->v[31] & 3) << 2); - r[125] = ((s1->v[31] >> 2) & 3) ^ (((s2->v[31] >> 2) & 3) << 2); - r[126] = ((s1->v[31] >> 4) & 3) ^ (((s2->v[31] >> 4) & 3) << 2); -} diff --git a/src/libnacl/crypto_sign/ed25519/ref/sc25519.h b/src/libnacl/crypto_sign/ed25519/ref/sc25519.h deleted file mode 100644 index 29622ef0..00000000 --- a/src/libnacl/crypto_sign/ed25519/ref/sc25519.h +++ /dev/null @@ -1,72 +0,0 @@ -#ifndef SC25519_H -#define SC25519_H - -#include "crypto_uint32.h" - -#define sc25519 crypto_sign_ed25519_ref_sc25519 -#define shortsc25519 crypto_sign_ed25519_ref_shortsc25519 -#define sc25519_from32bytes crypto_sign_ed25519_ref_sc25519_from32bytes -#define shortsc25519_from16bytes crypto_sign_ed25519_ref_shortsc25519_from16bytes -#define sc25519_from64bytes crypto_sign_ed25519_ref_sc25519_from64bytes -#define sc25519_from_shortsc crypto_sign_ed25519_ref_sc25519_from_shortsc -#define sc25519_to32bytes crypto_sign_ed25519_ref_sc25519_to32bytes -#define sc25519_iszero_vartime crypto_sign_ed25519_ref_sc25519_iszero_vartime -#define sc25519_isshort_vartime crypto_sign_ed25519_ref_sc25519_isshort_vartime -#define sc25519_lt_vartime crypto_sign_ed25519_ref_sc25519_lt_vartime -#define sc25519_add crypto_sign_ed25519_ref_sc25519_add -#define sc25519_sub_nored crypto_sign_ed25519_ref_sc25519_sub_nored -#define sc25519_mul crypto_sign_ed25519_ref_sc25519_mul -#define sc25519_mul_shortsc crypto_sign_ed25519_ref_sc25519_mul_shortsc -#define sc25519_window3 crypto_sign_ed25519_ref_sc25519_window3 -#define sc25519_window5 crypto_sign_ed25519_ref_sc25519_window5 -#define sc25519_2interleave2 crypto_sign_ed25519_ref_sc25519_2interleave2 - -typedef struct -{ - crypto_uint32 v[32]; -} -sc25519; - -typedef struct -{ - crypto_uint32 v[16]; -} -shortsc25519; - -void sc25519_from32bytes(sc25519 *r, const unsigned char x[32]); - -void shortsc25519_from16bytes(shortsc25519 *r, const unsigned char x[16]); - -void sc25519_from64bytes(sc25519 *r, const unsigned char x[64]); - -void sc25519_from_shortsc(sc25519 *r, const shortsc25519 *x); - -void sc25519_to32bytes(unsigned char r[32], const sc25519 *x); - -int sc25519_iszero_vartime(const sc25519 *x); - -int sc25519_isshort_vartime(const sc25519 *x); - -int sc25519_lt_vartime(const sc25519 *x, const sc25519 *y); - -void sc25519_add(sc25519 *r, const sc25519 *x, const sc25519 *y); - -void sc25519_sub_nored(sc25519 *r, const sc25519 *x, const sc25519 *y); - -void sc25519_mul(sc25519 *r, const sc25519 *x, const sc25519 *y); - -void sc25519_mul_shortsc(sc25519 *r, const sc25519 *x, const shortsc25519 *y); - -/* Convert s into a representation of the form \sum_{i=0}^{84}r[i]2^3 - * with r[i] in {-4,...,3} - */ -void sc25519_window3(signed char r[85], const sc25519 *s); - -/* Convert s into a representation of the form \sum_{i=0}^{50}r[i]2^5 - * with r[i] in {-16,...,15} - */ -void sc25519_window5(signed char r[51], const sc25519 *s); - -void sc25519_2interleave2(unsigned char r[127], const sc25519 *s1, const sc25519 *s2); - -#endif diff --git a/src/libnacl/crypto_sign/ed25519/selected b/src/libnacl/crypto_sign/ed25519/selected deleted file mode 100644 index e69de29b..00000000 diff --git a/src/libnacl/crypto_sign/ed25519/used b/src/libnacl/crypto_sign/ed25519/used deleted file mode 100644 index e69de29b..00000000 diff --git a/src/libnacl/crypto_sign/edwards25519sha512batch/ref/api.h b/src/libnacl/crypto_sign/edwards25519sha512batch/ref/api.h deleted file mode 100644 index 352240c0..00000000 --- a/src/libnacl/crypto_sign/edwards25519sha512batch/ref/api.h +++ /dev/null @@ -1,3 +0,0 @@ -#define CRYPTO_SECRETKEYBYTES 64 -#define CRYPTO_PUBLICKEYBYTES 32 -#define CRYPTO_BYTES 64 diff --git a/src/libnacl/crypto_sign/edwards25519sha512batch/ref/fe25519.c b/src/libnacl/crypto_sign/edwards25519sha512batch/ref/fe25519.c deleted file mode 100644 index 276b514d..00000000 --- a/src/libnacl/crypto_sign/edwards25519sha512batch/ref/fe25519.c +++ /dev/null @@ -1,345 +0,0 @@ -#include "fe25519.h" - -#define WINDOWSIZE 4 /* Should be 1,2, or 4 */ -#define WINDOWMASK ((1<v[31] >> 7; - r->v[31] &= 127; - t *= 19; - r->v[0] += t; - for(i=0;i<31;i++) - { - t = r->v[i] >> 8; - r->v[i+1] += t; - r->v[i] &= 255; - } - } -} - -static void reduce_mul(fe25519 *r) -{ - crypto_uint32 t; - int i,rep; - - for(rep=0;rep<2;rep++) - { - t = r->v[31] >> 7; - r->v[31] &= 127; - t *= 19; - r->v[0] += t; - for(i=0;i<31;i++) - { - t = r->v[i] >> 8; - r->v[i+1] += t; - r->v[i] &= 255; - } - } -} - -/* reduction modulo 2^255-19 */ -static void freeze(fe25519 *r) -{ - int i; - unsigned int m = (r->v[31] == 127); - for(i=30;i>1;i--) - m *= (r->v[i] == 255); - m *= (r->v[0] >= 237); - - r->v[31] -= m*127; - for(i=30;i>0;i--) - r->v[i] -= m*255; - r->v[0] -= m*237; -} - -/*freeze input before calling isone*/ -static int isone(const fe25519 *x) -{ - int i; - int r = (x->v[0] == 1); - for(i=1;i<32;i++) - r *= (x->v[i] == 0); - return r; -} - -/*freeze input before calling iszero*/ -static int iszero(const fe25519 *x) -{ - int i; - int r = (x->v[0] == 0); - for(i=1;i<32;i++) - r *= (x->v[i] == 0); - return r; -} - - -static int issquare(const fe25519 *x) -{ - unsigned char e[32] = {0xf6,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3f}; /* (p-1)/2 */ - fe25519 t; - - fe25519_pow(&t,x,e); - freeze(&t); - return isone(&t) || iszero(&t); -} - -void fe25519_unpack(fe25519 *r, const unsigned char x[32]) -{ - int i; - for(i=0;i<32;i++) r->v[i] = x[i]; - r->v[31] &= 127; -} - -/* Assumes input x being reduced mod 2^255 */ -void fe25519_pack(unsigned char r[32], const fe25519 *x) -{ - int i; - for(i=0;i<32;i++) - r[i] = x->v[i]; - - /* freeze byte array */ - unsigned int m = (r[31] == 127); /* XXX: some compilers might use branches; fix */ - for(i=30;i>1;i--) - m *= (r[i] == 255); - m *= (r[0] >= 237); - r[31] -= m*127; - for(i=30;i>0;i--) - r[i] -= m*255; - r[0] -= m*237; -} - -void fe25519_cmov(fe25519 *r, const fe25519 *x, unsigned char b) -{ - unsigned char nb = 1-b; - int i; - for(i=0;i<32;i++) r->v[i] = nb * r->v[i] + b * x->v[i]; -} - -unsigned char fe25519_getparity(const fe25519 *x) -{ - fe25519 t; - int i; - for(i=0;i<32;i++) t.v[i] = x->v[i]; - freeze(&t); - return t.v[0] & 1; -} - -void fe25519_setone(fe25519 *r) -{ - int i; - r->v[0] = 1; - for(i=1;i<32;i++) r->v[i]=0; -} - -void fe25519_setzero(fe25519 *r) -{ - int i; - for(i=0;i<32;i++) r->v[i]=0; -} - -void fe25519_neg(fe25519 *r, const fe25519 *x) -{ - fe25519 t; - int i; - for(i=0;i<32;i++) t.v[i]=x->v[i]; - fe25519_setzero(r); - fe25519_sub(r, r, &t); -} - -void fe25519_add(fe25519 *r, const fe25519 *x, const fe25519 *y) -{ - int i; - for(i=0;i<32;i++) r->v[i] = x->v[i] + y->v[i]; - reduce_add_sub(r); -} - -void fe25519_sub(fe25519 *r, const fe25519 *x, const fe25519 *y) -{ - int i; - crypto_uint32 t[32]; - t[0] = x->v[0] + 0x1da; - t[31] = x->v[31] + 0xfe; - for(i=1;i<31;i++) t[i] = x->v[i] + 0x1fe; - for(i=0;i<32;i++) r->v[i] = t[i] - y->v[i]; - reduce_add_sub(r); -} - -void fe25519_mul(fe25519 *r, const fe25519 *x, const fe25519 *y) -{ - int i,j; - crypto_uint32 t[63]; - for(i=0;i<63;i++)t[i] = 0; - - for(i=0;i<32;i++) - for(j=0;j<32;j++) - t[i+j] += x->v[i] * y->v[j]; - - for(i=32;i<63;i++) - r->v[i-32] = t[i-32] + 38*t[i]; - r->v[31] = t[31]; /* result now in r[0]...r[31] */ - - reduce_mul(r); -} - -void fe25519_square(fe25519 *r, const fe25519 *x) -{ - fe25519_mul(r, x, x); -} - -/*XXX: Make constant time! */ -void fe25519_pow(fe25519 *r, const fe25519 *x, const unsigned char *e) -{ - /* - fe25519 g; - fe25519_setone(&g); - int i; - unsigned char j; - for(i=32;i>0;i--) - { - for(j=128;j>0;j>>=1) - { - fe25519_square(&g,&g); - if(e[i-1] & j) - fe25519_mul(&g,&g,x); - } - } - for(i=0;i<32;i++) r->v[i] = g.v[i]; - */ - fe25519 g; - fe25519_setone(&g); - int i,j,k; - fe25519 pre[(1 << WINDOWSIZE)]; - fe25519 t; - unsigned char w; - - // Precomputation - fe25519_setone(pre); - pre[1] = *x; - for(i=2;i<(1<0;i--) - { - for(j=8-WINDOWSIZE;j>=0;j-=WINDOWSIZE) - { - for(k=0;k>j) & WINDOWMASK; - t = pre[0]; - for(k=1;k<(1<v[i]; - fe25519_pow(&d,&d,e3); - for(i=0;i<32;i++) - r->v[i] = 2*x->v[i]; - fe25519_mul(r,r,&d); - } - freeze(r); - if((r->v[0] & 1) != (parity & 1)) - { - fe25519_sub(r,&p,r); - } - return 0; -} - -void fe25519_invert(fe25519 *r, const fe25519 *x) -{ - fe25519 z2; - fe25519 z9; - fe25519 z11; - fe25519 z2_5_0; - fe25519 z2_10_0; - fe25519 z2_20_0; - fe25519 z2_50_0; - fe25519 z2_100_0; - fe25519 t0; - fe25519 t1; - int i; - - /* 2 */ fe25519_square(&z2,x); - /* 4 */ fe25519_square(&t1,&z2); - /* 8 */ fe25519_square(&t0,&t1); - /* 9 */ fe25519_mul(&z9,&t0,x); - /* 11 */ fe25519_mul(&z11,&z9,&z2); - /* 22 */ fe25519_square(&t0,&z11); - /* 2^5 - 2^0 = 31 */ fe25519_mul(&z2_5_0,&t0,&z9); - - /* 2^6 - 2^1 */ fe25519_square(&t0,&z2_5_0); - /* 2^7 - 2^2 */ fe25519_square(&t1,&t0); - /* 2^8 - 2^3 */ fe25519_square(&t0,&t1); - /* 2^9 - 2^4 */ fe25519_square(&t1,&t0); - /* 2^10 - 2^5 */ fe25519_square(&t0,&t1); - /* 2^10 - 2^0 */ fe25519_mul(&z2_10_0,&t0,&z2_5_0); - - /* 2^11 - 2^1 */ fe25519_square(&t0,&z2_10_0); - /* 2^12 - 2^2 */ fe25519_square(&t1,&t0); - /* 2^20 - 2^10 */ for (i = 2;i < 10;i += 2) { fe25519_square(&t0,&t1); fe25519_square(&t1,&t0); } - /* 2^20 - 2^0 */ fe25519_mul(&z2_20_0,&t1,&z2_10_0); - - /* 2^21 - 2^1 */ fe25519_square(&t0,&z2_20_0); - /* 2^22 - 2^2 */ fe25519_square(&t1,&t0); - /* 2^40 - 2^20 */ for (i = 2;i < 20;i += 2) { fe25519_square(&t0,&t1); fe25519_square(&t1,&t0); } - /* 2^40 - 2^0 */ fe25519_mul(&t0,&t1,&z2_20_0); - - /* 2^41 - 2^1 */ fe25519_square(&t1,&t0); - /* 2^42 - 2^2 */ fe25519_square(&t0,&t1); - /* 2^50 - 2^10 */ for (i = 2;i < 10;i += 2) { fe25519_square(&t1,&t0); fe25519_square(&t0,&t1); } - /* 2^50 - 2^0 */ fe25519_mul(&z2_50_0,&t0,&z2_10_0); - - /* 2^51 - 2^1 */ fe25519_square(&t0,&z2_50_0); - /* 2^52 - 2^2 */ fe25519_square(&t1,&t0); - /* 2^100 - 2^50 */ for (i = 2;i < 50;i += 2) { fe25519_square(&t0,&t1); fe25519_square(&t1,&t0); } - /* 2^100 - 2^0 */ fe25519_mul(&z2_100_0,&t1,&z2_50_0); - - /* 2^101 - 2^1 */ fe25519_square(&t1,&z2_100_0); - /* 2^102 - 2^2 */ fe25519_square(&t0,&t1); - /* 2^200 - 2^100 */ for (i = 2;i < 100;i += 2) { fe25519_square(&t1,&t0); fe25519_square(&t0,&t1); } - /* 2^200 - 2^0 */ fe25519_mul(&t1,&t0,&z2_100_0); - - /* 2^201 - 2^1 */ fe25519_square(&t0,&t1); - /* 2^202 - 2^2 */ fe25519_square(&t1,&t0); - /* 2^250 - 2^50 */ for (i = 2;i < 50;i += 2) { fe25519_square(&t0,&t1); fe25519_square(&t1,&t0); } - /* 2^250 - 2^0 */ fe25519_mul(&t0,&t1,&z2_50_0); - - /* 2^251 - 2^1 */ fe25519_square(&t1,&t0); - /* 2^252 - 2^2 */ fe25519_square(&t0,&t1); - /* 2^253 - 2^3 */ fe25519_square(&t1,&t0); - /* 2^254 - 2^4 */ fe25519_square(&t0,&t1); - /* 2^255 - 2^5 */ fe25519_square(&t1,&t0); - /* 2^255 - 21 */ fe25519_mul(r,&t1,&z11); -} diff --git a/src/libnacl/crypto_sign/edwards25519sha512batch/ref/fe25519.h b/src/libnacl/crypto_sign/edwards25519sha512batch/ref/fe25519.h deleted file mode 100644 index 98c613fa..00000000 --- a/src/libnacl/crypto_sign/edwards25519sha512batch/ref/fe25519.h +++ /dev/null @@ -1,54 +0,0 @@ -#ifndef FE25519_H -#define FE25519_H - -#define fe25519 crypto_sign_edwards25519sha512batch_fe25519 -#define fe25519_unpack crypto_sign_edwards25519sha512batch_fe25519_unpack -#define fe25519_pack crypto_sign_edwards25519sha512batch_fe25519_pack -#define fe25519_cmov crypto_sign_edwards25519sha512batch_fe25519_cmov -#define fe25519_setone crypto_sign_edwards25519sha512batch_fe25519_setone -#define fe25519_setzero crypto_sign_edwards25519sha512batch_fe25519_setzero -#define fe25519_neg crypto_sign_edwards25519sha512batch_fe25519_neg -#define fe25519_getparity crypto_sign_edwards25519sha512batch_fe25519_getparity -#define fe25519_add crypto_sign_edwards25519sha512batch_fe25519_add -#define fe25519_sub crypto_sign_edwards25519sha512batch_fe25519_sub -#define fe25519_mul crypto_sign_edwards25519sha512batch_fe25519_mul -#define fe25519_square crypto_sign_edwards25519sha512batch_fe25519_square -#define fe25519_pow crypto_sign_edwards25519sha512batch_fe25519_pow -#define fe25519_sqrt_vartime crypto_sign_edwards25519sha512batch_fe25519_sqrt_vartime -#define fe25519_invert crypto_sign_edwards25519sha512batch_fe25519_invert - -#include "crypto_uint32.h" - -typedef struct { - crypto_uint32 v[32]; -} fe25519; - -void fe25519_unpack(fe25519 *r, const unsigned char x[32]); - -void fe25519_pack(unsigned char r[32], const fe25519 *x); - -void fe25519_cmov(fe25519 *r, const fe25519 *x, unsigned char b); - -void fe25519_setone(fe25519 *r); - -void fe25519_setzero(fe25519 *r); - -void fe25519_neg(fe25519 *r, const fe25519 *x); - -unsigned char fe25519_getparity(const fe25519 *x); - -void fe25519_add(fe25519 *r, const fe25519 *x, const fe25519 *y); - -void fe25519_sub(fe25519 *r, const fe25519 *x, const fe25519 *y); - -void fe25519_mul(fe25519 *r, const fe25519 *x, const fe25519 *y); - -void fe25519_square(fe25519 *r, const fe25519 *x); - -void fe25519_pow(fe25519 *r, const fe25519 *x, const unsigned char *e); - -int fe25519_sqrt_vartime(fe25519 *r, const fe25519 *x, unsigned char parity); - -void fe25519_invert(fe25519 *r, const fe25519 *x); - -#endif diff --git a/src/libnacl/crypto_sign/edwards25519sha512batch/ref/ge25519.c b/src/libnacl/crypto_sign/edwards25519sha512batch/ref/ge25519.c deleted file mode 100644 index 917798ac..00000000 --- a/src/libnacl/crypto_sign/edwards25519sha512batch/ref/ge25519.c +++ /dev/null @@ -1,227 +0,0 @@ -#include "fe25519.h" -#include "sc25519.h" -#include "ge25519.h" - -/* - * Arithmetic on the twisted Edwards curve -x^2 + y^2 = 1 + dx^2y^2 - * with d = -(121665/121666) = 37095705934669439343138083508754565189542113879843219016388785533085940283555 - * Base point: (15112221349535400772501151409588531511454012693041857206046113283949847762202,46316835694926478169428394003475163141307993866256225615783033603165251855960); - */ - -typedef struct -{ - fe25519 x; - fe25519 z; - fe25519 y; - fe25519 t; -} ge25519_p1p1; - -typedef struct -{ - fe25519 x; - fe25519 y; - fe25519 z; -} ge25519_p2; - -#define ge25519_p3 ge25519 - -/* Windowsize for fixed-window scalar multiplication */ -#define WINDOWSIZE 2 /* Should be 1,2, or 4 */ -#define WINDOWMASK ((1<x, &p->x, &p->t); - fe25519_mul(&r->y, &p->y, &p->z); - fe25519_mul(&r->z, &p->z, &p->t); -} - -static void p1p1_to_p3(ge25519_p3 *r, const ge25519_p1p1 *p) -{ - p1p1_to_p2((ge25519_p2 *)r, p); - fe25519_mul(&r->t, &p->x, &p->y); -} - -/* Constant-time version of: if(b) r = p */ -static void cmov_p3(ge25519_p3 *r, const ge25519_p3 *p, unsigned char b) -{ - fe25519_cmov(&r->x, &p->x, b); - fe25519_cmov(&r->y, &p->y, b); - fe25519_cmov(&r->z, &p->z, b); - fe25519_cmov(&r->t, &p->t, b); -} - -/* See http://www.hyperelliptic.org/EFD/g1p/auto-twisted-extended-1.html#doubling-dbl-2008-hwcd */ -static void dbl_p1p1(ge25519_p1p1 *r, const ge25519_p2 *p) -{ - fe25519 a,b,c,d; - fe25519_square(&a, &p->x); - fe25519_square(&b, &p->y); - fe25519_square(&c, &p->z); - fe25519_add(&c, &c, &c); - fe25519_neg(&d, &a); - - fe25519_add(&r->x, &p->x, &p->y); - fe25519_square(&r->x, &r->x); - fe25519_sub(&r->x, &r->x, &a); - fe25519_sub(&r->x, &r->x, &b); - fe25519_add(&r->z, &d, &b); - fe25519_sub(&r->t, &r->z, &c); - fe25519_sub(&r->y, &d, &b); -} - -static void add_p1p1(ge25519_p1p1 *r, const ge25519_p3 *p, const ge25519_p3 *q) -{ - fe25519 a, b, c, d, t, fd; - fe25519_unpack(&fd, ecd); - - fe25519_sub(&a, &p->y, &p->x); // A = (Y1-X1)*(Y2-X2) - fe25519_sub(&t, &q->y, &q->x); - fe25519_mul(&a, &a, &t); - fe25519_add(&b, &p->x, &p->y); // B = (Y1+X1)*(Y2+X2) - fe25519_add(&t, &q->x, &q->y); - fe25519_mul(&b, &b, &t); - fe25519_mul(&c, &p->t, &q->t); //C = T1*k*T2 - fe25519_mul(&c, &c, &fd); - fe25519_add(&c, &c, &c); //XXX: Can save this addition by precomputing 2*ecd - fe25519_mul(&d, &p->z, &q->z); //D = Z1*2*Z2 - fe25519_add(&d, &d, &d); - fe25519_sub(&r->x, &b, &a); // E = B-A - fe25519_sub(&r->t, &d, &c); // F = D-C - fe25519_add(&r->z, &d, &c); // G = D+C - fe25519_add(&r->y, &b, &a); // H = B+A -} - -/* ******************************************************************** - * EXPORTED FUNCTIONS - ******************************************************************** */ - -/* return 0 on success, -1 otherwise */ -int ge25519_unpack_vartime(ge25519_p3 *r, const unsigned char p[32]) -{ - int ret; - fe25519 t, fd; - fe25519_setone(&r->z); - fe25519_unpack(&fd, ecd); - unsigned char par = p[31] >> 7; - fe25519_unpack(&r->y, p); - fe25519_square(&r->x, &r->y); - fe25519_mul(&t, &r->x, &fd); - fe25519_sub(&r->x, &r->x, &r->z); - fe25519_add(&t, &r->z, &t); - fe25519_invert(&t, &t); - fe25519_mul(&r->x, &r->x, &t); - ret = fe25519_sqrt_vartime(&r->x, &r->x, par); - fe25519_mul(&r->t, &r->x, &r->y); - return ret; -} - -void ge25519_pack(unsigned char r[32], const ge25519_p3 *p) -{ - fe25519 tx, ty, zi; - fe25519_invert(&zi, &p->z); - fe25519_mul(&tx, &p->x, &zi); - fe25519_mul(&ty, &p->y, &zi); - fe25519_pack(r, &ty); - r[31] ^= fe25519_getparity(&tx) << 7; -} - -void ge25519_add(ge25519_p3 *r, const ge25519_p3 *p, const ge25519_p3 *q) -{ - ge25519_p1p1 grp1p1; - add_p1p1(&grp1p1, p, q); - p1p1_to_p3(r, &grp1p1); -} - -void ge25519_double(ge25519_p3 *r, const ge25519_p3 *p) -{ - ge25519_p1p1 grp1p1; - dbl_p1p1(&grp1p1, (ge25519_p2 *)p); - p1p1_to_p3(r, &grp1p1); -} - -void ge25519_scalarmult(ge25519_p3 *r, const ge25519_p3 *p, const sc25519 *s) -{ - int i,j,k; - ge25519_p3 g; - fe25519_unpack(&g.x, ge25519_neutral_x); - fe25519_unpack(&g.y, ge25519_neutral_y); - fe25519_unpack(&g.z, ge25519_neutral_z); - fe25519_unpack(&g.t, ge25519_neutral_t); - - ge25519_p3 pre[(1 << WINDOWSIZE)]; - ge25519_p3 t; - ge25519_p1p1 tp1p1; - unsigned char w; - unsigned char sb[32]; - sc25519_to32bytes(sb, s); - - // Precomputation - pre[0] = g; - pre[1] = *p; - for(i=2;i<(1<0;i--) - { - for(j=8-WINDOWSIZE;j>=0;j-=WINDOWSIZE) - { - for(k=0;k>j) & WINDOWMASK; - t = pre[0]; - for(k=1;k<(1<x = g.x; - r->y = g.y; - r->z = g.z; - r->t = g.t; -} - -void ge25519_scalarmult_base(ge25519_p3 *r, const sc25519 *s) -{ - /* XXX: Better algorithm for known-base-point scalar multiplication */ - ge25519_p3 t; - fe25519_unpack(&t.x, ge25519_base_x); - fe25519_unpack(&t.y, ge25519_base_y); - fe25519_unpack(&t.z, ge25519_base_z); - fe25519_unpack(&t.t, ge25519_base_t); - ge25519_scalarmult(r, &t, s); -} diff --git a/src/libnacl/crypto_sign/edwards25519sha512batch/ref/ge25519.h b/src/libnacl/crypto_sign/edwards25519sha512batch/ref/ge25519.h deleted file mode 100644 index 49ad163a..00000000 --- a/src/libnacl/crypto_sign/edwards25519sha512batch/ref/ge25519.h +++ /dev/null @@ -1,34 +0,0 @@ -#ifndef GE25519_H -#define GE25519_H - -#include "fe25519.h" -#include "sc25519.h" - -#define ge25519 crypto_sign_edwards25519sha512batch_ge25519 -#define ge25519_unpack_vartime crypto_sign_edwards25519sha512batch_ge25519_unpack_vartime -#define ge25519_pack crypto_sign_edwards25519sha512batch_ge25519_pack -#define ge25519_add crypto_sign_edwards25519sha512batch_ge25519_add -#define ge25519_double crypto_sign_edwards25519sha512batch_ge25519_double -#define ge25519_scalarmult crypto_sign_edwards25519sha512batch_ge25519_scalarmult -#define ge25519_scalarmult_base crypto_sign_edwards25519sha512batch_ge25519_scalarmult_base - -typedef struct { - fe25519 x; - fe25519 y; - fe25519 z; - fe25519 t; -} ge25519; - -int ge25519_unpack_vartime(ge25519 *r, const unsigned char p[32]); - -void ge25519_pack(unsigned char r[32], const ge25519 *p); - -void ge25519_add(ge25519 *r, const ge25519 *p, const ge25519 *q); - -void ge25519_double(ge25519 *r, const ge25519 *p); - -void ge25519_scalarmult(ge25519 *r, const ge25519 *p, const sc25519 *s); - -void ge25519_scalarmult_base(ge25519 *r, const sc25519 *s); - -#endif diff --git a/src/libnacl/crypto_sign/edwards25519sha512batch/ref/sc25519.c b/src/libnacl/crypto_sign/edwards25519sha512batch/ref/sc25519.c deleted file mode 100644 index ad232d78..00000000 --- a/src/libnacl/crypto_sign/edwards25519sha512batch/ref/sc25519.c +++ /dev/null @@ -1,146 +0,0 @@ -#include "sc25519.h" - -/*Arithmetic modulo the group order n = 2^252 + 27742317777372353535851937790883648493 = 7237005577332262213973186563042994240857116359379907606001950938285454250989 */ - -static const crypto_uint32 m[32] = {0xED, 0xD3, 0xF5, 0x5C, 0x1A, 0x63, 0x12, 0x58, 0xD6, 0x9C, 0xF7, 0xA2, 0xDE, 0xF9, 0xDE, 0x14, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10}; - -static const crypto_uint32 mu[33] = {0x1B, 0x13, 0x2C, 0x0A, 0xA3, 0xE5, 0x9C, 0xED, 0xA7, 0x29, 0x63, 0x08, 0x5D, 0x21, 0x06, 0x21, - 0xEB, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F}; - -/* Reduce coefficients of r before calling reduce_add_sub */ -static void reduce_add_sub(sc25519 *r) -{ - int i, b, pb=0, nb; - unsigned char t[32]; - - for(i=0;i<32;i++) - { - b = (r->v[i]v[i]-pb-m[i]+b*256; - pb = b; - } - nb = 1-b; - for(i=0;i<32;i++) - r->v[i] = r->v[i]*b + t[i]*nb; -} - -/* Reduce coefficients of x before calling barrett_reduce */ -static void barrett_reduce(sc25519 *r, const crypto_uint32 x[64]) -{ - /* See HAC, Alg. 14.42 */ - int i,j; - crypto_uint32 q2[66] = {0}; - crypto_uint32 *q3 = q2 + 33; - crypto_uint32 r1[33]; - crypto_uint32 r2[33] = {0}; - crypto_uint32 carry; - int b, pb=0; - - for(i=0;i<33;i++) - for(j=0;j<33;j++) - if(i+j >= 31) q2[i+j] += mu[i]*x[j+31]; - carry = q2[31] >> 8; - q2[32] += carry; - carry = q2[32] >> 8; - q2[33] += carry; - - for(i=0;i<33;i++)r1[i] = x[i]; - for(i=0;i<32;i++) - for(j=0;j<33;j++) - if(i+j < 33) r2[i+j] += m[i]*q3[j]; - - for(i=0;i<32;i++) - { - carry = r2[i] >> 8; - r2[i+1] += carry; - r2[i] &= 0xff; - } - - for(i=0;i<32;i++) - { - b = (r1[i]v[i] = r1[i]-pb-r2[i]+b*256; - pb = b; - } - - /* XXX: Can it really happen that r<0?, See HAC, Alg 14.42, Step 3 - * If so: Handle it here! - */ - - reduce_add_sub(r); - reduce_add_sub(r); -} - -/* -static int iszero(const sc25519 *x) -{ - // Implement - return 0; -} -*/ - -void sc25519_from32bytes(sc25519 *r, const unsigned char x[32]) -{ - int i; - crypto_uint32 t[64] = {0}; - for(i=0;i<32;i++) t[i] = x[i]; - barrett_reduce(r, t); -} - -void sc25519_from64bytes(sc25519 *r, const unsigned char x[64]) -{ - int i; - crypto_uint32 t[64] = {0}; - for(i=0;i<64;i++) t[i] = x[i]; - barrett_reduce(r, t); -} - -/* XXX: What we actually want for crypto_group is probably just something like - * void sc25519_frombytes(sc25519 *r, const unsigned char *x, size_t xlen) - */ - -void sc25519_to32bytes(unsigned char r[32], const sc25519 *x) -{ - int i; - for(i=0;i<32;i++) r[i] = x->v[i]; -} - -void sc25519_add(sc25519 *r, const sc25519 *x, const sc25519 *y) -{ - int i, carry; - for(i=0;i<32;i++) r->v[i] = x->v[i] + y->v[i]; - for(i=0;i<31;i++) - { - carry = r->v[i] >> 8; - r->v[i+1] += carry; - r->v[i] &= 0xff; - } - reduce_add_sub(r); -} - -void sc25519_mul(sc25519 *r, const sc25519 *x, const sc25519 *y) -{ - int i,j,carry; - crypto_uint32 t[64]; - for(i=0;i<64;i++)t[i] = 0; - - for(i=0;i<32;i++) - for(j=0;j<32;j++) - t[i+j] += x->v[i] * y->v[j]; - - /* Reduce coefficients */ - for(i=0;i<63;i++) - { - carry = t[i] >> 8; - t[i+1] += carry; - t[i] &= 0xff; - } - - barrett_reduce(r, t); -} - -void sc25519_square(sc25519 *r, const sc25519 *x) -{ - sc25519_mul(r, x, x); -} diff --git a/src/libnacl/crypto_sign/edwards25519sha512batch/ref/sc25519.h b/src/libnacl/crypto_sign/edwards25519sha512batch/ref/sc25519.h deleted file mode 100644 index f791dea4..00000000 --- a/src/libnacl/crypto_sign/edwards25519sha512batch/ref/sc25519.h +++ /dev/null @@ -1,51 +0,0 @@ -#ifndef SC25519_H -#define SC25519_H - -#define sc25519 crypto_sign_edwards25519sha512batch_sc25519 -#define sc25519_from32bytes crypto_sign_edwards25519sha512batch_sc25519_from32bytes -#define sc25519_from64bytes crypto_sign_edwards25519sha512batch_sc25519_from64bytes -#define sc25519_to32bytes crypto_sign_edwards25519sha512batch_sc25519_to32bytes -#define sc25519_pack crypto_sign_edwards25519sha512batch_sc25519_pack -#define sc25519_getparity crypto_sign_edwards25519sha512batch_sc25519_getparity -#define sc25519_setone crypto_sign_edwards25519sha512batch_sc25519_setone -#define sc25519_setzero crypto_sign_edwards25519sha512batch_sc25519_setzero -#define sc25519_neg crypto_sign_edwards25519sha512batch_sc25519_neg -#define sc25519_add crypto_sign_edwards25519sha512batch_sc25519_add -#define sc25519_sub crypto_sign_edwards25519sha512batch_sc25519_sub -#define sc25519_mul crypto_sign_edwards25519sha512batch_sc25519_mul -#define sc25519_square crypto_sign_edwards25519sha512batch_sc25519_square -#define sc25519_invert crypto_sign_edwards25519sha512batch_sc25519_invert - -#include "crypto_uint32.h" - -typedef struct { - crypto_uint32 v[32]; -} sc25519; - -void sc25519_from32bytes(sc25519 *r, const unsigned char x[32]); - -void sc25519_from64bytes(sc25519 *r, const unsigned char x[64]); - -void sc25519_to32bytes(unsigned char r[32], const sc25519 *x); - -void sc25519_pack(unsigned char r[32], const sc25519 *x); - -unsigned char sc25519_getparity(const sc25519 *x); - -void sc25519_setone(sc25519 *r); - -void sc25519_setzero(sc25519 *r); - -void sc25519_neg(sc25519 *r, const sc25519 *x); - -void sc25519_add(sc25519 *r, const sc25519 *x, const sc25519 *y); - -void sc25519_sub(sc25519 *r, const sc25519 *x, const sc25519 *y); - -void sc25519_mul(sc25519 *r, const sc25519 *x, const sc25519 *y); - -void sc25519_square(sc25519 *r, const sc25519 *x); - -void sc25519_invert(sc25519 *r, const sc25519 *x); - -#endif diff --git a/src/libnacl/crypto_sign/edwards25519sha512batch/ref/sign.c b/src/libnacl/crypto_sign/edwards25519sha512batch/ref/sign.c deleted file mode 100644 index eb2740a1..00000000 --- a/src/libnacl/crypto_sign/edwards25519sha512batch/ref/sign.c +++ /dev/null @@ -1,103 +0,0 @@ -#include "api.h" -#include "crypto_sign.h" -#include "crypto_hash_sha512.h" -#include "randombytes.h" -#include "crypto_verify_32.h" - -#include "ge25519.h" - -int crypto_sign_keypair( - unsigned char *pk, - unsigned char *sk - ) -{ - sc25519 scsk; - ge25519 gepk; - - randombytes(sk, 32); - crypto_hash_sha512(sk, sk, 32); - sk[0] &= 248; - sk[31] &= 127; - sk[31] |= 64; - - sc25519_from32bytes(&scsk,sk); - - ge25519_scalarmult_base(&gepk, &scsk); - ge25519_pack(pk, &gepk); - return 0; -} - -int crypto_sign( - unsigned char *sm,unsigned long long *smlen, - const unsigned char *m,unsigned long long mlen, - const unsigned char *sk - ) -{ - sc25519 sck, scs, scsk; - ge25519 ger; - unsigned char r[32]; - unsigned char s[32]; - unsigned long long i; - unsigned char hmg[crypto_hash_sha512_BYTES]; - unsigned char hmr[crypto_hash_sha512_BYTES]; - - *smlen = mlen+64; - for(i=0;i -#include "randombytes.h" -#include "cpucycles.h" -#include "crypto_sign.h" - -extern void printentry(long long,const char *,long long *,long long); -extern unsigned char *alignedcalloc(unsigned long long); -extern const char *primitiveimplementation; -extern const char *implementationversion; -extern const char *sizenames[]; -extern const long long sizes[]; -extern void allocate(void); -extern void measure(void); - -const char *primitiveimplementation = crypto_sign_IMPLEMENTATION; -const char *implementationversion = crypto_sign_VERSION; -const char *sizenames[] = { "outputbytes", "publickeybytes", "secretkeybytes", 0 }; -const long long sizes[] = { crypto_sign_BYTES, crypto_sign_PUBLICKEYBYTES, crypto_sign_SECRETKEYBYTES }; - -#define MAXTEST_BYTES 100000 - -static unsigned char *pk; -static unsigned char *sk; -static unsigned char *m; unsigned long long mlen; -static unsigned char *sm; unsigned long long smlen; -static unsigned char *t; unsigned long long tlen; - -void preallocate(void) -{ -#ifdef RAND_R_PRNG_NOT_SEEDED - RAND_status(); -#endif -} - -void allocate(void) -{ - pk = alignedcalloc(crypto_sign_PUBLICKEYBYTES); - sk = alignedcalloc(crypto_sign_SECRETKEYBYTES); - m = alignedcalloc(MAXTEST_BYTES + crypto_sign_BYTES); - sm = alignedcalloc(MAXTEST_BYTES + crypto_sign_BYTES); - t = alignedcalloc(MAXTEST_BYTES + crypto_sign_BYTES); -} - -#define TIMINGS 31 -static long long cycles[TIMINGS + 1]; -static long long bytes[TIMINGS + 1]; - -void measure(void) -{ - int i; - int loop; - - for (loop = 0;loop < LOOPS;++loop) { - for (i = 0;i <= TIMINGS;++i) { - cycles[i] = cpucycles(); - crypto_sign_keypair(pk,sk); - } - for (i = 0;i < TIMINGS;++i) cycles[i] = cycles[i + 1] - cycles[i]; - printentry(-1,"keypair_cycles",cycles,TIMINGS); - - for (mlen = 0;mlen <= MAXTEST_BYTES;mlen += 1 + mlen / 4) { - randombytes(m,mlen); - - for (i = 0;i <= TIMINGS;++i) { - cycles[i] = cpucycles(); - bytes[i] = crypto_sign(sm,&smlen,m,mlen,sk); - if (bytes[i] == 0) bytes[i] = smlen; - } - for (i = 0;i < TIMINGS;++i) cycles[i] = cycles[i + 1] - cycles[i]; - printentry(mlen,"cycles",cycles,TIMINGS); - printentry(mlen,"bytes",bytes,TIMINGS); - - for (i = 0;i <= TIMINGS;++i) { - cycles[i] = cpucycles(); - bytes[i] = crypto_sign_open(t,&tlen,sm,smlen,pk); - if (bytes[i] == 0) bytes[i] = tlen; - } - for (i = 0;i < TIMINGS;++i) cycles[i] = cycles[i + 1] - cycles[i]; - printentry(mlen,"open_cycles",cycles,TIMINGS); - printentry(mlen,"open_bytes",bytes,TIMINGS); - } - } -} diff --git a/src/libnacl/crypto_sign/try.c b/src/libnacl/crypto_sign/try.c deleted file mode 100644 index 961a93ff..00000000 --- a/src/libnacl/crypto_sign/try.c +++ /dev/null @@ -1,87 +0,0 @@ -/* - * crypto_sign/try.c version 20090118 - * D. J. Bernstein - * Public domain. - */ - -#include -#include "randombytes.h" -#include "crypto_sign.h" -#include "windows/windows-quirks.h" - -#define MAXTEST_BYTES 10000 -#define TUNE_BYTES 1536 - -extern unsigned char *alignedcalloc(unsigned long long); - -const char *primitiveimplementation = crypto_sign_IMPLEMENTATION; - -static unsigned char *pk; -static unsigned char *sk; -static unsigned char *m; unsigned long long mlen; -static unsigned char *sm; unsigned long long smlen; -static unsigned char *t; unsigned long long tlen; - -void preallocate(void) -{ -#ifdef RAND_R_PRNG_NOT_SEEDED - RAND_status(); -#endif -} - -void allocate(void) -{ - pk = alignedcalloc(crypto_sign_PUBLICKEYBYTES); - sk = alignedcalloc(crypto_sign_SECRETKEYBYTES); - m = alignedcalloc(MAXTEST_BYTES + crypto_sign_BYTES); - sm = alignedcalloc(MAXTEST_BYTES + crypto_sign_BYTES); - t = alignedcalloc(MAXTEST_BYTES + crypto_sign_BYTES); -} - -void predoit(void) -{ - crypto_sign_keypair(pk,sk); - mlen = TUNE_BYTES; - smlen = 0; - randombytes(m,mlen); - crypto_sign(sm,&smlen,m,mlen,sk); -} - -void doit(void) -{ - crypto_sign_open(t,&tlen,sm,smlen,pk); -} - -char checksum[crypto_sign_BYTES * 2 + 1]; - -const char *checksum_compute(void) -{ - long long mlen; - long long i; - long long j; - - if (crypto_sign_keypair(pk,sk) != 0) return "crypto_sign_keypair returns nonzero"; - for (mlen = 0;mlen < MAXTEST_BYTES;mlen += 1 + (mlen / 16)) { - if (crypto_sign(sm,&smlen,m,mlen,sk) != 0) return "crypto_sign returns nonzero"; - if (crypto_sign_open(t,&tlen,sm,smlen,pk) != 0) return "crypto_sign_open returns nonzero"; - if (tlen != mlen) return "crypto_sign_open does not match length"; - for (i = 0;i < tlen;++i) - if (t[i] != m[i]) - return "crypto_sign_open does not match contents"; - - j = random() % smlen; - sm[j] ^= 1; - if (crypto_sign_open(t,&tlen,sm,smlen,pk) == 0) { - if (tlen != mlen) return "crypto_sign_open allows trivial forgery of length"; - for (i = 0;i < tlen;++i) - if (t[i] != m[i]) - return "crypto_sign_open allows trivial forgery of contents"; - } - sm[j] ^= 1; - - } - - /* do some long-term checksum */ - checksum[0] = 0; - return 0; -} diff --git a/src/libnacl/crypto_stream/aes128ctr/checksum b/src/libnacl/crypto_stream/aes128ctr/checksum deleted file mode 100644 index 92865436..00000000 --- a/src/libnacl/crypto_stream/aes128ctr/checksum +++ /dev/null @@ -1 +0,0 @@ -6e9966897837aae181e93261ae88fdf0 diff --git a/src/libnacl/crypto_stream/aes128ctr/portable/afternm.c b/src/libnacl/crypto_stream/aes128ctr/portable/afternm.c deleted file mode 100644 index 93c96e42..00000000 --- a/src/libnacl/crypto_stream/aes128ctr/portable/afternm.c +++ /dev/null @@ -1,158 +0,0 @@ -/* Author: Peter Schwabe, ported from an assembly implementation by Emilia Käsper - * Date: 2009-03-19 - * Public domain */ - -#include "int128.h" -#include "common.h" -#include "consts.h" -#include "crypto_stream.h" - -int crypto_stream_afternm(unsigned char *outp, unsigned long long len, const unsigned char *noncep, const unsigned char *c) -{ - - int128 xmm0; - int128 xmm1; - int128 xmm2; - int128 xmm3; - int128 xmm4; - int128 xmm5; - int128 xmm6; - int128 xmm7; - - int128 xmm8; - int128 xmm9; - int128 xmm10; - int128 xmm11; - int128 xmm12; - int128 xmm13; - int128 xmm14; - int128 xmm15; - - int128 nonce_stack; - unsigned long long lensav; - unsigned char bl[128]; - unsigned char *blp; - unsigned char b; - - uint32 tmp; - - /* Copy nonce on the stack */ - copy2(&nonce_stack, (int128 *) (noncep + 0)); - unsigned char *np = (unsigned char *)&nonce_stack; - - enc_block: - - xmm0 = *(int128 *) (np + 0); - copy2(&xmm1, &xmm0); - shufb(&xmm1, SWAP32); - copy2(&xmm2, &xmm1); - copy2(&xmm3, &xmm1); - copy2(&xmm4, &xmm1); - copy2(&xmm5, &xmm1); - copy2(&xmm6, &xmm1); - copy2(&xmm7, &xmm1); - - add_uint32_big(&xmm1, 1); - add_uint32_big(&xmm2, 2); - add_uint32_big(&xmm3, 3); - add_uint32_big(&xmm4, 4); - add_uint32_big(&xmm5, 5); - add_uint32_big(&xmm6, 6); - add_uint32_big(&xmm7, 7); - - shufb(&xmm0, M0); - shufb(&xmm1, M0SWAP); - shufb(&xmm2, M0SWAP); - shufb(&xmm3, M0SWAP); - shufb(&xmm4, M0SWAP); - shufb(&xmm5, M0SWAP); - shufb(&xmm6, M0SWAP); - shufb(&xmm7, M0SWAP); - - bitslice(xmm7, xmm6, xmm5, xmm4, xmm3, xmm2, xmm1, xmm0, xmm8) - - aesround( 1, xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15,c) - aesround( 2, xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15, xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7,c) - aesround( 3, xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15,c) - aesround( 4, xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15, xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7,c) - aesround( 5, xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15,c) - aesround( 6, xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15, xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7,c) - aesround( 7, xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15,c) - aesround( 8, xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15, xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7,c) - aesround( 9, xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15,c) - lastround(xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15, xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7,c) - - bitslice(xmm13, xmm10, xmm15, xmm11, xmm14, xmm12, xmm9, xmm8, xmm0) - - if(len < 128) goto partial; - if(len == 128) goto full; - - tmp = load32_bigendian(np + 12); - tmp += 8; - store32_bigendian(np + 12, tmp); - - *(int128 *) (outp + 0) = xmm8; - *(int128 *) (outp + 16) = xmm9; - *(int128 *) (outp + 32) = xmm12; - *(int128 *) (outp + 48) = xmm14; - *(int128 *) (outp + 64) = xmm11; - *(int128 *) (outp + 80) = xmm15; - *(int128 *) (outp + 96) = xmm10; - *(int128 *) (outp + 112) = xmm13; - - len -= 128; - outp += 128; - - goto enc_block; - - partial: - - lensav = len; - len >>= 4; - - tmp = load32_bigendian(np + 12); - tmp += len; - store32_bigendian(np + 12, tmp); - - blp = bl; - *(int128 *)(blp + 0) = xmm8; - *(int128 *)(blp + 16) = xmm9; - *(int128 *)(blp + 32) = xmm12; - *(int128 *)(blp + 48) = xmm14; - *(int128 *)(blp + 64) = xmm11; - *(int128 *)(blp + 80) = xmm15; - *(int128 *)(blp + 96) = xmm10; - *(int128 *)(blp + 112) = xmm13; - - bytes: - - if(lensav == 0) goto end; - - b = blp[0]; - *(unsigned char *)(outp + 0) = b; - - blp += 1; - outp +=1; - lensav -= 1; - - goto bytes; - - full: - - tmp = load32_bigendian(np + 12); - tmp += 8; - store32_bigendian(np + 12, tmp); - - *(int128 *) (outp + 0) = xmm8; - *(int128 *) (outp + 16) = xmm9; - *(int128 *) (outp + 32) = xmm12; - *(int128 *) (outp + 48) = xmm14; - *(int128 *) (outp + 64) = xmm11; - *(int128 *) (outp + 80) = xmm15; - *(int128 *) (outp + 96) = xmm10; - *(int128 *) (outp + 112) = xmm13; - - end: - return 0; - -} diff --git a/src/libnacl/crypto_stream/aes128ctr/portable/api.h b/src/libnacl/crypto_stream/aes128ctr/portable/api.h deleted file mode 100644 index 62fc8d88..00000000 --- a/src/libnacl/crypto_stream/aes128ctr/portable/api.h +++ /dev/null @@ -1,3 +0,0 @@ -#define CRYPTO_KEYBYTES 16 -#define CRYPTO_NONCEBYTES 16 -#define CRYPTO_BEFORENMBYTES 1408 diff --git a/src/libnacl/crypto_stream/aes128ctr/portable/beforenm.c b/src/libnacl/crypto_stream/aes128ctr/portable/beforenm.c deleted file mode 100644 index 8fa2673d..00000000 --- a/src/libnacl/crypto_stream/aes128ctr/portable/beforenm.c +++ /dev/null @@ -1,59 +0,0 @@ -/* Author: Peter Schwabe, ported from an assembly implementation by Emilia Käsper - * Date: 2009-03-19 - * Public domain */ - -#include "consts.h" -#include "int128.h" -#include "common.h" -#include "crypto_stream.h" - -int crypto_stream_beforenm(unsigned char *c, const unsigned char *k) -{ - - /* - int64 x0; - int64 x1; - int64 x2; - int64 x3; - int64 e; - int64 q0; - int64 q1; - int64 q2; - int64 q3; - */ - - int128 xmm0; - int128 xmm1; - int128 xmm2; - int128 xmm3; - int128 xmm4; - int128 xmm5; - int128 xmm6; - int128 xmm7; - int128 xmm8; - int128 xmm9; - int128 xmm10; - int128 xmm11; - int128 xmm12; - int128 xmm13; - int128 xmm14; - int128 xmm15; - int128 t; - - bitslicekey0(k, c) - - keyexpbs1(xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15,c) - keyexpbs(xmm0, xmm1, xmm4, xmm6, xmm3, xmm7, xmm2, xmm5, xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15, xor_rcon(&xmm1);, 2,c) - keyexpbs(xmm0, xmm1, xmm3, xmm2, xmm6, xmm5, xmm4, xmm7, xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15, xor_rcon(&xmm6);, 3,c) - keyexpbs(xmm0, xmm1, xmm6, xmm4, xmm2, xmm7, xmm3, xmm5, xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15, xor_rcon(&xmm3);, 4,c) - - keyexpbs(xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15, xor_rcon(&xmm3);, 5,c) - keyexpbs(xmm0, xmm1, xmm4, xmm6, xmm3, xmm7, xmm2, xmm5, xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15, xor_rcon(&xmm5);, 6,c) - keyexpbs(xmm0, xmm1, xmm3, xmm2, xmm6, xmm5, xmm4, xmm7, xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15, xor_rcon(&xmm3);, 7,c) - keyexpbs(xmm0, xmm1, xmm6, xmm4, xmm2, xmm7, xmm3, xmm5, xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15, xor_rcon(&xmm7);, 8,c) - - keyexpbs(xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15, xor_rcon(&xmm0); xor_rcon(&xmm1); xor_rcon(&xmm6); xor_rcon(&xmm3);, 9,c) - keyexpbs10(xmm0, xmm1, xmm4, xmm6, xmm3, xmm7, xmm2, xmm5, xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15,c) - - return 0; -} diff --git a/src/libnacl/crypto_stream/aes128ctr/portable/common.c b/src/libnacl/crypto_stream/aes128ctr/portable/common.c deleted file mode 100644 index 14a28cc6..00000000 --- a/src/libnacl/crypto_stream/aes128ctr/portable/common.c +++ /dev/null @@ -1,64 +0,0 @@ -#include "common.h" - -uint32 load32_bigendian(const unsigned char *x) -{ - return - (uint32) (x[3]) \ - | (((uint32) (x[2])) << 8) \ - | (((uint32) (x[1])) << 16) \ - | (((uint32) (x[0])) << 24) - ; -} - -void store32_bigendian(unsigned char *x,uint32 u) -{ - x[3] = u; u >>= 8; - x[2] = u; u >>= 8; - x[1] = u; u >>= 8; - x[0] = u; -} - -uint32 load32_littleendian(const unsigned char *x) -{ - return - (uint32) (x[0]) \ - | (((uint32) (x[1])) << 8) \ - | (((uint32) (x[2])) << 16) \ - | (((uint32) (x[3])) << 24) - ; -} - -void store32_littleendian(unsigned char *x,uint32 u) -{ - x[0] = u; u >>= 8; - x[1] = u; u >>= 8; - x[2] = u; u >>= 8; - x[3] = u; -} - - -uint64 load64_littleendian(const unsigned char *x) -{ - return - (uint64) (x[0]) \ - | (((uint64) (x[1])) << 8) \ - | (((uint64) (x[2])) << 16) \ - | (((uint64) (x[3])) << 24) - | (((uint64) (x[4])) << 32) - | (((uint64) (x[5])) << 40) - | (((uint64) (x[6])) << 48) - | (((uint64) (x[7])) << 56) - ; -} - -void store64_littleendian(unsigned char *x,uint64 u) -{ - x[0] = u; u >>= 8; - x[1] = u; u >>= 8; - x[2] = u; u >>= 8; - x[3] = u; u >>= 8; - x[4] = u; u >>= 8; - x[5] = u; u >>= 8; - x[6] = u; u >>= 8; - x[7] = u; -} diff --git a/src/libnacl/crypto_stream/aes128ctr/portable/common.h b/src/libnacl/crypto_stream/aes128ctr/portable/common.h deleted file mode 100644 index e6e60dc2..00000000 --- a/src/libnacl/crypto_stream/aes128ctr/portable/common.h +++ /dev/null @@ -1,788 +0,0 @@ -/* Author: Peter Schwabe, ported from an assembly implementation by Emilia Käsper - Date: 2009-03-19 - Public domain */ -#ifndef COMMON_H -#define COMMON_H - -#include "types.h" - -#define load32_bigendian crypto_stream_aes128ctr_portable_load32_bigendian -uint32 load32_bigendian(const unsigned char *x); - -#define store32_bigendian crypto_stream_aes128ctr_portable_store32_bigendian -void store32_bigendian(unsigned char *x,uint32 u); - -#define load32_littleendian crypto_stream_aes128ctr_portable_load32_littleendian -uint32 load32_littleendian(const unsigned char *x); - -#define store32_littleendian crypto_stream_aes128ctr_portable_store32_littleendian -void store32_littleendian(unsigned char *x,uint32 u); - -#define load64_littleendian crypto_stream_aes128ctr_portable_load64_littleendian -uint64 load64_littleendian(const unsigned char *x); - -#define store64_littleendian crypto_stream_aes128ctr_portable_store64_littleendian -void store64_littleendian(unsigned char *x,uint64 u); - -/* Macros required only for key expansion */ - -#define keyexpbs1(b0, b1, b2, b3, b4, b5, b6, b7, t0, t1, t2, t3, t4, t5, t6, t7, bskey) \ - rotbyte(&b0);\ - rotbyte(&b1);\ - rotbyte(&b2);\ - rotbyte(&b3);\ - rotbyte(&b4);\ - rotbyte(&b5);\ - rotbyte(&b6);\ - rotbyte(&b7);\ - ;\ - sbox(b0, b1, b2, b3, b4, b5, b6, b7, t0, t1, t2, t3, t4, t5, t6, t7);\ - ;\ - xor_rcon(&b0);\ - shufb(&b0, EXPB0);\ - shufb(&b1, EXPB0);\ - shufb(&b4, EXPB0);\ - shufb(&b6, EXPB0);\ - shufb(&b3, EXPB0);\ - shufb(&b7, EXPB0);\ - shufb(&b2, EXPB0);\ - shufb(&b5, EXPB0);\ - shufb(&b0, EXPB0);\ - ;\ - t0 = *(int128 *)(bskey + 0);\ - t1 = *(int128 *)(bskey + 16);\ - t2 = *(int128 *)(bskey + 32);\ - t3 = *(int128 *)(bskey + 48);\ - t4 = *(int128 *)(bskey + 64);\ - t5 = *(int128 *)(bskey + 80);\ - t6 = *(int128 *)(bskey + 96);\ - t7 = *(int128 *)(bskey + 112);\ - ;\ - xor2(&b0, &t0);\ - xor2(&b1, &t1);\ - xor2(&b4, &t2);\ - xor2(&b6, &t3);\ - xor2(&b3, &t4);\ - xor2(&b7, &t5);\ - xor2(&b2, &t6);\ - xor2(&b5, &t7);\ - ;\ - rshift32_littleendian(&t0, 8);\ - rshift32_littleendian(&t1, 8);\ - rshift32_littleendian(&t2, 8);\ - rshift32_littleendian(&t3, 8);\ - rshift32_littleendian(&t4, 8);\ - rshift32_littleendian(&t5, 8);\ - rshift32_littleendian(&t6, 8);\ - rshift32_littleendian(&t7, 8);\ - ;\ - xor2(&b0, &t0);\ - xor2(&b1, &t1);\ - xor2(&b4, &t2);\ - xor2(&b6, &t3);\ - xor2(&b3, &t4);\ - xor2(&b7, &t5);\ - xor2(&b2, &t6);\ - xor2(&b5, &t7);\ - ;\ - rshift32_littleendian(&t0, 8);\ - rshift32_littleendian(&t1, 8);\ - rshift32_littleendian(&t2, 8);\ - rshift32_littleendian(&t3, 8);\ - rshift32_littleendian(&t4, 8);\ - rshift32_littleendian(&t5, 8);\ - rshift32_littleendian(&t6, 8);\ - rshift32_littleendian(&t7, 8);\ - ;\ - xor2(&b0, &t0);\ - xor2(&b1, &t1);\ - xor2(&b4, &t2);\ - xor2(&b6, &t3);\ - xor2(&b3, &t4);\ - xor2(&b7, &t5);\ - xor2(&b2, &t6);\ - xor2(&b5, &t7);\ - ;\ - rshift32_littleendian(&t0, 8);\ - rshift32_littleendian(&t1, 8);\ - rshift32_littleendian(&t2, 8);\ - rshift32_littleendian(&t3, 8);\ - rshift32_littleendian(&t4, 8);\ - rshift32_littleendian(&t5, 8);\ - rshift32_littleendian(&t6, 8);\ - rshift32_littleendian(&t7, 8);\ - ;\ - xor2(&b0, &t0);\ - xor2(&b1, &t1);\ - xor2(&b4, &t2);\ - xor2(&b6, &t3);\ - xor2(&b3, &t4);\ - xor2(&b7, &t5);\ - xor2(&b2, &t6);\ - xor2(&b5, &t7);\ - ;\ - *(int128 *)(bskey + 128) = b0;\ - *(int128 *)(bskey + 144) = b1;\ - *(int128 *)(bskey + 160) = b4;\ - *(int128 *)(bskey + 176) = b6;\ - *(int128 *)(bskey + 192) = b3;\ - *(int128 *)(bskey + 208) = b7;\ - *(int128 *)(bskey + 224) = b2;\ - *(int128 *)(bskey + 240) = b5;\ - -#define keyexpbs10(b0, b1, b2, b3, b4, b5, b6, b7, t0, t1, t2, t3, t4, t5, t6, t7, bskey) ;\ - toggle(&b0);\ - toggle(&b1);\ - toggle(&b5);\ - toggle(&b6);\ - rotbyte(&b0);\ - rotbyte(&b1);\ - rotbyte(&b2);\ - rotbyte(&b3);\ - rotbyte(&b4);\ - rotbyte(&b5);\ - rotbyte(&b6);\ - rotbyte(&b7);\ - ;\ - sbox(b0, b1, b2, b3, b4, b5, b6, b7, t0, t1, t2, t3, t4, t5, t6, t7);\ - ;\ - xor_rcon(&b1);\ - xor_rcon(&b4);\ - xor_rcon(&b3);\ - xor_rcon(&b7);\ - shufb(&b0, EXPB0);\ - shufb(&b1, EXPB0);\ - shufb(&b4, EXPB0);\ - shufb(&b6, EXPB0);\ - shufb(&b3, EXPB0);\ - shufb(&b7, EXPB0);\ - shufb(&b2, EXPB0);\ - shufb(&b5, EXPB0);\ - ;\ - t0 = *(int128 *)(bskey + 9 * 128 + 0);\ - t1 = *(int128 *)(bskey + 9 * 128 + 16);\ - t2 = *(int128 *)(bskey + 9 * 128 + 32);\ - t3 = *(int128 *)(bskey + 9 * 128 + 48);\ - t4 = *(int128 *)(bskey + 9 * 128 + 64);\ - t5 = *(int128 *)(bskey + 9 * 128 + 80);\ - t6 = *(int128 *)(bskey + 9 * 128 + 96);\ - t7 = *(int128 *)(bskey + 9 * 128 + 112);\ - ;\ - toggle(&t0);\ - toggle(&t1);\ - toggle(&t5);\ - toggle(&t6);\ - ;\ - xor2(&b0, &t0);\ - xor2(&b1, &t1);\ - xor2(&b4, &t2);\ - xor2(&b6, &t3);\ - xor2(&b3, &t4);\ - xor2(&b7, &t5);\ - xor2(&b2, &t6);\ - xor2(&b5, &t7);\ - ;\ - rshift32_littleendian(&t0, 8);\ - rshift32_littleendian(&t1, 8);\ - rshift32_littleendian(&t2, 8);\ - rshift32_littleendian(&t3, 8);\ - rshift32_littleendian(&t4, 8);\ - rshift32_littleendian(&t5, 8);\ - rshift32_littleendian(&t6, 8);\ - rshift32_littleendian(&t7, 8);\ - ;\ - xor2(&b0, &t0);\ - xor2(&b1, &t1);\ - xor2(&b4, &t2);\ - xor2(&b6, &t3);\ - xor2(&b3, &t4);\ - xor2(&b7, &t5);\ - xor2(&b2, &t6);\ - xor2(&b5, &t7);\ - ;\ - rshift32_littleendian(&t0, 8);\ - rshift32_littleendian(&t1, 8);\ - rshift32_littleendian(&t2, 8);\ - rshift32_littleendian(&t3, 8);\ - rshift32_littleendian(&t4, 8);\ - rshift32_littleendian(&t5, 8);\ - rshift32_littleendian(&t6, 8);\ - rshift32_littleendian(&t7, 8);\ - ;\ - xor2(&b0, &t0);\ - xor2(&b1, &t1);\ - xor2(&b4, &t2);\ - xor2(&b6, &t3);\ - xor2(&b3, &t4);\ - xor2(&b7, &t5);\ - xor2(&b2, &t6);\ - xor2(&b5, &t7);\ - ;\ - rshift32_littleendian(&t0, 8);\ - rshift32_littleendian(&t1, 8);\ - rshift32_littleendian(&t2, 8);\ - rshift32_littleendian(&t3, 8);\ - rshift32_littleendian(&t4, 8);\ - rshift32_littleendian(&t5, 8);\ - rshift32_littleendian(&t6, 8);\ - rshift32_littleendian(&t7, 8);\ - ;\ - xor2(&b0, &t0);\ - xor2(&b1, &t1);\ - xor2(&b4, &t2);\ - xor2(&b6, &t3);\ - xor2(&b3, &t4);\ - xor2(&b7, &t5);\ - xor2(&b2, &t6);\ - xor2(&b5, &t7);\ - ;\ - shufb(&b0, M0);\ - shufb(&b1, M0);\ - shufb(&b2, M0);\ - shufb(&b3, M0);\ - shufb(&b4, M0);\ - shufb(&b5, M0);\ - shufb(&b6, M0);\ - shufb(&b7, M0);\ - ;\ - *(int128 *)(bskey + 1280) = b0;\ - *(int128 *)(bskey + 1296) = b1;\ - *(int128 *)(bskey + 1312) = b4;\ - *(int128 *)(bskey + 1328) = b6;\ - *(int128 *)(bskey + 1344) = b3;\ - *(int128 *)(bskey + 1360) = b7;\ - *(int128 *)(bskey + 1376) = b2;\ - *(int128 *)(bskey + 1392) = b5;\ - - -#define keyexpbs(b0, b1, b2, b3, b4, b5, b6, b7, t0, t1, t2, t3, t4, t5, t6, t7, rcon, i, bskey) \ - toggle(&b0);\ - toggle(&b1);\ - toggle(&b5);\ - toggle(&b6);\ - rotbyte(&b0);\ - rotbyte(&b1);\ - rotbyte(&b2);\ - rotbyte(&b3);\ - rotbyte(&b4);\ - rotbyte(&b5);\ - rotbyte(&b6);\ - rotbyte(&b7);\ - ;\ - sbox(b0, b1, b2, b3, b4, b5, b6, b7, t0, t1, t2, t3, t4, t5, t6, t7);\ - ;\ - rcon;\ - shufb(&b0, EXPB0);\ - shufb(&b1, EXPB0);\ - shufb(&b4, EXPB0);\ - shufb(&b6, EXPB0);\ - shufb(&b3, EXPB0);\ - shufb(&b7, EXPB0);\ - shufb(&b2, EXPB0);\ - shufb(&b5, EXPB0);\ - ;\ - t0 = *(int128 *)(bskey + (i-1) * 128 + 0);\ - t1 = *(int128 *)(bskey + (i-1) * 128 + 16);\ - t2 = *(int128 *)(bskey + (i-1) * 128 + 32);\ - t3 = *(int128 *)(bskey + (i-1) * 128 + 48);\ - t4 = *(int128 *)(bskey + (i-1) * 128 + 64);\ - t5 = *(int128 *)(bskey + (i-1) * 128 + 80);\ - t6 = *(int128 *)(bskey + (i-1) * 128 + 96);\ - t7 = *(int128 *)(bskey + (i-1) * 128 + 112);\ - ;\ - toggle(&t0);\ - toggle(&t1);\ - toggle(&t5);\ - toggle(&t6);\ - ;\ - xor2(&b0, &t0);\ - xor2(&b1, &t1);\ - xor2(&b4, &t2);\ - xor2(&b6, &t3);\ - xor2(&b3, &t4);\ - xor2(&b7, &t5);\ - xor2(&b2, &t6);\ - xor2(&b5, &t7);\ - ;\ - rshift32_littleendian(&t0, 8);\ - rshift32_littleendian(&t1, 8);\ - rshift32_littleendian(&t2, 8);\ - rshift32_littleendian(&t3, 8);\ - rshift32_littleendian(&t4, 8);\ - rshift32_littleendian(&t5, 8);\ - rshift32_littleendian(&t6, 8);\ - rshift32_littleendian(&t7, 8);\ - ;\ - xor2(&b0, &t0);\ - xor2(&b1, &t1);\ - xor2(&b4, &t2);\ - xor2(&b6, &t3);\ - xor2(&b3, &t4);\ - xor2(&b7, &t5);\ - xor2(&b2, &t6);\ - xor2(&b5, &t7);\ - ;\ - rshift32_littleendian(&t0, 8);\ - rshift32_littleendian(&t1, 8);\ - rshift32_littleendian(&t2, 8);\ - rshift32_littleendian(&t3, 8);\ - rshift32_littleendian(&t4, 8);\ - rshift32_littleendian(&t5, 8);\ - rshift32_littleendian(&t6, 8);\ - rshift32_littleendian(&t7, 8);\ - ;\ - xor2(&b0, &t0);\ - xor2(&b1, &t1);\ - xor2(&b4, &t2);\ - xor2(&b6, &t3);\ - xor2(&b3, &t4);\ - xor2(&b7, &t5);\ - xor2(&b2, &t6);\ - xor2(&b5, &t7);\ - ;\ - rshift32_littleendian(&t0, 8);\ - rshift32_littleendian(&t1, 8);\ - rshift32_littleendian(&t2, 8);\ - rshift32_littleendian(&t3, 8);\ - rshift32_littleendian(&t4, 8);\ - rshift32_littleendian(&t5, 8);\ - rshift32_littleendian(&t6, 8);\ - rshift32_littleendian(&t7, 8);\ - ;\ - xor2(&b0, &t0);\ - xor2(&b1, &t1);\ - xor2(&b4, &t2);\ - xor2(&b6, &t3);\ - xor2(&b3, &t4);\ - xor2(&b7, &t5);\ - xor2(&b2, &t6);\ - xor2(&b5, &t7);\ - ;\ - *(int128 *)(bskey + i*128 + 0) = b0;\ - *(int128 *)(bskey + i*128 + 16) = b1;\ - *(int128 *)(bskey + i*128 + 32) = b4;\ - *(int128 *)(bskey + i*128 + 48) = b6;\ - *(int128 *)(bskey + i*128 + 64) = b3;\ - *(int128 *)(bskey + i*128 + 80) = b7;\ - *(int128 *)(bskey + i*128 + 96) = b2;\ - *(int128 *)(bskey + i*128 + 112) = b5;\ - -/* Macros used in multiple contexts */ - -#define bitslicekey0(key, bskey) \ - xmm0 = *(int128 *) (key + 0);\ - shufb(&xmm0, M0);\ - copy2(&xmm1, &xmm0);\ - copy2(&xmm2, &xmm0);\ - copy2(&xmm3, &xmm0);\ - copy2(&xmm4, &xmm0);\ - copy2(&xmm5, &xmm0);\ - copy2(&xmm6, &xmm0);\ - copy2(&xmm7, &xmm0);\ - ;\ - bitslice(xmm7, xmm6, xmm5, xmm4, xmm3, xmm2, xmm1, xmm0, t);\ - ;\ - *(int128 *) (bskey + 0) = xmm0;\ - *(int128 *) (bskey + 16) = xmm1;\ - *(int128 *) (bskey + 32) = xmm2;\ - *(int128 *) (bskey + 48) = xmm3;\ - *(int128 *) (bskey + 64) = xmm4;\ - *(int128 *) (bskey + 80) = xmm5;\ - *(int128 *) (bskey + 96) = xmm6;\ - *(int128 *) (bskey + 112) = xmm7;\ - - -#define bitslicekey10(key, bskey) \ - xmm0 = *(int128 *) (key + 0);\ - copy2(xmm1, xmm0);\ - copy2(xmm2, xmm0);\ - copy2(xmm3, xmm0);\ - copy2(xmm4, xmm0);\ - copy2(xmm5, xmm0);\ - copy2(xmm6, xmm0);\ - copy2(xmm7, xmm0);\ - ;\ - bitslice(xmm7, xmm6, xmm5, xmm4, xmm3, xmm2, xmm1, xmm0, t);\ - ;\ - toggle(&xmm6);\ - toggle(&xmm5);\ - toggle(&xmm1);\ - toggle(&xmm0);\ - ;\ - *(int128 *) (bskey + 0 + 1280) = xmm0;\ - *(int128 *) (bskey + 16 + 1280) = xmm1;\ - *(int128 *) (bskey + 32 + 1280) = xmm2;\ - *(int128 *) (bskey + 48 + 1280) = xmm3;\ - *(int128 *) (bskey + 64 + 1280) = xmm4;\ - *(int128 *) (bskey + 80 + 1280) = xmm5;\ - *(int128 *) (bskey + 96 + 1280) = xmm6;\ - *(int128 *) (bskey + 112 + 1280) = xmm7;\ - - -#define bitslicekey(i,key,bskey) \ - xmm0 = *(int128 *) (key + 0);\ - shufb(&xmm0, M0);\ - copy2(&xmm1, &xmm0);\ - copy2(&xmm2, &xmm0);\ - copy2(&xmm3, &xmm0);\ - copy2(&xmm4, &xmm0);\ - copy2(&xmm5, &xmm0);\ - copy2(&xmm6, &xmm0);\ - copy2(&xmm7, &xmm0);\ - ;\ - bitslice(xmm7, xmm6, xmm5, xmm4, xmm3, xmm2, xmm1, xmm0, t);\ - ;\ - toggle(&xmm6);\ - toggle(&xmm5);\ - toggle(&xmm1);\ - toggle(&xmm0);\ - ;\ - *(int128 *) (bskey + 0 + 128*i) = xmm0;\ - *(int128 *) (bskey + 16 + 128*i) = xmm1;\ - *(int128 *) (bskey + 32 + 128*i) = xmm2;\ - *(int128 *) (bskey + 48 + 128*i) = xmm3;\ - *(int128 *) (bskey + 64 + 128*i) = xmm4;\ - *(int128 *) (bskey + 80 + 128*i) = xmm5;\ - *(int128 *) (bskey + 96 + 128*i) = xmm6;\ - *(int128 *) (bskey + 112 + 128*i) = xmm7;\ - - -#define bitslice(x0, x1, x2, x3, x4, x5, x6, x7, t) \ - swapmove(x0, x1, 1, BS0, t);\ - swapmove(x2, x3, 1, BS0, t);\ - swapmove(x4, x5, 1, BS0, t);\ - swapmove(x6, x7, 1, BS0, t);\ - ;\ - swapmove(x0, x2, 2, BS1, t);\ - swapmove(x1, x3, 2, BS1, t);\ - swapmove(x4, x6, 2, BS1, t);\ - swapmove(x5, x7, 2, BS1, t);\ - ;\ - swapmove(x0, x4, 4, BS2, t);\ - swapmove(x1, x5, 4, BS2, t);\ - swapmove(x2, x6, 4, BS2, t);\ - swapmove(x3, x7, 4, BS2, t);\ - - -#define swapmove(a, b, n, m, t) \ - copy2(&t, &b);\ - rshift64_littleendian(&t, n);\ - xor2(&t, &a);\ - and2(&t, &m);\ - xor2(&a, &t);\ - lshift64_littleendian(&t, n);\ - xor2(&b, &t); - -#define rotbyte(x) \ - shufb(x, ROTB) /* TODO: Make faster */ - - -/* Macros used for encryption (and decryption) */ - -#define shiftrows(x0, x1, x2, x3, x4, x5, x6, x7, i, M, bskey) \ - xor2(&x0, (int128 *)(bskey + 128*(i-1) + 0));\ - shufb(&x0, M);\ - xor2(&x1, (int128 *)(bskey + 128*(i-1) + 16));\ - shufb(&x1, M);\ - xor2(&x2, (int128 *)(bskey + 128*(i-1) + 32));\ - shufb(&x2, M);\ - xor2(&x3, (int128 *)(bskey + 128*(i-1) + 48));\ - shufb(&x3, M);\ - xor2(&x4, (int128 *)(bskey + 128*(i-1) + 64));\ - shufb(&x4, M);\ - xor2(&x5, (int128 *)(bskey + 128*(i-1) + 80));\ - shufb(&x5, M);\ - xor2(&x6, (int128 *)(bskey + 128*(i-1) + 96));\ - shufb(&x6, M);\ - xor2(&x7, (int128 *)(bskey + 128*(i-1) + 112));\ - shufb(&x7, M);\ - - -#define mixcolumns(x0, x1, x2, x3, x4, x5, x6, x7, t0, t1, t2, t3, t4, t5, t6, t7) \ - shufd(&t0, &x0, 0x93);\ - shufd(&t1, &x1, 0x93);\ - shufd(&t2, &x2, 0x93);\ - shufd(&t3, &x3, 0x93);\ - shufd(&t4, &x4, 0x93);\ - shufd(&t5, &x5, 0x93);\ - shufd(&t6, &x6, 0x93);\ - shufd(&t7, &x7, 0x93);\ - ;\ - xor2(&x0, &t0);\ - xor2(&x1, &t1);\ - xor2(&x2, &t2);\ - xor2(&x3, &t3);\ - xor2(&x4, &t4);\ - xor2(&x5, &t5);\ - xor2(&x6, &t6);\ - xor2(&x7, &t7);\ - ;\ - xor2(&t0, &x7);\ - xor2(&t1, &x0);\ - xor2(&t2, &x1);\ - xor2(&t1, &x7);\ - xor2(&t3, &x2);\ - xor2(&t4, &x3);\ - xor2(&t5, &x4);\ - xor2(&t3, &x7);\ - xor2(&t6, &x5);\ - xor2(&t7, &x6);\ - xor2(&t4, &x7);\ - ;\ - shufd(&x0, &x0, 0x4e);\ - shufd(&x1, &x1, 0x4e);\ - shufd(&x2, &x2, 0x4e);\ - shufd(&x3, &x3, 0x4e);\ - shufd(&x4, &x4, 0x4e);\ - shufd(&x5, &x5, 0x4e);\ - shufd(&x6, &x6, 0x4e);\ - shufd(&x7, &x7, 0x4e);\ - ;\ - xor2(&t0, &x0);\ - xor2(&t1, &x1);\ - xor2(&t2, &x2);\ - xor2(&t3, &x3);\ - xor2(&t4, &x4);\ - xor2(&t5, &x5);\ - xor2(&t6, &x6);\ - xor2(&t7, &x7);\ - - -#define aesround(i, b0, b1, b2, b3, b4, b5, b6, b7, t0, t1, t2, t3, t4, t5, t6, t7, bskey) \ - shiftrows(b0, b1, b2, b3, b4, b5, b6, b7, i, SR, bskey);\ - sbox(b0, b1, b2, b3, b4, b5, b6, b7, t0, t1, t2, t3, t4, t5, t6, t7);\ - mixcolumns(b0, b1, b4, b6, b3, b7, b2, b5, t0, t1, t2, t3, t4, t5, t6, t7);\ - - -#define lastround(b0, b1, b2, b3, b4, b5, b6, b7, t0, t1, t2, t3, t4, t5, t6, t7, bskey) \ - shiftrows(b0, b1, b2, b3, b4, b5, b6, b7, 10, SRM0, bskey);\ - sbox(b0, b1, b2, b3, b4, b5, b6, b7, t0, t1, t2, t3, t4, t5, t6, t7);\ - xor2(&b0,(int128 *)(bskey + 128*10));\ - xor2(&b1,(int128 *)(bskey + 128*10+16));\ - xor2(&b4,(int128 *)(bskey + 128*10+32));\ - xor2(&b6,(int128 *)(bskey + 128*10+48));\ - xor2(&b3,(int128 *)(bskey + 128*10+64));\ - xor2(&b7,(int128 *)(bskey + 128*10+80));\ - xor2(&b2,(int128 *)(bskey + 128*10+96));\ - xor2(&b5,(int128 *)(bskey + 128*10+112));\ - - -#define sbox(b0, b1, b2, b3, b4, b5, b6, b7, t0, t1, t2, t3, s0, s1, s2, s3) \ - InBasisChange(b0, b1, b2, b3, b4, b5, b6, b7); \ - Inv_GF256(b6, b5, b0, b3, b7, b1, b4, b2, t0, t1, t2, t3, s0, s1, s2, s3); \ - OutBasisChange(b7, b1, b4, b2, b6, b5, b0, b3); \ - - -#define InBasisChange(b0, b1, b2, b3, b4, b5, b6, b7) \ - xor2(&b5, &b6);\ - xor2(&b2, &b1);\ - xor2(&b5, &b0);\ - xor2(&b6, &b2);\ - xor2(&b3, &b0);\ - ;\ - xor2(&b6, &b3);\ - xor2(&b3, &b7);\ - xor2(&b3, &b4);\ - xor2(&b7, &b5);\ - xor2(&b3, &b1);\ - ;\ - xor2(&b4, &b5);\ - xor2(&b2, &b7);\ - xor2(&b1, &b5);\ - -#define OutBasisChange(b0, b1, b2, b3, b4, b5, b6, b7) \ - xor2(&b0, &b6);\ - xor2(&b1, &b4);\ - xor2(&b2, &b0);\ - xor2(&b4, &b6);\ - xor2(&b6, &b1);\ - ;\ - xor2(&b1, &b5);\ - xor2(&b5, &b3);\ - xor2(&b2, &b5);\ - xor2(&b3, &b7);\ - xor2(&b7, &b5);\ - ;\ - xor2(&b4, &b7);\ - -#define Mul_GF4(x0, x1, y0, y1, t0) \ - copy2(&t0, &y0);\ - xor2(&t0, &y1);\ - and2(&t0, &x0);\ - xor2(&x0, &x1);\ - and2(&x0, &y1);\ - and2(&x1, &y0);\ - xor2(&x0, &x1);\ - xor2(&x1, &t0);\ - -#define Mul_GF4_N(x0, x1, y0, y1, t0) \ - copy2(&t0, &y0);\ - xor2(&t0, &y1);\ - and2(&t0, &x0);\ - xor2(&x0, &x1);\ - and2(&x0, &y1);\ - and2(&x1, &y0);\ - xor2(&x1, &x0);\ - xor2(&x0, &t0);\ - -#define Mul_GF4_2(x0, x1, x2, x3, y0, y1, t0, t1) \ - copy2(&t0, = y0);\ - xor2(&t0, &y1);\ - copy2(&t1, &t0);\ - and2(&t0, &x0);\ - and2(&t1, &x2);\ - xor2(&x0, &x1);\ - xor2(&x2, &x3);\ - and2(&x0, &y1);\ - and2(&x2, &y1);\ - and2(&x1, &y0);\ - and2(&x3, &y0);\ - xor2(&x0, &x1);\ - xor2(&x2, &x3);\ - xor2(&x1, &t0);\ - xor2(&x3, &t1);\ - -#define Mul_GF16(x0, x1, x2, x3, y0, y1, y2, y3, t0, t1, t2, t3) \ - copy2(&t0, &x0);\ - copy2(&t1, &x1);\ - Mul_GF4(x0, x1, y0, y1, t2);\ - xor2(&t0, &x2);\ - xor2(&t1, &x3);\ - xor2(&y0, &y2);\ - xor2(&y1, &y3);\ - Mul_GF4_N(t0, t1, y0, y1, t2);\ - Mul_GF4(x2, x3, y2, y3, t3);\ - ;\ - xor2(&x0, &t0);\ - xor2(&x2, &t0);\ - xor2(&x1, &t1);\ - xor2(&x3, &t1);\ - -#define Mul_GF16_2(x0, x1, x2, x3, x4, x5, x6, x7, y0, y1, y2, y3, t0, t1, t2, t3) \ - copy2(&t0, &x0);\ - copy2(&t1, &x1);\ - Mul_GF4(x0, x1, y0, y1, t2);\ - xor2(&t0, &x2);\ - xor2(&t1, &x3);\ - xor2(&y0, &y2);\ - xor2(&y1, &y3);\ - Mul_GF4_N(t0, t1, y0, y1, t3);\ - Mul_GF4(x2, x3, y2, y3, t2);\ - ;\ - xor2(&x0, &t0);\ - xor2(&x2, &t0);\ - xor2(&x1, &t1);\ - xor2(&x3, &t1);\ - ;\ - copy2(&t0, &x4);\ - copy2(&t1, &x5);\ - xor2(&t0, &x6);\ - xor2(&t1, &x7);\ - Mul_GF4_N(t0, t1, y0, y1, t3);\ - Mul_GF4(x6, x7, y2, y3, t2);\ - xor2(&y0, &y2);\ - xor2(&y1, &y3);\ - Mul_GF4(x4, x5, y0, y1, t3);\ - ;\ - xor2(&x4, &t0);\ - xor2(&x6, &t0);\ - xor2(&x5, &t1);\ - xor2(&x7, &t1);\ - -#define Inv_GF16(x0, x1, x2, x3, t0, t1, t2, t3) \ - copy2(&t0, &x1);\ - copy2(&t1, &x0);\ - and2(&t0, &x3);\ - or2(&t1, &x2);\ - copy2(&t2, &x1);\ - copy2(&t3, &x0);\ - or2(&t2, &x2);\ - or2(&t3, &x3);\ - xor2(&t2, &t3);\ - ;\ - xor2(&t0, &t2);\ - xor2(&t1, &t2);\ - ;\ - Mul_GF4_2(x0, x1, x2, x3, t1, t0, t2, t3);\ - - -#define Inv_GF256(x0, x1, x2, x3, x4, x5, x6, x7, t0, t1, t2, t3, s0, s1, s2, s3) \ - copy2(&t3, &x4);\ - copy2(&t2, &x5);\ - copy2(&t1, &x1);\ - copy2(&s1, &x7);\ - copy2(&s0, &x0);\ - ;\ - xor2(&t3, &x6);\ - xor2(&t2, &x7);\ - xor2(&t1, &x3);\ - xor2(&s1, &x6);\ - xor2(&s0, &x2);\ - ;\ - copy2(&s2, &t3);\ - copy2(&t0, &t2);\ - copy2(&s3, &t3);\ - ;\ - or2(&t2, &t1);\ - or2(&t3, &s0);\ - xor2(&s3, &t0);\ - and2(&s2, &s0);\ - and2(&t0, &t1);\ - xor2(&s0, &t1);\ - and2(&s3, &s0);\ - copy2(&s0, &x3);\ - xor2(&s0, &x2);\ - and2(&s1, &s0);\ - xor2(&t3, &s1);\ - xor2(&t2, &s1);\ - copy2(&s1, &x4);\ - xor2(&s1, &x5);\ - copy2(&s0, &x1);\ - copy2(&t1, &s1);\ - xor2(&s0, &x0);\ - or2(&t1, &s0);\ - and2(&s1, &s0);\ - xor2(&t0, &s1);\ - xor2(&t3, &s3);\ - xor2(&t2, &s2);\ - xor2(&t1, &s3);\ - xor2(&t0, &s2);\ - xor2(&t1, &s2);\ - copy2(&s0, &x7);\ - copy2(&s1, &x6);\ - copy2(&s2, &x5);\ - copy2(&s3, &x4);\ - and2(&s0, &x3);\ - and2(&s1, &x2);\ - and2(&s2, &x1);\ - or2(&s3, &x0);\ - xor2(&t3, &s0);\ - xor2(&t2, &s1);\ - xor2(&t1, &s2);\ - xor2(&t0, &s3);\ - ;\ - copy2(&s0, &t3);\ - xor2(&s0, &t2);\ - and2(&t3, &t1);\ - copy2(&s2, &t0);\ - xor2(&s2, &t3);\ - copy2(&s3, &s0);\ - and2(&s3, &s2);\ - xor2(&s3, &t2);\ - copy2(&s1, &t1);\ - xor2(&s1, &t0);\ - xor2(&t3, &t2);\ - and2(&s1, &t3);\ - xor2(&s1, &t0);\ - xor2(&t1, &s1);\ - copy2(&t2, &s2);\ - xor2(&t2, &s1);\ - and2(&t2, &t0);\ - xor2(&t1, &t2);\ - xor2(&s2, &t2);\ - and2(&s2, &s3);\ - xor2(&s2, &s0);\ - ;\ - Mul_GF16_2(x0, x1, x2, x3, x4, x5, x6, x7, s3, s2, s1, t1, s0, t0, t2, t3);\ - -#endif diff --git a/src/libnacl/crypto_stream/aes128ctr/portable/consts.c b/src/libnacl/crypto_stream/aes128ctr/portable/consts.c deleted file mode 100644 index 72296c04..00000000 --- a/src/libnacl/crypto_stream/aes128ctr/portable/consts.c +++ /dev/null @@ -1,14 +0,0 @@ -#include "consts.h" - -const unsigned char ROTB[16] = {0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08}; -const unsigned char M0[16] = {0x0f, 0x0b, 0x07, 0x03, 0x0e, 0x0a, 0x06, 0x02, 0x0d, 0x09, 0x05, 0x01, 0x0c, 0x08, 0x04, 0x00}; -const unsigned char EXPB0[16] = {0x03, 0x03, 0x03, 0x03, 0x07, 0x07, 0x07, 0x07, 0x0b, 0x0b, 0x0b, 0x0b, 0x0f, 0x0f, 0x0f, 0x0f}; - -const unsigned char SWAP32[16] = {0x03, 0x02, 0x01, 0x00, 0x07, 0x06, 0x05, 0x04, 0x0b, 0x0a, 0x09, 0x08, 0x0f, 0x0e, 0x0d, 0x0c}; -const unsigned char M0SWAP[16] = {0x0c, 0x08, 0x04, 0x00, 0x0d, 0x09, 0x05, 0x01, 0x0e, 0x0a, 0x06, 0x02, 0x0f, 0x0b, 0x07, 0x03}; -const unsigned char SR[16] = {0x01, 0x02, 0x03, 0x00, 0x06, 0x07, 0x04, 0x05, 0x0b, 0x08, 0x09, 0x0a, 0x0c, 0x0d, 0x0e, 0x0f}; -const unsigned char SRM0[16] = {0x0f, 0x0a, 0x05, 0x00, 0x0e, 0x09, 0x04, 0x03, 0x0d, 0x08, 0x07, 0x02, 0x0c, 0x0b, 0x06, 0x01}; - -const int128 BS0 = {0x5555555555555555ULL, 0x5555555555555555ULL}; -const int128 BS1 = {0x3333333333333333ULL, 0x3333333333333333ULL}; -const int128 BS2 = {0x0f0f0f0f0f0f0f0fULL, 0x0f0f0f0f0f0f0f0fULL}; diff --git a/src/libnacl/crypto_stream/aes128ctr/portable/consts.h b/src/libnacl/crypto_stream/aes128ctr/portable/consts.h deleted file mode 100644 index 4c50360b..00000000 --- a/src/libnacl/crypto_stream/aes128ctr/portable/consts.h +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef CONSTS_H -#define CONSTS_H - -#include "int128.h" - -#define ROTB crypto_stream_aes128ctr_portable_ROTB -#define M0 crypto_stream_aes128ctr_portable_M0 -#define EXPB0 crypto_stream_aes128ctr_portable_EXPB0 -#define SWAP32 crypto_stream_aes128ctr_portable_SWAP32 -#define M0SWAP crypto_stream_aes128ctr_portable_M0SWAP -#define SR crypto_stream_aes128ctr_portable_SR -#define SRM0 crypto_stream_aes128ctr_portable_SRM0 -#define BS0 crypto_stream_aes128ctr_portable_BS0 -#define BS1 crypto_stream_aes128ctr_portable_BS1 -#define BS2 crypto_stream_aes128ctr_portable_BS2 - -extern const unsigned char ROTB[16]; -extern const unsigned char M0[16]; -extern const unsigned char EXPB0[16]; -extern const unsigned char SWAP32[16]; -extern const unsigned char M0SWAP[16]; -extern const unsigned char SR[16]; -extern const unsigned char SRM0[16]; -extern const int128 BS0; -extern const int128 BS1; -extern const int128 BS2; - -#endif diff --git a/src/libnacl/crypto_stream/aes128ctr/portable/int128.c b/src/libnacl/crypto_stream/aes128ctr/portable/int128.c deleted file mode 100644 index 25894d42..00000000 --- a/src/libnacl/crypto_stream/aes128ctr/portable/int128.c +++ /dev/null @@ -1,128 +0,0 @@ -#include "int128.h" -#include "common.h" - -void xor2(int128 *r, const int128 *x) -{ - r->a ^= x->a; - r->b ^= x->b; -} - -void and2(int128 *r, const int128 *x) -{ - r->a &= x->a; - r->b &= x->b; -} - -void or2(int128 *r, const int128 *x) -{ - r->a |= x->a; - r->b |= x->b; -} - -void copy2(int128 *r, const int128 *x) -{ - r->a = x->a; - r->b = x->b; -} - -void shufb(int128 *r, const unsigned char *l) -{ - int128 t; - copy2(&t,r); - unsigned char *cr = (unsigned char *)r; - unsigned char *ct = (unsigned char *)&t; - cr[0] = ct[l[0]]; - cr[1] = ct[l[1]]; - cr[2] = ct[l[2]]; - cr[3] = ct[l[3]]; - cr[4] = ct[l[4]]; - cr[5] = ct[l[5]]; - cr[6] = ct[l[6]]; - cr[7] = ct[l[7]]; - cr[8] = ct[l[8]]; - cr[9] = ct[l[9]]; - cr[10] = ct[l[10]]; - cr[11] = ct[l[11]]; - cr[12] = ct[l[12]]; - cr[13] = ct[l[13]]; - cr[14] = ct[l[14]]; - cr[15] = ct[l[15]]; -} - -void shufd(int128 *r, const int128 *x, const unsigned int c) -{ - int128 t; - uint32 *tp = (uint32 *)&t; - uint32 *xp = (uint32 *)x; - tp[0] = xp[c&3]; - tp[1] = xp[(c>>2)&3]; - tp[2] = xp[(c>>4)&3]; - tp[3] = xp[(c>>6)&3]; - copy2(r,&t); -} - -void rshift32_littleendian(int128 *r, const unsigned int n) -{ - unsigned char *rp = (unsigned char *)r; - uint32 t; - t = load32_littleendian(rp); - t >>= n; - store32_littleendian(rp, t); - t = load32_littleendian(rp+4); - t >>= n; - store32_littleendian(rp+4, t); - t = load32_littleendian(rp+8); - t >>= n; - store32_littleendian(rp+8, t); - t = load32_littleendian(rp+12); - t >>= n; - store32_littleendian(rp+12, t); -} - -void rshift64_littleendian(int128 *r, const unsigned int n) -{ - unsigned char *rp = (unsigned char *)r; - uint64 t; - t = load64_littleendian(rp); - t >>= n; - store64_littleendian(rp, t); - t = load64_littleendian(rp+8); - t >>= n; - store64_littleendian(rp+8, t); -} - -void lshift64_littleendian(int128 *r, const unsigned int n) -{ - unsigned char *rp = (unsigned char *)r; - uint64 t; - t = load64_littleendian(rp); - t <<= n; - store64_littleendian(rp, t); - t = load64_littleendian(rp+8); - t <<= n; - store64_littleendian(rp+8, t); -} - -void toggle(int128 *r) -{ - r->a ^= 0xffffffffffffffffULL; - r->b ^= 0xffffffffffffffffULL; -} - -void xor_rcon(int128 *r) -{ - unsigned char *rp = (unsigned char *)r; - uint32 t; - t = load32_littleendian(rp+12); - t ^= 0xffffffff; - store32_littleendian(rp+12, t); -} - -void add_uint32_big(int128 *r, uint32 x) -{ - unsigned char *rp = (unsigned char *)r; - uint32 t; - t = load32_littleendian(rp+12); - t += x; - store32_littleendian(rp+12, t); -} diff --git a/src/libnacl/crypto_stream/aes128ctr/portable/int128.h b/src/libnacl/crypto_stream/aes128ctr/portable/int128.h deleted file mode 100644 index 7099e5b1..00000000 --- a/src/libnacl/crypto_stream/aes128ctr/portable/int128.h +++ /dev/null @@ -1,47 +0,0 @@ -#ifndef INT128_H -#define INT128_H - -#include "common.h" - -typedef struct{ - unsigned long long a; - unsigned long long b; -} int128; - -#define xor2 crypto_stream_aes128ctr_portable_xor2 -void xor2(int128 *r, const int128 *x); - -#define and2 crypto_stream_aes128ctr_portable_and2 -void and2(int128 *r, const int128 *x); - -#define or2 crypto_stream_aes128ctr_portable_or2 -void or2(int128 *r, const int128 *x); - -#define copy2 crypto_stream_aes128ctr_portable_copy2 -void copy2(int128 *r, const int128 *x); - -#define shufb crypto_stream_aes128ctr_portable_shufb -void shufb(int128 *r, const unsigned char *l); - -#define shufd crypto_stream_aes128ctr_portable_shufd -void shufd(int128 *r, const int128 *x, const unsigned int c); - -#define rshift32_littleendian crypto_stream_aes128ctr_portable_rshift32_littleendian -void rshift32_littleendian(int128 *r, const unsigned int n); - -#define rshift64_littleendian crypto_stream_aes128ctr_portable_rshift64_littleendian -void rshift64_littleendian(int128 *r, const unsigned int n); - -#define lshift64_littleendian crypto_stream_aes128ctr_portable_lshift64_littleendian -void lshift64_littleendian(int128 *r, const unsigned int n); - -#define toggle crypto_stream_aes128ctr_portable_toggle -void toggle(int128 *r); - -#define xor_rcon crypto_stream_aes128ctr_portable_xor_rcon -void xor_rcon(int128 *r); - -#define add_uint32_big crypto_stream_aes128ctr_portable_add_uint32_big -void add_uint32_big(int128 *r, uint32 x); - -#endif diff --git a/src/libnacl/crypto_stream/aes128ctr/portable/stream.c b/src/libnacl/crypto_stream/aes128ctr/portable/stream.c deleted file mode 100644 index 963fa8c1..00000000 --- a/src/libnacl/crypto_stream/aes128ctr/portable/stream.c +++ /dev/null @@ -1,28 +0,0 @@ -#include "crypto_stream.h" - -int crypto_stream( - unsigned char *out, - unsigned long long outlen, - const unsigned char *n, - const unsigned char *k - ) -{ - unsigned char d[crypto_stream_BEFORENMBYTES]; - crypto_stream_beforenm(d, k); - crypto_stream_afternm(out, outlen, n, d); - return 0; -} - -int crypto_stream_xor( - unsigned char *out, - const unsigned char *in, - unsigned long long inlen, - const unsigned char *n, - const unsigned char *k - ) -{ - unsigned char d[crypto_stream_BEFORENMBYTES]; - crypto_stream_beforenm(d, k); - crypto_stream_xor_afternm(out, in, inlen, n, d); - return 0; -} diff --git a/src/libnacl/crypto_stream/aes128ctr/portable/types.h b/src/libnacl/crypto_stream/aes128ctr/portable/types.h deleted file mode 100644 index 6aa502fc..00000000 --- a/src/libnacl/crypto_stream/aes128ctr/portable/types.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef TYPES_H -#define TYPES_H - -#include "crypto_uint32.h" -typedef crypto_uint32 uint32; - -#include "crypto_uint64.h" -typedef crypto_uint64 uint64; - -#endif diff --git a/src/libnacl/crypto_stream/aes128ctr/portable/xor_afternm.c b/src/libnacl/crypto_stream/aes128ctr/portable/xor_afternm.c deleted file mode 100644 index f2ff8ff6..00000000 --- a/src/libnacl/crypto_stream/aes128ctr/portable/xor_afternm.c +++ /dev/null @@ -1,180 +0,0 @@ -/* Author: Peter Schwabe, ported from an assembly implementation by Emilia Käsper - * Date: 2009-03-19 - * Public domain */ - -#include -#include "int128.h" -#include "common.h" -#include "consts.h" -#include "crypto_stream.h" - -int crypto_stream_xor_afternm(unsigned char *outp, const unsigned char *inp, unsigned long long len, const unsigned char *noncep, const unsigned char *c) -{ - - int128 xmm0; - int128 xmm1; - int128 xmm2; - int128 xmm3; - int128 xmm4; - int128 xmm5; - int128 xmm6; - int128 xmm7; - - int128 xmm8; - int128 xmm9; - int128 xmm10; - int128 xmm11; - int128 xmm12; - int128 xmm13; - int128 xmm14; - int128 xmm15; - - int128 nonce_stack; - unsigned long long lensav; - unsigned char bl[128]; - unsigned char *blp; - unsigned char b; - - uint32 tmp; - - /* Copy nonce on the stack */ - copy2(&nonce_stack, (int128 *) (noncep + 0)); - unsigned char *np = (unsigned char *)&nonce_stack; - - enc_block: - - xmm0 = *(int128 *) (np + 0); - copy2(&xmm1, &xmm0); - shufb(&xmm1, SWAP32); - copy2(&xmm2, &xmm1); - copy2(&xmm3, &xmm1); - copy2(&xmm4, &xmm1); - copy2(&xmm5, &xmm1); - copy2(&xmm6, &xmm1); - copy2(&xmm7, &xmm1); - - add_uint32_big(&xmm1, 1); - add_uint32_big(&xmm2, 2); - add_uint32_big(&xmm3, 3); - add_uint32_big(&xmm4, 4); - add_uint32_big(&xmm5, 5); - add_uint32_big(&xmm6, 6); - add_uint32_big(&xmm7, 7); - - shufb(&xmm0, M0); - shufb(&xmm1, M0SWAP); - shufb(&xmm2, M0SWAP); - shufb(&xmm3, M0SWAP); - shufb(&xmm4, M0SWAP); - shufb(&xmm5, M0SWAP); - shufb(&xmm6, M0SWAP); - shufb(&xmm7, M0SWAP); - - bitslice(xmm7, xmm6, xmm5, xmm4, xmm3, xmm2, xmm1, xmm0, xmm8) - - aesround( 1, xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15,c) - aesround( 2, xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15, xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7,c) - aesround( 3, xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15,c) - aesround( 4, xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15, xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7,c) - aesround( 5, xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15,c) - aesround( 6, xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15, xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7,c) - aesround( 7, xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15,c) - aesround( 8, xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15, xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7,c) - aesround( 9, xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15,c) - lastround(xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15, xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7,c) - - bitslice(xmm13, xmm10, xmm15, xmm11, xmm14, xmm12, xmm9, xmm8, xmm0) - - if(len < 128) goto partial; - if(len == 128) goto full; - - tmp = load32_bigendian(np + 12); - tmp += 8; - store32_bigendian(np + 12, tmp); - - xor2(&xmm8, (int128 *)(inp + 0)); - xor2(&xmm9, (int128 *)(inp + 16)); - xor2(&xmm12, (int128 *)(inp + 32)); - xor2(&xmm14, (int128 *)(inp + 48)); - xor2(&xmm11, (int128 *)(inp + 64)); - xor2(&xmm15, (int128 *)(inp + 80)); - xor2(&xmm10, (int128 *)(inp + 96)); - xor2(&xmm13, (int128 *)(inp + 112)); - - *(int128 *) (outp + 0) = xmm8; - *(int128 *) (outp + 16) = xmm9; - *(int128 *) (outp + 32) = xmm12; - *(int128 *) (outp + 48) = xmm14; - *(int128 *) (outp + 64) = xmm11; - *(int128 *) (outp + 80) = xmm15; - *(int128 *) (outp + 96) = xmm10; - *(int128 *) (outp + 112) = xmm13; - - len -= 128; - inp += 128; - outp += 128; - - goto enc_block; - - partial: - - lensav = len; - len >>= 4; - - tmp = load32_bigendian(np + 12); - tmp += len; - store32_bigendian(np + 12, tmp); - - blp = bl; - *(int128 *)(blp + 0) = xmm8; - *(int128 *)(blp + 16) = xmm9; - *(int128 *)(blp + 32) = xmm12; - *(int128 *)(blp + 48) = xmm14; - *(int128 *)(blp + 64) = xmm11; - *(int128 *)(blp + 80) = xmm15; - *(int128 *)(blp + 96) = xmm10; - *(int128 *)(blp + 112) = xmm13; - - bytes: - - if(lensav == 0) goto end; - - b = blp[0]; - b ^= *(unsigned char *)(inp + 0); - *(unsigned char *)(outp + 0) = b; - - blp += 1; - inp +=1; - outp +=1; - lensav -= 1; - - goto bytes; - - full: - - tmp = load32_bigendian(np + 12); - tmp += 8; - store32_bigendian(np + 12, tmp); - - xor2(&xmm8, (int128 *)(inp + 0)); - xor2(&xmm9, (int128 *)(inp + 16)); - xor2(&xmm12, (int128 *)(inp + 32)); - xor2(&xmm14, (int128 *)(inp + 48)); - xor2(&xmm11, (int128 *)(inp + 64)); - xor2(&xmm15, (int128 *)(inp + 80)); - xor2(&xmm10, (int128 *)(inp + 96)); - xor2(&xmm13, (int128 *)(inp + 112)); - - *(int128 *) (outp + 0) = xmm8; - *(int128 *) (outp + 16) = xmm9; - *(int128 *) (outp + 32) = xmm12; - *(int128 *) (outp + 48) = xmm14; - *(int128 *) (outp + 64) = xmm11; - *(int128 *) (outp + 80) = xmm15; - *(int128 *) (outp + 96) = xmm10; - *(int128 *) (outp + 112) = xmm13; - - end: - return 0; - -} diff --git a/src/libnacl/crypto_stream/aes128ctr/used b/src/libnacl/crypto_stream/aes128ctr/used deleted file mode 100644 index e69de29b..00000000 diff --git a/src/libnacl/crypto_stream/measure.c b/src/libnacl/crypto_stream/measure.c deleted file mode 100644 index ff3ab610..00000000 --- a/src/libnacl/crypto_stream/measure.c +++ /dev/null @@ -1,73 +0,0 @@ -#include -#include "randombytes.h" -#include "cpucycles.h" -#include "crypto_stream.h" - -extern void printentry(long long,const char *,long long *,long long); -extern unsigned char *alignedcalloc(unsigned long long); -extern const char *primitiveimplementation; -extern const char *implementationversion; -extern const char *sizenames[]; -extern const long long sizes[]; -extern void allocate(void); -extern void measure(void); - -const char *primitiveimplementation = crypto_stream_IMPLEMENTATION; -const char *implementationversion = crypto_stream_VERSION; -const char *sizenames[] = { "keybytes", "noncebytes", 0 }; -const long long sizes[] = { crypto_stream_KEYBYTES, crypto_stream_NONCEBYTES }; - -#define MAXTEST_BYTES 4096 -#ifdef SUPERCOP -#define MGAP 8192 -#else -#define MGAP 8 -#endif - -static unsigned char *k; -static unsigned char *n; -static unsigned char *m; -static unsigned char *c; - -void preallocate(void) -{ -} - -void allocate(void) -{ - k = alignedcalloc(crypto_stream_KEYBYTES); - n = alignedcalloc(crypto_stream_NONCEBYTES); - m = alignedcalloc(MAXTEST_BYTES); - c = alignedcalloc(MAXTEST_BYTES); -} - -#define TIMINGS 15 -static long long cycles[TIMINGS + 1]; - -void measure(void) -{ - int i; - int loop; - int mlen; - - for (loop = 0;loop < LOOPS;++loop) { - for (mlen = 0;mlen <= MAXTEST_BYTES;mlen += 1 + mlen / MGAP) { - randombytes(k,crypto_stream_KEYBYTES); - randombytes(n,crypto_stream_NONCEBYTES); - randombytes(m,mlen); - randombytes(c,mlen); - for (i = 0;i <= TIMINGS;++i) { - cycles[i] = cpucycles(); - crypto_stream(c,mlen,n,k); - } - for (i = 0;i < TIMINGS;++i) cycles[i] = cycles[i + 1] - cycles[i]; - printentry(mlen,"cycles",cycles,TIMINGS); - for (i = 0;i <= TIMINGS;++i) { - cycles[i] = cpucycles(); - crypto_stream_xor(c,m,mlen,n,k); - } - for (i = 0;i < TIMINGS;++i) cycles[i] = cycles[i + 1] - cycles[i]; - printentry(mlen,"xor_cycles",cycles,TIMINGS); - } - } -} diff --git a/src/libnacl/crypto_stream/salsa20/checksum b/src/libnacl/crypto_stream/salsa20/checksum deleted file mode 100644 index 78ff05f4..00000000 --- a/src/libnacl/crypto_stream/salsa20/checksum +++ /dev/null @@ -1 +0,0 @@ -44a3966eabcd3a2b13faca2150e38f2b7e6bac187d626618f50a9f875158ae78 diff --git a/src/libnacl/crypto_stream/salsa20/ref/api.h b/src/libnacl/crypto_stream/salsa20/ref/api.h deleted file mode 100644 index c2b18461..00000000 --- a/src/libnacl/crypto_stream/salsa20/ref/api.h +++ /dev/null @@ -1,2 +0,0 @@ -#define CRYPTO_KEYBYTES 32 -#define CRYPTO_NONCEBYTES 8 diff --git a/src/libnacl/crypto_stream/salsa20/ref/implementors b/src/libnacl/crypto_stream/salsa20/ref/implementors deleted file mode 100644 index f6fb3c73..00000000 --- a/src/libnacl/crypto_stream/salsa20/ref/implementors +++ /dev/null @@ -1 +0,0 @@ -Daniel J. Bernstein diff --git a/src/libnacl/crypto_stream/salsa20/ref/stream.c b/src/libnacl/crypto_stream/salsa20/ref/stream.c deleted file mode 100644 index 2f0262eb..00000000 --- a/src/libnacl/crypto_stream/salsa20/ref/stream.c +++ /dev/null @@ -1,49 +0,0 @@ -/* -version 20080913 -D. J. Bernstein -Public domain. -*/ - -#include "crypto_core_salsa20.h" -#include "crypto_stream.h" - -typedef unsigned int uint32; - -static const unsigned char sigma[16] = "expand 32-byte k"; - -int crypto_stream( - unsigned char *c,unsigned long long clen, - const unsigned char *n, - const unsigned char *k -) -{ - unsigned char in[16]; - unsigned char block[64]; - int i; - unsigned int u; - - if (!clen) return 0; - - for (i = 0;i < 8;++i) in[i] = n[i]; - for (i = 8;i < 16;++i) in[i] = 0; - - while (clen >= 64) { - crypto_core_salsa20(c,in,k,sigma); - - u = 1; - for (i = 8;i < 16;++i) { - u += (unsigned int) in[i]; - in[i] = u; - u >>= 8; - } - - clen -= 64; - c += 64; - } - - if (clen) { - crypto_core_salsa20(block,in,k,sigma); - for (i = 0;i < clen;++i) c[i] = block[i]; - } - return 0; -} diff --git a/src/libnacl/crypto_stream/salsa20/ref/xor.c b/src/libnacl/crypto_stream/salsa20/ref/xor.c deleted file mode 100644 index 11c7e9f0..00000000 --- a/src/libnacl/crypto_stream/salsa20/ref/xor.c +++ /dev/null @@ -1,52 +0,0 @@ -/* -version 20080913 -D. J. Bernstein -Public domain. -*/ - -#include "crypto_core_salsa20.h" -#include "crypto_stream.h" - -typedef unsigned int uint32; - -static const unsigned char sigma[16] = "expand 32-byte k"; - -int crypto_stream_xor( - unsigned char *c, - const unsigned char *m,unsigned long long mlen, - const unsigned char *n, - const unsigned char *k -) -{ - unsigned char in[16]; - unsigned char block[64]; - int i; - unsigned int u; - - if (!mlen) return 0; - - for (i = 0;i < 8;++i) in[i] = n[i]; - for (i = 8;i < 16;++i) in[i] = 0; - - while (mlen >= 64) { - crypto_core_salsa20(block,in,k,sigma); - for (i = 0;i < 64;++i) c[i] = m[i] ^ block[i]; - - u = 1; - for (i = 8;i < 16;++i) { - u += (unsigned int) in[i]; - in[i] = u; - u >>= 8; - } - - mlen -= 64; - c += 64; - m += 64; - } - - if (mlen) { - crypto_core_salsa20(block,in,k,sigma); - for (i = 0;i < mlen;++i) c[i] = m[i] ^ block[i]; - } - return 0; -} diff --git a/src/libnacl/crypto_stream/salsa20/used b/src/libnacl/crypto_stream/salsa20/used deleted file mode 100644 index e69de29b..00000000 diff --git a/src/libnacl/crypto_stream/salsa2012/checksum b/src/libnacl/crypto_stream/salsa2012/checksum deleted file mode 100644 index f801d9e3..00000000 --- a/src/libnacl/crypto_stream/salsa2012/checksum +++ /dev/null @@ -1 +0,0 @@ -ecc758f200061c3cc770b25797da73583548d4f90f69a967fbbe1a6d94d1705c diff --git a/src/libnacl/crypto_stream/salsa2012/ref/api.h b/src/libnacl/crypto_stream/salsa2012/ref/api.h deleted file mode 100644 index c2b18461..00000000 --- a/src/libnacl/crypto_stream/salsa2012/ref/api.h +++ /dev/null @@ -1,2 +0,0 @@ -#define CRYPTO_KEYBYTES 32 -#define CRYPTO_NONCEBYTES 8 diff --git a/src/libnacl/crypto_stream/salsa2012/ref/implementors b/src/libnacl/crypto_stream/salsa2012/ref/implementors deleted file mode 100644 index f6fb3c73..00000000 --- a/src/libnacl/crypto_stream/salsa2012/ref/implementors +++ /dev/null @@ -1 +0,0 @@ -Daniel J. Bernstein diff --git a/src/libnacl/crypto_stream/salsa2012/ref/stream.c b/src/libnacl/crypto_stream/salsa2012/ref/stream.c deleted file mode 100644 index 86053337..00000000 --- a/src/libnacl/crypto_stream/salsa2012/ref/stream.c +++ /dev/null @@ -1,49 +0,0 @@ -/* -version 20080913 -D. J. Bernstein -Public domain. -*/ - -#include "crypto_core_salsa2012.h" -#include "crypto_stream.h" - -typedef unsigned int uint32; - -static const unsigned char sigma[16] = "expand 32-byte k"; - -int crypto_stream( - unsigned char *c,unsigned long long clen, - const unsigned char *n, - const unsigned char *k -) -{ - unsigned char in[16]; - unsigned char block[64]; - int i; - unsigned int u; - - if (!clen) return 0; - - for (i = 0;i < 8;++i) in[i] = n[i]; - for (i = 8;i < 16;++i) in[i] = 0; - - while (clen >= 64) { - crypto_core_salsa2012(c,in,k,sigma); - - u = 1; - for (i = 8;i < 16;++i) { - u += (unsigned int) in[i]; - in[i] = u; - u >>= 8; - } - - clen -= 64; - c += 64; - } - - if (clen) { - crypto_core_salsa2012(block,in,k,sigma); - for (i = 0;i < clen;++i) c[i] = block[i]; - } - return 0; -} diff --git a/src/libnacl/crypto_stream/salsa2012/ref/xor.c b/src/libnacl/crypto_stream/salsa2012/ref/xor.c deleted file mode 100644 index 90206426..00000000 --- a/src/libnacl/crypto_stream/salsa2012/ref/xor.c +++ /dev/null @@ -1,52 +0,0 @@ -/* -version 20080913 -D. J. Bernstein -Public domain. -*/ - -#include "crypto_core_salsa2012.h" -#include "crypto_stream.h" - -typedef unsigned int uint32; - -static const unsigned char sigma[16] = "expand 32-byte k"; - -int crypto_stream_xor( - unsigned char *c, - const unsigned char *m,unsigned long long mlen, - const unsigned char *n, - const unsigned char *k -) -{ - unsigned char in[16]; - unsigned char block[64]; - int i; - unsigned int u; - - if (!mlen) return 0; - - for (i = 0;i < 8;++i) in[i] = n[i]; - for (i = 8;i < 16;++i) in[i] = 0; - - while (mlen >= 64) { - crypto_core_salsa2012(block,in,k,sigma); - for (i = 0;i < 64;++i) c[i] = m[i] ^ block[i]; - - u = 1; - for (i = 8;i < 16;++i) { - u += (unsigned int) in[i]; - in[i] = u; - u >>= 8; - } - - mlen -= 64; - c += 64; - m += 64; - } - - if (mlen) { - crypto_core_salsa2012(block,in,k,sigma); - for (i = 0;i < mlen;++i) c[i] = m[i] ^ block[i]; - } - return 0; -} diff --git a/src/libnacl/crypto_stream/salsa2012/used b/src/libnacl/crypto_stream/salsa2012/used deleted file mode 100644 index e69de29b..00000000 diff --git a/src/libnacl/crypto_stream/salsa208/checksum b/src/libnacl/crypto_stream/salsa208/checksum deleted file mode 100644 index c87364e6..00000000 --- a/src/libnacl/crypto_stream/salsa208/checksum +++ /dev/null @@ -1 +0,0 @@ -05f32b0647417aaa446b0b3127318133cf9af32b771869eab267000bf02710cd diff --git a/src/libnacl/crypto_stream/salsa208/ref/api.h b/src/libnacl/crypto_stream/salsa208/ref/api.h deleted file mode 100644 index c2b18461..00000000 --- a/src/libnacl/crypto_stream/salsa208/ref/api.h +++ /dev/null @@ -1,2 +0,0 @@ -#define CRYPTO_KEYBYTES 32 -#define CRYPTO_NONCEBYTES 8 diff --git a/src/libnacl/crypto_stream/salsa208/ref/implementors b/src/libnacl/crypto_stream/salsa208/ref/implementors deleted file mode 100644 index f6fb3c73..00000000 --- a/src/libnacl/crypto_stream/salsa208/ref/implementors +++ /dev/null @@ -1 +0,0 @@ -Daniel J. Bernstein diff --git a/src/libnacl/crypto_stream/salsa208/ref/stream.c b/src/libnacl/crypto_stream/salsa208/ref/stream.c deleted file mode 100644 index cdcfbc0e..00000000 --- a/src/libnacl/crypto_stream/salsa208/ref/stream.c +++ /dev/null @@ -1,49 +0,0 @@ -/* -version 20080913 -D. J. Bernstein -Public domain. -*/ - -#include "crypto_core_salsa208.h" -#include "crypto_stream.h" - -typedef unsigned int uint32; - -static const unsigned char sigma[16] = "expand 32-byte k"; - -int crypto_stream( - unsigned char *c,unsigned long long clen, - const unsigned char *n, - const unsigned char *k -) -{ - unsigned char in[16]; - unsigned char block[64]; - int i; - unsigned int u; - - if (!clen) return 0; - - for (i = 0;i < 8;++i) in[i] = n[i]; - for (i = 8;i < 16;++i) in[i] = 0; - - while (clen >= 64) { - crypto_core_salsa208(c,in,k,sigma); - - u = 1; - for (i = 8;i < 16;++i) { - u += (unsigned int) in[i]; - in[i] = u; - u >>= 8; - } - - clen -= 64; - c += 64; - } - - if (clen) { - crypto_core_salsa208(block,in,k,sigma); - for (i = 0;i < clen;++i) c[i] = block[i]; - } - return 0; -} diff --git a/src/libnacl/crypto_stream/salsa208/ref/xor.c b/src/libnacl/crypto_stream/salsa208/ref/xor.c deleted file mode 100644 index c017ac42..00000000 --- a/src/libnacl/crypto_stream/salsa208/ref/xor.c +++ /dev/null @@ -1,52 +0,0 @@ -/* -version 20080913 -D. J. Bernstein -Public domain. -*/ - -#include "crypto_core_salsa208.h" -#include "crypto_stream.h" - -typedef unsigned int uint32; - -static const unsigned char sigma[16] = "expand 32-byte k"; - -int crypto_stream_xor( - unsigned char *c, - const unsigned char *m,unsigned long long mlen, - const unsigned char *n, - const unsigned char *k -) -{ - unsigned char in[16]; - unsigned char block[64]; - int i; - unsigned int u; - - if (!mlen) return 0; - - for (i = 0;i < 8;++i) in[i] = n[i]; - for (i = 8;i < 16;++i) in[i] = 0; - - while (mlen >= 64) { - crypto_core_salsa208(block,in,k,sigma); - for (i = 0;i < 64;++i) c[i] = m[i] ^ block[i]; - - u = 1; - for (i = 8;i < 16;++i) { - u += (unsigned int) in[i]; - in[i] = u; - u >>= 8; - } - - mlen -= 64; - c += 64; - m += 64; - } - - if (mlen) { - crypto_core_salsa208(block,in,k,sigma); - for (i = 0;i < mlen;++i) c[i] = m[i] ^ block[i]; - } - return 0; -} diff --git a/src/libnacl/crypto_stream/salsa208/used b/src/libnacl/crypto_stream/salsa208/used deleted file mode 100644 index e69de29b..00000000 diff --git a/src/libnacl/crypto_stream/try.c b/src/libnacl/crypto_stream/try.c deleted file mode 100644 index 184d0cec..00000000 --- a/src/libnacl/crypto_stream/try.c +++ /dev/null @@ -1,125 +0,0 @@ -/* - * crypto_stream/try.c version 20090118 - * D. J. Bernstein - * Public domain. - */ - -#include -#include "crypto_stream.h" -#include "windows/windows-quirks.h" - -extern unsigned char *alignedcalloc(unsigned long long); - -const char *primitiveimplementation = crypto_stream_IMPLEMENTATION; - -#define MAXTEST_BYTES 10000 -#define CHECKSUM_BYTES 4096 -#define TUNE_BYTES 1536 - -static unsigned char *k; -static unsigned char *n; -static unsigned char *m; -static unsigned char *c; -static unsigned char *s; -static unsigned char *k2; -static unsigned char *n2; -static unsigned char *m2; -static unsigned char *c2; -static unsigned char *s2; - -void preallocate(void) -{ -} - -void allocate(void) -{ - k = alignedcalloc(crypto_stream_KEYBYTES); - n = alignedcalloc(crypto_stream_NONCEBYTES); - m = alignedcalloc(MAXTEST_BYTES); - c = alignedcalloc(MAXTEST_BYTES); - s = alignedcalloc(MAXTEST_BYTES); - k2 = alignedcalloc(crypto_stream_KEYBYTES); - n2 = alignedcalloc(crypto_stream_NONCEBYTES); - m2 = alignedcalloc(MAXTEST_BYTES); - c2 = alignedcalloc(MAXTEST_BYTES); - s2 = alignedcalloc(MAXTEST_BYTES); -} - -void predoit(void) -{ -} - -void doit(void) -{ - crypto_stream_xor(c,m,TUNE_BYTES,n,k); -} - -char checksum[crypto_stream_KEYBYTES * 2 + 1]; - -const char *checksum_compute(void) -{ - long long i; - long long j; - - for (i = 0;i < CHECKSUM_BYTES;++i) { - long long mlen = i; - long long clen = i; - long long slen = i; - long long klen = crypto_stream_KEYBYTES; - long long nlen = crypto_stream_NONCEBYTES; - for (j = -16;j < 0;++j) m[j] = random(); - for (j = -16;j < 0;++j) c[j] = random(); - for (j = -16;j < 0;++j) s[j] = random(); - for (j = -16;j < 0;++j) n[j] = random(); - for (j = -16;j < 0;++j) k[j] = random(); - for (j = mlen;j < mlen + 16;++j) m[j] = random(); - for (j = clen;j < clen + 16;++j) c[j] = random(); - for (j = slen;j < slen + 16;++j) s[j] = random(); - for (j = nlen;j < nlen + 16;++j) n[j] = random(); - for (j = klen;j < klen + 16;++j) k[j] = random(); - for (j = -16;j < mlen + 16;++j) m2[j] = m[j]; - for (j = -16;j < clen + 16;++j) c2[j] = c[j]; - for (j = -16;j < slen + 16;++j) s2[j] = s[j]; - for (j = -16;j < nlen + 16;++j) n2[j] = n[j]; - for (j = -16;j < klen + 16;++j) k2[j] = k[j]; - - crypto_stream_xor(c,m,mlen,n,k); - - for (j = -16;j < mlen + 16;++j) if (m[j] != m2[j]) return "crypto_stream_xor overwrites m"; - for (j = -16;j < slen + 16;++j) if (s[j] != s2[j]) return "crypto_stream_xor overwrites s"; - for (j = -16;j < nlen + 16;++j) if (n[j] != n2[j]) return "crypto_stream_xor overwrites n"; - for (j = -16;j < klen + 16;++j) if (k[j] != k2[j]) return "crypto_stream_xor overwrites k"; - for (j = -16;j < 0;++j) if (c[j] != c2[j]) return "crypto_stream_xor writes before output"; - for (j = clen;j < clen + 16;++j) if (c[j] != c2[j]) return "crypto_stream_xor writes after output"; - - for (j = -16;j < clen + 16;++j) c2[j] = c[j]; - - crypto_stream(s,slen,n,k); - - for (j = -16;j < mlen + 16;++j) if (m[j] != m2[j]) return "crypto_stream overwrites m"; - for (j = -16;j < clen + 16;++j) if (c[j] != c2[j]) return "crypto_stream overwrites c"; - for (j = -16;j < nlen + 16;++j) if (n[j] != n2[j]) return "crypto_stream overwrites n"; - for (j = -16;j < klen + 16;++j) if (k[j] != k2[j]) return "crypto_stream overwrites k"; - for (j = -16;j < 0;++j) if (s[j] != s2[j]) return "crypto_stream writes before output"; - for (j = slen;j < slen + 16;++j) if (s[j] != s2[j]) return "crypto_stream writes after output"; - - for (j = 0;j < mlen;++j) - if ((s[j] ^ m[j]) != c[j]) return "crypto_stream_xor does not match crypto_stream"; - - for (j = 0;j < clen;++j) k[j % klen] ^= c[j]; - crypto_stream_xor(m,c,clen,n,k); - crypto_stream(s,slen,n,k); - for (j = 0;j < mlen;++j) - if ((s[j] ^ m[j]) != c[j]) return "crypto_stream_xor does not match crypto_stream"; - for (j = 0;j < mlen;++j) n[j % nlen] ^= m[j]; - m[mlen] = 0; - } - - for (i = 0;i < crypto_stream_KEYBYTES;++i) { - checksum[2 * i] = "0123456789abcdef"[15 & (k[i] >> 4)]; - checksum[2 * i + 1] = "0123456789abcdef"[15 & k[i]]; - } - checksum[2 * i] = 0; - - return 0; -} diff --git a/src/libnacl/crypto_stream/xsalsa20/checksum b/src/libnacl/crypto_stream/xsalsa20/checksum deleted file mode 100644 index cae64c0d..00000000 --- a/src/libnacl/crypto_stream/xsalsa20/checksum +++ /dev/null @@ -1 +0,0 @@ -201bc58a96adcb6ed339ca33c188af8ca04a4ce68be1e0953309ee09a0cf8e7a diff --git a/src/libnacl/crypto_stream/xsalsa20/ref/api.h b/src/libnacl/crypto_stream/xsalsa20/ref/api.h deleted file mode 100644 index 6910a7dc..00000000 --- a/src/libnacl/crypto_stream/xsalsa20/ref/api.h +++ /dev/null @@ -1,2 +0,0 @@ -#define CRYPTO_KEYBYTES 32 -#define CRYPTO_NONCEBYTES 24 diff --git a/src/libnacl/crypto_stream/xsalsa20/ref/implementors b/src/libnacl/crypto_stream/xsalsa20/ref/implementors deleted file mode 100644 index f6fb3c73..00000000 --- a/src/libnacl/crypto_stream/xsalsa20/ref/implementors +++ /dev/null @@ -1 +0,0 @@ -Daniel J. Bernstein diff --git a/src/libnacl/crypto_stream/xsalsa20/ref/stream.c b/src/libnacl/crypto_stream/xsalsa20/ref/stream.c deleted file mode 100644 index 2d710709..00000000 --- a/src/libnacl/crypto_stream/xsalsa20/ref/stream.c +++ /dev/null @@ -1,22 +0,0 @@ -/* -version 20080914 -D. J. Bernstein -Public domain. -*/ - -#include "crypto_core_hsalsa20.h" -#include "crypto_stream_salsa20.h" -#include "crypto_stream.h" - -static const unsigned char sigma[16] = "expand 32-byte k"; - -int crypto_stream( - unsigned char *c,unsigned long long clen, - const unsigned char *n, - const unsigned char *k -) -{ - unsigned char subkey[32]; - crypto_core_hsalsa20(subkey,n,k,sigma); - return crypto_stream_salsa20(c,clen,n + 16,subkey); -} diff --git a/src/libnacl/crypto_stream/xsalsa20/ref/xor.c b/src/libnacl/crypto_stream/xsalsa20/ref/xor.c deleted file mode 100644 index 13f3134a..00000000 --- a/src/libnacl/crypto_stream/xsalsa20/ref/xor.c +++ /dev/null @@ -1,23 +0,0 @@ -/* -version 20080913 -D. J. Bernstein -Public domain. -*/ - -#include "crypto_core_hsalsa20.h" -#include "crypto_stream_salsa20.h" -#include "crypto_stream.h" - -static const unsigned char sigma[16] = "expand 32-byte k"; - -int crypto_stream_xor( - unsigned char *c, - const unsigned char *m,unsigned long long mlen, - const unsigned char *n, - const unsigned char *k -) -{ - unsigned char subkey[32]; - crypto_core_hsalsa20(subkey,n,k,sigma); - return crypto_stream_salsa20_xor(c,m,mlen,n + 16,subkey); -} diff --git a/src/libnacl/crypto_stream/xsalsa20/selected b/src/libnacl/crypto_stream/xsalsa20/selected deleted file mode 100644 index e69de29b..00000000 diff --git a/src/libnacl/crypto_stream/xsalsa20/used b/src/libnacl/crypto_stream/xsalsa20/used deleted file mode 100644 index e69de29b..00000000 diff --git a/src/libnacl/crypto_verify/16/checksum b/src/libnacl/crypto_verify/16/checksum deleted file mode 100644 index 573541ac..00000000 --- a/src/libnacl/crypto_verify/16/checksum +++ /dev/null @@ -1 +0,0 @@ -0 diff --git a/src/libnacl/crypto_verify/16/ref/api.h b/src/libnacl/crypto_verify/16/ref/api.h deleted file mode 100644 index 32be2f97..00000000 --- a/src/libnacl/crypto_verify/16/ref/api.h +++ /dev/null @@ -1 +0,0 @@ -#define CRYPTO_BYTES 16 diff --git a/src/libnacl/crypto_verify/16/ref/verify.c b/src/libnacl/crypto_verify/16/ref/verify.c deleted file mode 100644 index d356060c..00000000 --- a/src/libnacl/crypto_verify/16/ref/verify.c +++ /dev/null @@ -1,24 +0,0 @@ -#include "crypto_verify.h" - -int crypto_verify(const unsigned char *x,const unsigned char *y) -{ - unsigned int differentbits = 0; -#define F(i) differentbits |= x[i] ^ y[i]; - F(0) - F(1) - F(2) - F(3) - F(4) - F(5) - F(6) - F(7) - F(8) - F(9) - F(10) - F(11) - F(12) - F(13) - F(14) - F(15) - return (1 & ((differentbits - 1) >> 8)) - 1; -} diff --git a/src/libnacl/crypto_verify/16/used b/src/libnacl/crypto_verify/16/used deleted file mode 100644 index e69de29b..00000000 diff --git a/src/libnacl/crypto_verify/32/checksum b/src/libnacl/crypto_verify/32/checksum deleted file mode 100644 index 573541ac..00000000 --- a/src/libnacl/crypto_verify/32/checksum +++ /dev/null @@ -1 +0,0 @@ -0 diff --git a/src/libnacl/crypto_verify/32/ref/api.h b/src/libnacl/crypto_verify/32/ref/api.h deleted file mode 100644 index ae8c7f6a..00000000 --- a/src/libnacl/crypto_verify/32/ref/api.h +++ /dev/null @@ -1 +0,0 @@ -#define CRYPTO_BYTES 32 diff --git a/src/libnacl/crypto_verify/32/ref/verify.c b/src/libnacl/crypto_verify/32/ref/verify.c deleted file mode 100644 index a0e23afe..00000000 --- a/src/libnacl/crypto_verify/32/ref/verify.c +++ /dev/null @@ -1,40 +0,0 @@ -#include "crypto_verify.h" - -int crypto_verify(const unsigned char *x,const unsigned char *y) -{ - unsigned int differentbits = 0; -#define F(i) differentbits |= x[i] ^ y[i]; - F(0) - F(1) - F(2) - F(3) - F(4) - F(5) - F(6) - F(7) - F(8) - F(9) - F(10) - F(11) - F(12) - F(13) - F(14) - F(15) - F(16) - F(17) - F(18) - F(19) - F(20) - F(21) - F(22) - F(23) - F(24) - F(25) - F(26) - F(27) - F(28) - F(29) - F(30) - F(31) - return (1 & ((differentbits - 1) >> 8)) - 1; -} diff --git a/src/libnacl/crypto_verify/32/used b/src/libnacl/crypto_verify/32/used deleted file mode 100644 index e69de29b..00000000 diff --git a/src/libnacl/crypto_verify/measure.c b/src/libnacl/crypto_verify/measure.c deleted file mode 100644 index bbfac4f1..00000000 --- a/src/libnacl/crypto_verify/measure.c +++ /dev/null @@ -1,18 +0,0 @@ -#include "crypto_verify.h" - -const char *primitiveimplementation = crypto_verify_IMPLEMENTATION; -const char *implementationversion = crypto_verify_VERSION; -const char *sizenames[] = { "inputbytes", 0 }; -const long long sizes[] = { crypto_verify_BYTES }; - -void preallocate(void) -{ -} - -void allocate(void) -{ -} - -void measure(void) -{ -} diff --git a/src/libnacl/crypto_verify/try.c b/src/libnacl/crypto_verify/try.c deleted file mode 100644 index 93cfe7a7..00000000 --- a/src/libnacl/crypto_verify/try.c +++ /dev/null @@ -1,76 +0,0 @@ -/* - * crypto_verify/try.c version 20090118 - * D. J. Bernstein - * Public domain. - */ - -#include -#include "crypto_verify.h" -#include "windows/windows-quirks.h" - -extern unsigned char *alignedcalloc(unsigned long long); - -const char *primitiveimplementation = crypto_verify_IMPLEMENTATION; - -static unsigned char *x; -static unsigned char *y; - -void preallocate(void) -{ -} - -void allocate(void) -{ - x = alignedcalloc(crypto_verify_BYTES); - y = alignedcalloc(crypto_verify_BYTES); -} - -void predoit(void) -{ -} - -void doit(void) -{ - crypto_verify(x,y); -} - -static const char *check(void) -{ - int r = crypto_verify(x,y); - if (r == 0) { - if (memcmp(x,y,crypto_verify_BYTES)) return "different strings pass verify"; - } else if (r == -1) { - if (!memcmp(x,y,crypto_verify_BYTES)) return "equal strings fail verify"; - } else { - return "weird return value from verify"; - } - return 0; -} - -char checksum[2]; - -const char *checksum_compute(void) -{ - long long tests; - long long i; - long long j; - const char *c; - - for (tests = 0;tests < 100000;++tests) { - for (i = 0;i < crypto_verify_BYTES;++i) x[i] = random(); - for (i = 0;i < crypto_verify_BYTES;++i) y[i] = random(); - c = check(); if (c) return c; - for (i = 0;i < crypto_verify_BYTES;++i) y[i] = x[i]; - c = check(); if (c) return c; - y[random() % crypto_verify_BYTES] = random(); - c = check(); if (c) return c; - y[random() % crypto_verify_BYTES] = random(); - c = check(); if (c) return c; - y[random() % crypto_verify_BYTES] = random(); - c = check(); if (c) return c; - } - - checksum[0] = '0'; - checksum[1] = 0; - return 0; -} diff --git a/src/libnacl/dist-dirs b/src/libnacl/dist-dirs deleted file mode 100644 index e22060fc..00000000 --- a/src/libnacl/dist-dirs +++ /dev/null @@ -1,74 +0,0 @@ -. -./commandline -./cpucycles -./cpuid -./crypto_auth -./crypto_auth/hmacsha256 -./crypto_auth/hmacsha256/ref -./crypto_auth/hmacsha512256 -./crypto_auth/hmacsha512256/ref -./crypto_box -./crypto_box/curve25519xsalsa20poly1305 -./crypto_box/curve25519xsalsa20poly1305/ref -./crypto_core -./crypto_core/hsalsa20 -./crypto_core/hsalsa20/ref -./crypto_core/hsalsa20/ref2 -./crypto_core/salsa20 -./crypto_core/salsa20/ref -./crypto_core/salsa2012 -./crypto_core/salsa2012/ref -./crypto_core/salsa208 -./crypto_core/salsa208/ref -./crypto_hash -./crypto_hash/sha256 -./crypto_hash/sha256/ref -./crypto_hash/sha512 -./crypto_hash/sha512/ref -./crypto_hashblocks -./crypto_hashblocks/sha256 -./crypto_hashblocks/sha256/inplace -./crypto_hashblocks/sha256/ref -./crypto_hashblocks/sha512 -./crypto_hashblocks/sha512/inplace -./crypto_hashblocks/sha512/ref -./crypto_onetimeauth -./crypto_onetimeauth/poly1305 -./crypto_onetimeauth/poly1305/53 -./crypto_onetimeauth/poly1305/amd64 -./crypto_onetimeauth/poly1305/ref -./crypto_onetimeauth/poly1305/x86 -./crypto_scalarmult -./crypto_scalarmult/curve25519 -./crypto_scalarmult/curve25519/donna_c64 -./crypto_scalarmult/curve25519/ref -./crypto_secretbox -./crypto_secretbox/xsalsa20poly1305 -./crypto_secretbox/xsalsa20poly1305/ref -./crypto_sign -./crypto_sign/ed25519 -./crypto_sign/ed25519/ref -./crypto_sign/edwards25519sha512batch -./crypto_sign/edwards25519sha512batch/ref -./crypto_stream -./crypto_stream/aes128ctr -./crypto_stream/aes128ctr/portable -./crypto_stream/salsa20 -./crypto_stream/salsa20/ref -./crypto_stream/salsa2012 -./crypto_stream/salsa2012/ref -./crypto_stream/salsa208 -./crypto_stream/salsa208/ref -./crypto_stream/xsalsa20 -./crypto_stream/xsalsa20/ref -./crypto_verify -./crypto_verify/16 -./crypto_verify/16/ref -./crypto_verify/32 -./crypto_verify/32/ref -./inttypes -./okcompilers -./randombytes -./tests -./windows -./windows/include diff --git a/src/libnacl/dist-files b/src/libnacl/dist-files deleted file mode 100644 index 9cb2eee7..00000000 --- a/src/libnacl/dist-files +++ /dev/null @@ -1,376 +0,0 @@ -./commandline/nacl-sha256.c -./commandline/nacl-sha512.c -./cpucycles/alpha.c -./cpucycles/alpha.h -./cpucycles/amd64cpuinfo.c -./cpucycles/amd64cpuinfo.h -./cpucycles/amd64cpuspeed.c -./cpucycles/amd64cpuspeed.h -./cpucycles/amd64tscfreq.c -./cpucycles/amd64tscfreq.h -./cpucycles/celllinux.c -./cpucycles/celllinux.h -./cpucycles/cortex.c -./cpucycles/cortex.h -./cpucycles/dev4ns.c -./cpucycles/dev4ns.h -./cpucycles/do -./cpucycles/gettimeofday.c -./cpucycles/gettimeofday.h -./cpucycles/hppapstat.c -./cpucycles/hppapstat.h -./cpucycles/ia64cpuinfo.c -./cpucycles/ia64cpuinfo.h -./cpucycles/mips.c -./cpucycles/mips.h -./cpucycles/monotonic.c -./cpucycles/monotonic.h -./cpucycles/monotoniccpuinfo.c -./cpucycles/monotoniccpuinfo.h -./cpucycles/osfreq.c -./cpucycles/powerpccpuinfo.c -./cpucycles/powerpccpuinfo.h -./cpucycles/powerpcmacos.c -./cpucycles/powerpcmacos.h -./cpucycles/sgi.c -./cpucycles/sgi.h -./cpucycles/sparc32cpuinfo.c -./cpucycles/sparc32cpuinfo.h -./cpucycles/sparccpuinfo.c -./cpucycles/sparccpuinfo.h -./cpucycles/test.c -./cpucycles/x86cpuinfo.c -./cpucycles/x86cpuinfo.h -./cpucycles/x86cpuspeed.c -./cpucycles/x86cpuspeed.h -./cpucycles/x86estimate.c -./cpucycles/x86estimate.h -./cpucycles/x86tscfreq.c -./cpucycles/x86tscfreq.h -./cpuid/cbytes.c -./cpuid/cpuid.c -./cpuid/do -./cpuid/unknown.c -./cpuid/x86.c -./crypto_auth/hmacsha256/checksum -./crypto_auth/hmacsha256/ref/api.h -./crypto_auth/hmacsha256/ref/hmac.c -./crypto_auth/hmacsha256/ref/verify.c -./crypto_auth/hmacsha256/used -./crypto_auth/hmacsha512256/checksum -./crypto_auth/hmacsha512256/ref/api.h -./crypto_auth/hmacsha512256/ref/hmac.c -./crypto_auth/hmacsha512256/ref/verify.c -./crypto_auth/hmacsha512256/selected -./crypto_auth/hmacsha512256/used -./crypto_auth/measure.c -./crypto_auth/try.c -./crypto_box/curve25519xsalsa20poly1305/checksum -./crypto_box/curve25519xsalsa20poly1305/ref/after.c -./crypto_box/curve25519xsalsa20poly1305/ref/api.h -./crypto_box/curve25519xsalsa20poly1305/ref/before.c -./crypto_box/curve25519xsalsa20poly1305/ref/box.c -./crypto_box/curve25519xsalsa20poly1305/ref/keypair.c -./crypto_box/curve25519xsalsa20poly1305/selected -./crypto_box/curve25519xsalsa20poly1305/used -./crypto_box/measure.c -./crypto_box/try.c -./crypto_core/hsalsa20/checksum -./crypto_core/hsalsa20/ref/api.h -./crypto_core/hsalsa20/ref/core.c -./crypto_core/hsalsa20/ref/implementors -./crypto_core/hsalsa20/ref2/api.h -./crypto_core/hsalsa20/ref2/core.c -./crypto_core/hsalsa20/ref2/implementors -./crypto_core/hsalsa20/used -./crypto_core/measure.c -./crypto_core/salsa20/checksum -./crypto_core/salsa20/ref/api.h -./crypto_core/salsa20/ref/core.c -./crypto_core/salsa20/ref/implementors -./crypto_core/salsa20/used -./crypto_core/salsa2012/checksum -./crypto_core/salsa2012/ref/api.h -./crypto_core/salsa2012/ref/core.c -./crypto_core/salsa2012/ref/implementors -./crypto_core/salsa2012/used -./crypto_core/salsa208/checksum -./crypto_core/salsa208/ref/api.h -./crypto_core/salsa208/ref/core.c -./crypto_core/salsa208/ref/implementors -./crypto_core/salsa208/used -./crypto_core/try.c -./crypto_hash/measure.c -./crypto_hash/sha256/checksum -./crypto_hash/sha256/ref/api.h -./crypto_hash/sha256/ref/hash.c -./crypto_hash/sha256/ref/implementors -./crypto_hash/sha256/used -./crypto_hash/sha512/checksum -./crypto_hash/sha512/ref/api.h -./crypto_hash/sha512/ref/hash.c -./crypto_hash/sha512/ref/implementors -./crypto_hash/sha512/selected -./crypto_hash/sha512/used -./crypto_hash/try.c -./crypto_hashblocks/measure.c -./crypto_hashblocks/sha256/checksum -./crypto_hashblocks/sha256/inplace/api.h -./crypto_hashblocks/sha256/inplace/blocks.c -./crypto_hashblocks/sha256/inplace/implementors -./crypto_hashblocks/sha256/ref/api.h -./crypto_hashblocks/sha256/ref/blocks.c -./crypto_hashblocks/sha256/ref/implementors -./crypto_hashblocks/sha256/used -./crypto_hashblocks/sha512/checksum -./crypto_hashblocks/sha512/inplace/api.h -./crypto_hashblocks/sha512/inplace/blocks.c -./crypto_hashblocks/sha512/inplace/implementors -./crypto_hashblocks/sha512/ref/api.h -./crypto_hashblocks/sha512/ref/blocks.c -./crypto_hashblocks/sha512/ref/implementors -./crypto_hashblocks/sha512/selected -./crypto_hashblocks/sha512/used -./crypto_hashblocks/try.c -./crypto_onetimeauth/measure.c -./crypto_onetimeauth/poly1305/53/api.h -./crypto_onetimeauth/poly1305/53/auth.c -./crypto_onetimeauth/poly1305/53/verify.c -./crypto_onetimeauth/poly1305/amd64/api.h -./crypto_onetimeauth/poly1305/amd64/auth.s -./crypto_onetimeauth/poly1305/amd64/constants.s -./crypto_onetimeauth/poly1305/amd64/verify.c -./crypto_onetimeauth/poly1305/checksum -./crypto_onetimeauth/poly1305/ref/api.h -./crypto_onetimeauth/poly1305/ref/auth.c -./crypto_onetimeauth/poly1305/ref/verify.c -./crypto_onetimeauth/poly1305/selected -./crypto_onetimeauth/poly1305/used -./crypto_onetimeauth/poly1305/x86/api.h -./crypto_onetimeauth/poly1305/x86/auth.s -./crypto_onetimeauth/poly1305/x86/constants.s -./crypto_onetimeauth/poly1305/x86/verify.c -./crypto_onetimeauth/try.c -./crypto_scalarmult/curve25519/checksum -./crypto_scalarmult/curve25519/donna_c64/api.h -./crypto_scalarmult/curve25519/donna_c64/base.c -./crypto_scalarmult/curve25519/donna_c64/implementors -./crypto_scalarmult/curve25519/donna_c64/smult.c -./crypto_scalarmult/curve25519/ref/api.h -./crypto_scalarmult/curve25519/ref/base.c -./crypto_scalarmult/curve25519/ref/implementors -./crypto_scalarmult/curve25519/ref/smult.c -./crypto_scalarmult/curve25519/used -./crypto_scalarmult/measure.c -./crypto_scalarmult/try.c -./crypto_secretbox/measure.c -./crypto_secretbox/try.c -./crypto_secretbox/xsalsa20poly1305/checksum -./crypto_secretbox/xsalsa20poly1305/ref/api.h -./crypto_secretbox/xsalsa20poly1305/ref/box.c -./crypto_secretbox/xsalsa20poly1305/selected -./crypto_secretbox/xsalsa20poly1305/used -./crypto_sign/ed25519/description -./crypto_sign/ed25519/designers -./crypto_sign/ed25519/ref/api.h -./crypto_sign/ed25519/ref/ed25519.c -./crypto_sign/ed25519/ref/fe25519.c -./crypto_sign/ed25519/ref/fe25519.h -./crypto_sign/ed25519/ref/ge25519.c -./crypto_sign/ed25519/ref/ge25519.h -./crypto_sign/ed25519/ref/ge25519_base.data -./crypto_sign/ed25519/ref/implementors -./crypto_sign/ed25519/ref/sc25519.c -./crypto_sign/ed25519/ref/sc25519.h -./crypto_sign/ed25519/selected -./crypto_sign/ed25519/used -./crypto_sign/edwards25519sha512batch/ref/api.h -./crypto_sign/edwards25519sha512batch/ref/fe25519.c -./crypto_sign/edwards25519sha512batch/ref/fe25519.h -./crypto_sign/edwards25519sha512batch/ref/ge25519.c -./crypto_sign/edwards25519sha512batch/ref/ge25519.h -./crypto_sign/edwards25519sha512batch/ref/sc25519.c -./crypto_sign/edwards25519sha512batch/ref/sc25519.h -./crypto_sign/edwards25519sha512batch/ref/sign.c -./crypto_sign/edwards25519sha512batch/selected -./crypto_sign/edwards25519sha512batch/used -./crypto_sign/measure.c -./crypto_sign/try.c -./crypto_stream/aes128ctr/checksum -./crypto_stream/aes128ctr/portable/afternm.c -./crypto_stream/aes128ctr/portable/api.h -./crypto_stream/aes128ctr/portable/beforenm.c -./crypto_stream/aes128ctr/portable/common.c -./crypto_stream/aes128ctr/portable/common.h -./crypto_stream/aes128ctr/portable/consts.c -./crypto_stream/aes128ctr/portable/consts.h -./crypto_stream/aes128ctr/portable/int128.c -./crypto_stream/aes128ctr/portable/int128.h -./crypto_stream/aes128ctr/portable/stream.c -./crypto_stream/aes128ctr/portable/types.h -./crypto_stream/aes128ctr/portable/xor_afternm.c -./crypto_stream/aes128ctr/used -./crypto_stream/measure.c -./crypto_stream/salsa20/checksum -./crypto_stream/salsa20/ref/api.h -./crypto_stream/salsa20/ref/implementors -./crypto_stream/salsa20/ref/stream.c -./crypto_stream/salsa20/ref/xor.c -./crypto_stream/salsa20/used -./crypto_stream/salsa2012/checksum -./crypto_stream/salsa2012/ref/api.h -./crypto_stream/salsa2012/ref/implementors -./crypto_stream/salsa2012/ref/stream.c -./crypto_stream/salsa2012/ref/xor.c -./crypto_stream/salsa2012/used -./crypto_stream/salsa208/checksum -./crypto_stream/salsa208/ref/api.h -./crypto_stream/salsa208/ref/implementors -./crypto_stream/salsa208/ref/stream.c -./crypto_stream/salsa208/ref/xor.c -./crypto_stream/salsa208/used -./crypto_stream/try.c -./crypto_stream/xsalsa20/checksum -./crypto_stream/xsalsa20/ref/api.h -./crypto_stream/xsalsa20/ref/implementors -./crypto_stream/xsalsa20/ref/stream.c -./crypto_stream/xsalsa20/ref/xor.c -./crypto_stream/xsalsa20/selected -./crypto_stream/xsalsa20/used -./crypto_verify/16/checksum -./crypto_verify/16/ref/api.h -./crypto_verify/16/ref/verify.c -./crypto_verify/16/used -./crypto_verify/32/checksum -./crypto_verify/32/ref/api.h -./crypto_verify/32/ref/verify.c -./crypto_verify/32/used -./crypto_verify/measure.c -./crypto_verify/try.c -./dist-dirs -./dist-files -./do -./inttypes/crypto_int16.c -./inttypes/crypto_int32.c -./inttypes/crypto_int64.c -./inttypes/crypto_int8.c -./inttypes/crypto_uint16.c -./inttypes/crypto_uint32.c -./inttypes/crypto_uint64.c -./inttypes/crypto_uint8.c -./inttypes/do -./inttypes/signed.h -./inttypes/unsigned.h -./MACROS -./Makefile.in -./measure-anything.c -./okcompilers/abiname.c -./okcompilers/abinames -./okcompilers/archivers -./okcompilers/c.in -./okcompilers/do.in -./okcompilers/lib.c -./okcompilers/main.c -./okcompilers/test-okar -./okcompilers/test-okc -./okcompilers/test-okc2 -./okcompilers/test-okclink -./okcompilers/test.c -./okcompilers/test10.c -./okcompilers/test5.c -./okcompilers/test6.c -./okcompilers/test9.c -./OPERATIONS -./PROTOTYPES.c -./randombytes/devurandom.c -./randombytes/devurandom.h -./randombytes/do -./randombytes/test.c -./tests/auth.c -./tests/auth.out -./tests/auth2.c -./tests/auth2.out -./tests/auth3.c -./tests/auth3.out -./tests/auth4.out -./tests/auth5.c -./tests/auth5.out -./tests/auth6.out -./tests/box.c -./tests/box.out -./tests/box2.c -./tests/box2.out -./tests/box3.out -./tests/box4.out -./tests/box5.out -./tests/box6.out -./tests/box7.c -./tests/box7.out -./tests/box8.c -./tests/box8.out -./tests/core1.c -./tests/core1.out -./tests/core2.c -./tests/core2.out -./tests/core3.c -./tests/core3.out -./tests/core4.c -./tests/core4.out -./tests/core5.c -./tests/core5.out -./tests/core6.c -./tests/core6.out -./tests/hash.c -./tests/hash.out -./tests/hash2.out -./tests/hash3.c -./tests/hash3.out -./tests/hash4.out -./tests/Makefile.in -./tests/onetimeauth.c -./tests/onetimeauth.out -./tests/onetimeauth2.c -./tests/onetimeauth2.out -./tests/onetimeauth5.out -./tests/onetimeauth6.out -./tests/onetimeauth7.c -./tests/onetimeauth7.out -./tests/onetimeauth8.out -./tests/scalarmult.c -./tests/scalarmult.out -./tests/scalarmult2.c -./tests/scalarmult2.out -./tests/scalarmult3.out -./tests/scalarmult4.out -./tests/scalarmult5.c -./tests/scalarmult5.out -./tests/scalarmult6.c -./tests/scalarmult6.out -./tests/scalarmult7.out -./tests/secretbox.c -./tests/secretbox.out -./tests/secretbox2.c -./tests/secretbox2.out -./tests/secretbox3.out -./tests/secretbox4.out -./tests/secretbox5.out -./tests/secretbox6.out -./tests/secretbox7.c -./tests/secretbox7.out -./tests/secretbox8.c -./tests/secretbox8.out -./tests/stream.c -./tests/stream.out -./tests/stream2.c -./tests/stream2.out -./tests/stream3.c -./tests/stream3.out -./tests/stream4.c -./tests/stream4.out -./tests/stream5.out -./tests/stream6.out -./tests/stream7.out -./tests/stream8.out -./try-anything.c -./version -./windows/include/windows-quirks.h diff --git a/src/libnacl/do b/src/libnacl/do deleted file mode 100755 index bb1200f1..00000000 --- a/src/libnacl/do +++ /dev/null @@ -1,309 +0,0 @@ -#!/bin/sh - -# nacl/do -# D. J. Bernstein -# Public domain. - -version=`cat version` -project=nacl -shorthostname="localhost" - -top="`pwd`/build/$shorthostname" -bin="$top/bin" -lib="$top/lib" -include="$top/include" -work="$top/work" - -PATH="/usr/local/bin:$PATH" -PATH="/usr/sfw/bin:$PATH" -PATH="$bin:$PATH" -export PATH - -LD_LIBRARY_PATH="/usr/local/lib/sparcv9:/usr/local/lib:$LD_LIBRARY_PATH" -LD_LIBRARY_PATH="/usr/sfw/lib/sparcv9:/usr/sfw/lib:$LD_LIBRARY_PATH" -export LD_LIBRARY_PATH - -# and wacky MacOS X -DYLD_LIBRARY_PATH="/usr/local/lib/sparcv9:/usr/local/lib:$DYLD_LIBRARY_PATH" -DYLD_LIBRARY_PATH="/usr/sfw/lib/sparcv9:/usr/sfw/lib:$DYLD_LIBRARY_PATH" -export DYLD_LIBRARY_PATH - -# and work around bug in GNU sort -LANG=C -export LANG - -rm -rf "$top" -mkdir -p "$top" -mkdir -p "$bin" -mkdir -p "$lib" -mkdir -p "$include" - -exec 5>"$top/data" -exec 2>"$top/errors" -exec "$work/${project}_base.c" - okc-$abi \ - | while read compiler - do - ( cd "$work" && $compiler -c ${project}_base.c ) && break - done - okar-$abi cr "$lib/$abi/lib${project}.a" "$work/${project}_base.o" - ( okranlib-$abi "$lib/$abi/lib${project}.a" || exit 0 ) -done - -ulimit -c 0 - -# loop over operations -cat OPERATIONS \ -| while read o -do - [ -d "$o" ] || continue - - selected='' - [ -f "$o/selected" ] && selected=`cat "$o/selected"` - - # for each operation, loop over primitives - ls "$o" \ - | sort \ - | while read p - do - [ -d "$o/$p" ] || continue - expectedchecksum='' - [ -f "$o/$p/checksum" ] && expectedchecksum=`cat "$o/$p/checksum"` - op="${o}_${p}" - - startdate=`date +%Y%m%d` - - # for each operation primitive, loop over abis - okabi \ - | while read abi - do - echo "=== `date` === $abi $o/$p" - libs=`"oklibs-$abi"` - libs="$lib/$abi/cpucycles.o $libs" - [ -f "$lib/$abi/lib${project}.a" ] && libs="$lib/$abi/lib${project}.a $libs" - - rm -rf "$work" - mkdir -p "$work" - mkdir -p "$work/best" - - # for each operation primitive abi, loop over implementations - find "$o/$p" -follow -name "api.h" \ - | sort \ - | while read doth - do - implementationdir=`dirname $doth` - opi=`echo "$implementationdir" | tr ./- ___` - - echo "=== `date` === $abi $implementationdir" - - rm -rf "$work/compile" - mkdir -p "$work/compile" - - cfiles=`ls "$implementationdir" | grep '\.c$' || :` - sfiles=`ls "$implementationdir" | grep '\.[sS]$' || :` - - cp -p "$o"/*.c "$work/compile/" - - cp -pr "$implementationdir"/* "$work/compile" - - cp -p "try-anything.c" "$work/compile/try-anything.c" - - cp -p MACROS "$work/compile/MACROS" - cp -p PROTOTYPES.c "$work/compile/PROTOTYPES.c" - - ( - cd "$work/compile" - ( - echo "#ifndef ${o}_H" - echo "#define ${o}_H" - echo "" - echo "#include \"${op}.h\"" - echo "" - egrep "${o}"'$|'"${o}"'\(|'"${o}"'_' < MACROS \ - | sed "s/$o/$op/" | while read mop - do - echo "#define ${mop} ${mop}" | sed "s/$op/$o/" - done - echo "#define ${o}_PRIMITIVE \"${p}\"" - echo "#define ${o}_IMPLEMENTATION ${op}_IMPLEMENTATION" - echo "#define ${o}_VERSION ${op}_VERSION" - echo "" - echo "#endif" - ) > "$o.h" - ( - echo "#ifndef ${op}_H" - echo "#define ${op}_H" - echo "" - sed 's/[ ]CRYPTO_/ '"${opi}"'_/g' < api.h - echo '#ifdef __cplusplus' - echo '#include ' - echo 'extern "C" {' - echo '#endif' - egrep "${o}"'$|'"${o}"'\(|'"${o}"'_' < PROTOTYPES.c \ - | sed "s/$o/$opi/" - echo '#ifdef __cplusplus' - echo '}' - echo '#endif' - echo "" - egrep "${o}"'$|'"${o}"'\(|'"${o}"'_' < MACROS \ - | sed "s/$o/$opi/" | while read mopi - do - echo "#define ${mopi} ${mopi}" | sed "s/$opi/$op/" - done - echo "#define ${op}_IMPLEMENTATION \"${implementationdir}\"" - echo "#ifndef ${opi}_VERSION" - echo "#define ${opi}_VERSION \"-\"" - echo "#endif" - echo "#define ${op}_VERSION ${opi}_VERSION" - echo "" - echo "#endif" - ) > "$op.h" - - okc-$abi \ - | while read compiler - do - echo "=== `date` === $abi $implementationdir $compiler" - compilerword=`echo "$compiler" | tr ' ' '_'` - ok=1 - for f in $cfiles $sfiles - do - if [ "$ok" = 1 ] - then - $compiler \ - -I. -I"$include" -I"$include/$abi" \ - -c "$f" >../errors 2>&1 || ok=0 - ( if [ `wc -l < ../errors` -lt 25 ] - then - cat ../errors - else - head ../errors - echo ... - tail ../errors - fi - ) \ - | while read err - do - echo "$version $shorthostname $abi $startdate $o $p fromcompiler $implementationdir $compilerword $f $err" >&5 - done - fi - done - - [ "$ok" = 1 ] || continue - okar-$abi cr "$op.a" *.o || continue - okranlib-$abi "$op.a" - - $compiler \ - -I. -I"$include" -I"$include/$abi" \ - -o try try.c try-anything.c \ - "$op.a" $libs >../errors 2>&1 || ok=0 - cat ../errors \ - | while read err - do - echo "$version $shorthostname $abi $startdate $o $p fromcompiler $implementationdir $compilerword try.c $err" >&5 - done - [ "$ok" = 1 ] || continue - - rm -f ../best/*.o || continue - for f in *.o - do - cp -p "$f" "../best/${opi}-$f" - done - cp -p "$op.h" "../$op.h" - cp -p "$o.h" "../$o.h" - done - ) - done - - [ -f "$o/$p/used" ] \ - && okar-$abi cr "$lib/$abi/lib${project}.a" "$work/best"/*.o \ - && ( okranlib-$abi "$lib/$abi/lib${project}.a" || exit 0 ) \ - && cp -p "$work/$op.h" "$include/$abi/$op.h" \ - && [ -f "$o/$p/selected" ] \ - && cp -p "$work/$o.h" "$include/$abi/$o.h" \ - || : - done - done -done - -echo "=== `date` === finishing" - -touch .done diff --git a/src/libnacl/inttypes/crypto_int16.c b/src/libnacl/inttypes/crypto_int16.c deleted file mode 100644 index bc160669..00000000 --- a/src/libnacl/inttypes/crypto_int16.c +++ /dev/null @@ -1,3 +0,0 @@ -#include "crypto_int16.h" -#include "signed.h" -DOIT(16,crypto_int16) diff --git a/src/libnacl/inttypes/crypto_int32.c b/src/libnacl/inttypes/crypto_int32.c deleted file mode 100644 index 520e6822..00000000 --- a/src/libnacl/inttypes/crypto_int32.c +++ /dev/null @@ -1,3 +0,0 @@ -#include "crypto_int32.h" -#include "signed.h" -DOIT(32,crypto_int32) diff --git a/src/libnacl/inttypes/crypto_int64.c b/src/libnacl/inttypes/crypto_int64.c deleted file mode 100644 index 77e815bf..00000000 --- a/src/libnacl/inttypes/crypto_int64.c +++ /dev/null @@ -1,3 +0,0 @@ -#include "crypto_int64.h" -#include "signed.h" -DOIT(64,crypto_int64) diff --git a/src/libnacl/inttypes/crypto_int8.c b/src/libnacl/inttypes/crypto_int8.c deleted file mode 100644 index 5966c62e..00000000 --- a/src/libnacl/inttypes/crypto_int8.c +++ /dev/null @@ -1,3 +0,0 @@ -#include "crypto_int8.h" -#include "signed.h" -DOIT(8,crypto_int8) diff --git a/src/libnacl/inttypes/crypto_uint16.c b/src/libnacl/inttypes/crypto_uint16.c deleted file mode 100644 index 16ce4a69..00000000 --- a/src/libnacl/inttypes/crypto_uint16.c +++ /dev/null @@ -1,3 +0,0 @@ -#include "crypto_uint16.h" -#include "unsigned.h" -DOIT(16,crypto_uint16) diff --git a/src/libnacl/inttypes/crypto_uint32.c b/src/libnacl/inttypes/crypto_uint32.c deleted file mode 100644 index 7050b573..00000000 --- a/src/libnacl/inttypes/crypto_uint32.c +++ /dev/null @@ -1,3 +0,0 @@ -#include "crypto_uint32.h" -#include "unsigned.h" -DOIT(32,crypto_uint32) diff --git a/src/libnacl/inttypes/crypto_uint64.c b/src/libnacl/inttypes/crypto_uint64.c deleted file mode 100644 index 808055c7..00000000 --- a/src/libnacl/inttypes/crypto_uint64.c +++ /dev/null @@ -1,3 +0,0 @@ -#include "crypto_uint64.h" -#include "unsigned.h" -DOIT(64,crypto_uint64) diff --git a/src/libnacl/inttypes/crypto_uint8.c b/src/libnacl/inttypes/crypto_uint8.c deleted file mode 100644 index 61683391..00000000 --- a/src/libnacl/inttypes/crypto_uint8.c +++ /dev/null @@ -1,3 +0,0 @@ -#include "crypto_uint8.h" -#include "unsigned.h" -DOIT(8,crypto_uint8) diff --git a/src/libnacl/inttypes/do b/src/libnacl/inttypes/do deleted file mode 100755 index f0028e3d..00000000 --- a/src/libnacl/inttypes/do +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/sh -e - -okabi | ( - while read abi - do - ( - echo 'int8 int8_t' - echo 'int16 int16_t' - echo 'int32 int32_t' - echo 'int64 int64_t' - echo 'uint8 uint8_t' - echo 'uint16 uint16_t' - echo 'uint32 uint32_t' - echo 'uint64 uint64_t' - ) | ( - while read target source - do - okc-$abi | ( - while read c - do - [ -f include/$abi/crypto_$target.h ] && continue - echo "=== `date` === $abi trying $source as $target under $c..." >&2 - rm -f crypto_$target crypto_$target.h - ( - echo "#ifndef crypto_${target}_h" - echo "#define crypto_${target}_h" - echo "" - echo "#include " - echo "" - echo "typedef ${source} crypto_${target};" - echo "" - echo "#endif" - ) > crypto_$target.h - $c -o crypto_$target crypto_$target.c || continue - mkdir -p include/$abi - cp crypto_$target.h include/$abi/crypto_$target.h - done - ) - done - ) - done -) diff --git a/src/libnacl/inttypes/signed.h b/src/libnacl/inttypes/signed.h deleted file mode 100644 index 92689ff8..00000000 --- a/src/libnacl/inttypes/signed.h +++ /dev/null @@ -1,17 +0,0 @@ -#define DOIT(bits,target) \ -int main() \ -{ \ - target x; \ - int i; \ - \ - x = 1; \ - for (i = 0;i < bits;++i) { \ - if (x == 0) return 100; \ - x += x; \ - } \ - if (x != 0) return 100; \ - x -= 1; \ - if (x > 0) return 100; \ - \ - return 0; \ -} diff --git a/src/libnacl/inttypes/unsigned.h b/src/libnacl/inttypes/unsigned.h deleted file mode 100644 index 31a7a6ea..00000000 --- a/src/libnacl/inttypes/unsigned.h +++ /dev/null @@ -1,17 +0,0 @@ -#define DOIT(bits,target) \ -int main() \ -{ \ - target x; \ - int i; \ - \ - x = 1; \ - for (i = 0;i < bits;++i) { \ - if (x == 0) return 100; \ - x += x; \ - } \ - if (x != 0) return 100; \ - x -= 1; \ - if (x < 0) return 100; \ - \ - return 0; \ -} diff --git a/src/libnacl/measure-anything.c b/src/libnacl/measure-anything.c deleted file mode 100644 index 93941aa5..00000000 --- a/src/libnacl/measure-anything.c +++ /dev/null @@ -1,227 +0,0 @@ -/* - * measure-anything.c version 20090223 - * D. J. Bernstein - * Public domain. - */ - -#include -#include -#include -#include -#include -#include -#ifndef _WIN32 -# include -#endif -#include "cpucycles.h" -#include "cpuid.h" - -typedef int uint32; - -static uint32 seed[32] = { 3,1,4,1,5,9,2,6,5,3,5,8,9,7,9,3,2,3,8,4,6,2,6,4,3,3,8,3,2,7,9,5 } ; -static uint32 in[12]; -static uint32 out[8]; -static int outleft = 0; - -#define ROTATE(x,b) (((x) << (b)) | ((x) >> (32 - (b)))) -#define MUSH(i,b) x = t[i] += (((x ^ seed[i]) + sum) ^ ROTATE(x,b)); - -static void surf(void) -{ - uint32 t[12]; uint32 x; uint32 sum = 0; - int r; int i; int loop; - - for (i = 0;i < 12;++i) t[i] = in[i] ^ seed[12 + i]; - for (i = 0;i < 8;++i) out[i] = seed[24 + i]; - x = t[11]; - for (loop = 0;loop < 2;++loop) { - for (r = 0;r < 16;++r) { - sum += 0x9e3779b9; - MUSH(0,5) MUSH(1,7) MUSH(2,9) MUSH(3,13) - MUSH(4,5) MUSH(5,7) MUSH(6,9) MUSH(7,13) - MUSH(8,5) MUSH(9,7) MUSH(10,9) MUSH(11,13) - } - for (i = 0;i < 8;++i) out[i] ^= t[i + 4]; - } -} - -void randombytes(unsigned char *x,unsigned long long xlen) -{ - while (xlen > 0) { - if (!outleft) { - if (!++in[0]) if (!++in[1]) if (!++in[2]) ++in[3]; - surf(); - outleft = 8; - } - *x = out[--outleft]; - ++x; - --xlen; - } -} - -extern const char *primitiveimplementation; -extern const char *implementationversion; -extern const char *sizenames[]; -extern const long long sizes[]; -extern void preallocate(void); -extern void allocate(void); -extern void measure(void); - -static void printword(const char *s) -{ - if (!*s) putchar('-'); - while (*s) { - if (*s == ' ') putchar('_'); - else if (*s == '\t') putchar('_'); - else if (*s == '\r') putchar('_'); - else if (*s == '\n') putchar('_'); - else putchar(*s); - ++s; - } - putchar(' '); -} - -static void printnum(long long x) -{ - printf("%lld ",x); -} - -static void fail(const char *why) -{ - fprintf(stderr,"measure: fatal: %s\n",why); - exit(111); -} - -unsigned char *alignedcalloc(unsigned long long len) -{ - unsigned char *x = (unsigned char *) calloc(1,len + 128); - if (!x) fail("out of memory"); - /* will never deallocate so shifting is ok */ - x += 63 & (-(unsigned long) x); - return x; -} - -static long long cyclespersecond; - -static void printimplementations(void) -{ - int i; - - printword("implementation"); - printword(primitiveimplementation); - printword(implementationversion); - printf("\n"); fflush(stdout); - - for (i = 0;sizenames[i];++i) { - printword(sizenames[i]); - printnum(sizes[i]); - printf("\n"); fflush(stdout); - } - - printword("cpuid"); - printword(cpuid); - printf("\n"); fflush(stdout); - - printword("cpucycles_persecond"); - printnum(cyclespersecond); - printf("\n"); fflush(stdout); - - printword("cpucycles_implementation"); - printword(cpucycles_implementation); - printf("\n"); fflush(stdout); - - printword("compiler"); - printword(COMPILER); -#if defined(__VERSION__) && !defined(__ICC) - printword(__VERSION__); -#elif defined(__xlc__) - printword(__xlc__); -#elif defined(__ICC) - { - char buf[256]; - - sprintf(buf, "%d.%d.%d", __ICC/100, __ICC%100, - __INTEL_COMPILER_BUILD_DATE); - printword(buf); - } -#elif defined(__PGIC__) - { - char buf[256]; - - sprintf(buf, "%d.%d.%d", __PGIC__, __PGIC_MINOR__, __PGIC_PATCHLEVEL__); - printword(buf); - } -#elif defined(__SUNPRO_C) - { - char buf[256]; - int major, minor, micro; - - micro = __SUNPRO_C & 0xf; - minor = (__SUNPRO_C >> 4) & 0xf; - major = (__SUNPRO_C >> 8) & 0xf; - - if (micro) - sprintf(buf, "%d.%d.%d", major, minor, micro); - else - sprintf(buf, "%d.%d", major, minor); - printword(buf); - } -#else - printword("unknown compiler version"); -#endif - printf("\n"); fflush(stdout); -} - -void printentry(long long mbytes,const char *measuring,long long *m,long long mlen) -{ - long long i; - long long j; - long long belowj; - long long abovej; - - printword(measuring); - if (mbytes >= 0) printnum(mbytes); else printword(""); - if (mlen > 0) { - for (j = 0;j + 1 < mlen;++j) { - belowj = 0; - for (i = 0;i < mlen;++i) if (m[i] < m[j]) ++belowj; - abovej = 0; - for (i = 0;i < mlen;++i) if (m[i] > m[j]) ++abovej; - if (belowj * 2 < mlen && abovej * 2 < mlen) break; - } - printnum(m[j]); - if (mlen > 1) { - for (i = 0;i < mlen;++i) printnum(m[i]); - } - } - printf("\n"); fflush(stdout); -} - -void limits() -{ -#ifdef RLIM_INFINITY - struct rlimit r; - r.rlim_cur = 0; - r.rlim_max = 0; -#ifdef RLIMIT_NOFILE - setrlimit(RLIMIT_NOFILE,&r); -#endif -#ifdef RLIMIT_NPROC - setrlimit(RLIMIT_NPROC,&r); -#endif -#ifdef RLIMIT_CORE - setrlimit(RLIMIT_CORE,&r); -#endif -#endif -} - -int main() -{ - cyclespersecond = cpucycles_persecond(); - preallocate(); - limits(); - printimplementations(); - allocate(); - measure(); - return 0; -} diff --git a/src/libnacl/okcompilers/abiname.c b/src/libnacl/okcompilers/abiname.c deleted file mode 100644 index 38373201..00000000 --- a/src/libnacl/okcompilers/abiname.c +++ /dev/null @@ -1,45 +0,0 @@ -#include - -const char *abi(void) -{ -#if defined(__amd64__) || defined(__x86_64__) || defined(__AMD64__) || defined(_M_X64) || defined(__amd64) - return "amd64"; -#elif defined(__i386__) || defined(__x86__) || defined(__X86__) || defined(_M_IX86) || defined(__i386) - return "x86"; -#elif defined(__ia64__) || defined(__IA64__) || defined(__M_IA64) - return "ia64"; -#elif defined(__SPU__) - return "cellspu"; -#elif defined(__powerpc64__) || defined(__ppc64__) || defined(__PPC64__) || defined(_ARCH_PPC64) - return "ppc64"; -#elif defined(__powerpc__) || defined(__ppc__) || defined(__PPC__) || defined(_ARCH_PPC) - return "ppc32"; -#elif defined(__sparcv9__) || defined(__sparcv9) - return "sparcv9"; -#elif defined(__sparc_v8__) - return "sparcv8"; -#elif defined(__sparc__) || defined(__sparc) - if (sizeof(long) == 4) return "sparcv8"; - return "sparcv9"; -#elif defined(__ARM_EABI__) - return "armeabi"; -#elif defined(__arm__) - return "arm"; -#elif defined(__mips__) || defined(__mips) || defined(__MIPS__) -# if defined(_ABIO32) - return "mipso32"; -# elif defined(_ABIN32) - return "mips32"; -# else - return "mips64"; -# endif -#else - return "default"; -#endif -} - -int main(int argc,char **argv) -{ - printf("%s %s\n",argv[1],abi()); - return 0; -} diff --git a/src/libnacl/okcompilers/abinames b/src/libnacl/okcompilers/abinames deleted file mode 100644 index e69de29b..00000000 diff --git a/src/libnacl/okcompilers/archivers b/src/libnacl/okcompilers/archivers deleted file mode 100644 index d5851c37..00000000 --- a/src/libnacl/okcompilers/archivers +++ /dev/null @@ -1,2 +0,0 @@ -ar -ar -X64 diff --git a/src/libnacl/okcompilers/c.in b/src/libnacl/okcompilers/c.in deleted file mode 100755 index 51a83e1f..00000000 --- a/src/libnacl/okcompilers/c.in +++ /dev/null @@ -1 +0,0 @@ -@CC@ @CPPFLAGS@ @CFLAGS@ diff --git a/src/libnacl/okcompilers/do.in b/src/libnacl/okcompilers/do.in deleted file mode 100755 index 2cd9e0c4..00000000 --- a/src/libnacl/okcompilers/do.in +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/sh -e - -mkdir -p bin - -echo '#!/bin/sh' > bin/okabi -echo 'echo local' >> bin/okabi - -exec < c -echo '#!/bin/sh' > bin/okc-local -while read compiler; do - $compiler lib.c main.c -o test-c || continue - echo "echo $compiler" >> bin/okc-local -done - -echo '#!/bin/sh' > bin/okcpp-local - -echo '#!/bin/sh' > bin/oklibs-local -echo 'echo " @LDFLAGS@ @LIBS@"' >> bin/oklibs-local - -echo '#!/bin/sh' > bin/okar-local -echo 'exec @AR@ "$@"' >> bin/okar-local - -echo '#!/bin/sh' > bin/okranlib-local -echo 'exec @RANLIB@ "$@"' >> bin/okranlib-local - -chmod +x bin/ok* diff --git a/src/libnacl/okcompilers/lib.c b/src/libnacl/okcompilers/lib.c deleted file mode 100644 index cf2e3790..00000000 --- a/src/libnacl/okcompilers/lib.c +++ /dev/null @@ -1,29 +0,0 @@ -int not3(int n) -{ - return n != 3; -} - -int bytes(int n) -{ - return (n + 7) / 8; -} - -long long shr32(long long n) -{ - return n >> 32; -} - -double double5(void) -{ - return 5.0; -} - -int intbytes(void) -{ - return sizeof(int); -} - -int longbytes(void) -{ - return sizeof(long); -} diff --git a/src/libnacl/okcompilers/main.c b/src/libnacl/okcompilers/main.c deleted file mode 100644 index 3b7efa25..00000000 --- a/src/libnacl/okcompilers/main.c +++ /dev/null @@ -1,25 +0,0 @@ -extern int not3(int); -extern int bytes(int); -extern long long shr32(long long); -extern double double5(void); -extern int longbytes(void); -extern int intbytes(void); - -int main(int argc,char **argv) -{ - if (intbytes() != sizeof(int)) return 100; - if (longbytes() != sizeof(long)) return 100; - - if (not3(3)) return 100; - - /* on ppc32, gcc -mpowerpc64 produces SIGILL for >>32 */ - if (!not3(shr32(1))) return 100; - - /* on pentium 1, gcc -march=pentium2 produces SIGILL for (...+7)/8 */ - if (bytes(not3(1)) != 1) return 100; - - /* on pentium 1, gcc -march=prescott produces SIGILL for double comparison */ - if (double5() < 0) return 100; - - return 0; -} diff --git a/src/libnacl/okcompilers/test-okar b/src/libnacl/okcompilers/test-okar deleted file mode 100755 index 8b82a5ff..00000000 --- a/src/libnacl/okcompilers/test-okar +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -PATH="/Users/j/pear/bin:/usr/local/bin:/usr/local/sbin:/opt/local/bin:/opt/local/sbin:/opt/openssh/bin:/opt/openssh/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin" -export PATH -ar "$@" diff --git a/src/libnacl/okcompilers/test-okc b/src/libnacl/okcompilers/test-okc deleted file mode 100755 index 45a48aed..00000000 --- a/src/libnacl/okcompilers/test-okc +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -PATH="/Users/j/pear/bin:/usr/local/bin:/usr/local/sbin:/opt/local/bin:/opt/local/sbin:/opt/openssh/bin:/opt/openssh/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin" -export PATH -gcc -O2 -fomit-frame-pointer "$@" diff --git a/src/libnacl/okcompilers/test-okc2 b/src/libnacl/okcompilers/test-okc2 deleted file mode 100755 index b18ee307..00000000 --- a/src/libnacl/okcompilers/test-okc2 +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -PATH="/Users/j/pear/bin:/usr/local/bin:/usr/local/sbin:/opt/local/bin:/opt/local/sbin:/opt/openssh/bin:/opt/openssh/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin" -export PATH -g++ -O2 -fomit-frame-pointer "$@" diff --git a/src/libnacl/okcompilers/test-okclink b/src/libnacl/okcompilers/test-okclink deleted file mode 100755 index c4b2bca8..00000000 --- a/src/libnacl/okcompilers/test-okclink +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -PATH="/Users/j/pear/bin:/usr/local/bin:/usr/local/sbin:/opt/local/bin:/opt/local/sbin:/opt/openssh/bin:/opt/openssh/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin" -export PATH -gcc -O2 -fomit-frame-pointer "$@" -lrt -lm diff --git a/src/libnacl/okcompilers/test.c b/src/libnacl/okcompilers/test.c deleted file mode 100644 index 973a5c48..00000000 --- a/src/libnacl/okcompilers/test.c +++ /dev/null @@ -1,54 +0,0 @@ -int not3(int n) -{ - return n != 3; -} - -int bytes(int n) -{ - return (n + 7) / 8; -} - -long long shr32(long long n) -{ - return n >> 32; -} - -double double5(void) -{ - return 5.0; -} - -int intbytes(void) -{ - return sizeof(int); -} - -int longbytes(void) -{ - return sizeof(long); -} -extern int not3(int); -extern int bytes(int); -extern long long shr32(long long); -extern double double5(void); -extern int longbytes(void); -extern int intbytes(void); - -int main(int argc,char **argv) -{ - if (intbytes() != sizeof(int)) return 100; - if (longbytes() != sizeof(long)) return 100; - - if (not3(3)) return 100; - - /* on ppc32, gcc -mpowerpc64 produces SIGILL for >>32 */ - if (!not3(shr32(1))) return 100; - - /* on pentium 1, gcc -march=pentium2 produces SIGILL for (...+7)/8 */ - if (bytes(not3(1)) != 1) return 100; - - /* on pentium 1, gcc -march=prescott produces SIGILL for double comparison */ - if (double5() < 0) return 100; - - return 0; -} diff --git a/src/libnacl/okcompilers/test10.c b/src/libnacl/okcompilers/test10.c deleted file mode 100644 index cf2e3790..00000000 --- a/src/libnacl/okcompilers/test10.c +++ /dev/null @@ -1,29 +0,0 @@ -int not3(int n) -{ - return n != 3; -} - -int bytes(int n) -{ - return (n + 7) / 8; -} - -long long shr32(long long n) -{ - return n >> 32; -} - -double double5(void) -{ - return 5.0; -} - -int intbytes(void) -{ - return sizeof(int); -} - -int longbytes(void) -{ - return sizeof(long); -} diff --git a/src/libnacl/okcompilers/test5.c b/src/libnacl/okcompilers/test5.c deleted file mode 100644 index 3b7efa25..00000000 --- a/src/libnacl/okcompilers/test5.c +++ /dev/null @@ -1,25 +0,0 @@ -extern int not3(int); -extern int bytes(int); -extern long long shr32(long long); -extern double double5(void); -extern int longbytes(void); -extern int intbytes(void); - -int main(int argc,char **argv) -{ - if (intbytes() != sizeof(int)) return 100; - if (longbytes() != sizeof(long)) return 100; - - if (not3(3)) return 100; - - /* on ppc32, gcc -mpowerpc64 produces SIGILL for >>32 */ - if (!not3(shr32(1))) return 100; - - /* on pentium 1, gcc -march=pentium2 produces SIGILL for (...+7)/8 */ - if (bytes(not3(1)) != 1) return 100; - - /* on pentium 1, gcc -march=prescott produces SIGILL for double comparison */ - if (double5() < 0) return 100; - - return 0; -} diff --git a/src/libnacl/okcompilers/test6.c b/src/libnacl/okcompilers/test6.c deleted file mode 100644 index cf2e3790..00000000 --- a/src/libnacl/okcompilers/test6.c +++ /dev/null @@ -1,29 +0,0 @@ -int not3(int n) -{ - return n != 3; -} - -int bytes(int n) -{ - return (n + 7) / 8; -} - -long long shr32(long long n) -{ - return n >> 32; -} - -double double5(void) -{ - return 5.0; -} - -int intbytes(void) -{ - return sizeof(int); -} - -int longbytes(void) -{ - return sizeof(long); -} diff --git a/src/libnacl/okcompilers/test9.c b/src/libnacl/okcompilers/test9.c deleted file mode 100644 index 3b7efa25..00000000 --- a/src/libnacl/okcompilers/test9.c +++ /dev/null @@ -1,25 +0,0 @@ -extern int not3(int); -extern int bytes(int); -extern long long shr32(long long); -extern double double5(void); -extern int longbytes(void); -extern int intbytes(void); - -int main(int argc,char **argv) -{ - if (intbytes() != sizeof(int)) return 100; - if (longbytes() != sizeof(long)) return 100; - - if (not3(3)) return 100; - - /* on ppc32, gcc -mpowerpc64 produces SIGILL for >>32 */ - if (!not3(shr32(1))) return 100; - - /* on pentium 1, gcc -march=pentium2 produces SIGILL for (...+7)/8 */ - if (bytes(not3(1)) != 1) return 100; - - /* on pentium 1, gcc -march=prescott produces SIGILL for double comparison */ - if (double5() < 0) return 100; - - return 0; -} diff --git a/src/libnacl/randombytes/devurandom.c b/src/libnacl/randombytes/devurandom.c deleted file mode 100644 index d8b24db5..00000000 --- a/src/libnacl/randombytes/devurandom.c +++ /dev/null @@ -1,46 +0,0 @@ -#include -#include -#include -#include -#ifdef _WIN32 -# include -#endif - -/* it's really stupid that there isn't a syscall for this */ -/* -> Y U NO USE OPENBSD? */ - -static int fd = -1; - -void randombytes(unsigned char *x,unsigned long long xlen) -{ - int i; - - if (fd == -1) { - for (;;) { - fd = open("/dev/urandom",O_RDONLY); - if (fd != -1) break; -#ifdef _WIN32 - Sleep(1000); -#else - sleep(1); -#endif - } - } - - while (xlen > 0) { - if (xlen < 1048576) i = xlen; else i = 1048576; - - i = read(fd,x,i); - if (i < 1) { -#ifdef _WIN32 - Sleep(1000); -#else - sleep(1); -#endif - continue; - } - - x += i; - xlen -= i; - } -} diff --git a/src/libnacl/randombytes/devurandom.h b/src/libnacl/randombytes/devurandom.h deleted file mode 100644 index 2e0caf8a..00000000 --- a/src/libnacl/randombytes/devurandom.h +++ /dev/null @@ -1,24 +0,0 @@ -/* -randombytes/devurandom.h version 20080713 -D. J. Bernstein -Public domain. -*/ - -#ifndef randombytes_devurandom_H -#define randombytes_devurandom_H - -#ifdef __cplusplus -extern "C" { -#endif - -extern void randombytes(unsigned char *,unsigned long long); - -#ifdef __cplusplus -} -#endif - -#ifndef randombytes_implementation -#define randombytes_implementation "devurandom" -#endif - -#endif diff --git a/src/libnacl/randombytes/do b/src/libnacl/randombytes/do deleted file mode 100755 index b2db184a..00000000 --- a/src/libnacl/randombytes/do +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/sh -e - -okabi | ( - while read abi - do - - rm -f randombytes.o randombytes.h - - ( - echo devurandom - ) | ( - while read n - do - okc-$abi | ( - while read c - do - echo "=== `date` === Trying $n.c with $c..." >&2 - rm -f test randombytes-impl.o randombytes-impl.h randombytes-impl.c - cp $n.c randombytes-impl.c || continue - cp $n.h randombytes-impl.h || continue - $c -c randombytes-impl.c || continue - $c -o test test.c randombytes-impl.o || continue - [ -r /dev/urandom ] || continue - echo "=== `date` === Success. Using $n.c." >&2 - mkdir -p lib/$abi - mv randombytes-impl.o lib/$abi/randombytes.o - mkdir -p include/$abi - mv randombytes-impl.h include/$abi/randombytes.h - exit 0 - done - exit 111 - ) && exit 0 - done - exit 111 - ) || ( - echo ===== Giving up. >&2 - rm -f test randombytes-impl.o randombytes-impl.h randombytes-impl.c - exit 111 - ) || exit 111 - - done - exit 0 -) || exit 111 diff --git a/src/libnacl/randombytes/test.c b/src/libnacl/randombytes/test.c deleted file mode 100644 index 646811ca..00000000 --- a/src/libnacl/randombytes/test.c +++ /dev/null @@ -1,15 +0,0 @@ -#include "randombytes-impl.h" - -unsigned char x[65536]; -unsigned long long freq[256]; - -int main() -{ - unsigned long long i; - - randombytes(x,sizeof x); - for (i = 0;i < 256;++i) freq[i] = 0; - for (i = 0;i < sizeof x;++i) ++freq[255 & (int) x[i]]; - for (i = 0;i < 256;++i) if (!freq[i]) return 111; - return 0; -} diff --git a/src/libnacl/tests/Makefile.in b/src/libnacl/tests/Makefile.in deleted file mode 100644 index 164d61c8..00000000 --- a/src/libnacl/tests/Makefile.in +++ /dev/null @@ -1,43 +0,0 @@ - -CC=@CC@ -CFLAGS=@CFLAGS@ -CPP=@CPPFLAGS@ -LDFLAGS=@LDFLAGS@ -LIBS=@LIBS@ - -TESTS_RESULTS = \ - auth.res auth2.res auth5.res box.res box2.res box7.res box8.res \ - core1.res core2.res core3.res core4.res core5.res core6.res \ - hash.res hash3.res onetimeauth.res onetimeauth2.res \ - onetimeauth7.res scalarmult.res scalarmult2.res scalarmult5.res \ - scalarmult6.res secretbox.res secretbox2.res secretbox7.res \ - secretbox8.res stream.res stream2.res stream3.res stream4.res - -all: test - -run-tests: $(TESTS_RESULTS) - -test: .done - -.done: run-tests - touch .done - -.exe.res: - outfile=`echo "$@" | sed 's/.res$$/.out/'` ; \ - `pwd`/$< | cmp $$outfile || exit 1 - -.c.exe: - nacl_lib="`pwd`/../../@NACL_PATH@/lib/local" ; \ - nacl_include="`pwd`/../../@NACL_PATH@/include/local" ; \ - nacl_include_extra="`pwd`/../../@NACL_PATH@/include" ; \ - $(CC) $(CPPFLAGS) $(CFLAGS) -I$$nacl_include -I$$nacl_include_extra $< $$nacl_lib/randombytes.o -o $@ $(LDFLAGS) -L$$nacl_lib -lnacl $(LIBS) - -clean: - -rm -f .done - -rm -f *.exe - -rm -f *.res - -rm -fr *.dSYM - -distclean: clean - -.SUFFIXES: .c .cpp .res .exe diff --git a/src/libnacl/tests/auth.c b/src/libnacl/tests/auth.c deleted file mode 100644 index 5086624e..00000000 --- a/src/libnacl/tests/auth.c +++ /dev/null @@ -1,19 +0,0 @@ -#include -#include "crypto_auth_hmacsha512256.h" - -/* "Test Case 2" from RFC 4231 */ -unsigned char key[32] = "Jefe"; -unsigned char c[28] = "what do ya want for nothing?"; - -unsigned char a[32]; - -main() -{ - int i; - crypto_auth_hmacsha512256(a,c,sizeof c,key); - for (i = 0;i < 32;++i) { - printf(",0x%02x",(unsigned int) a[i]); - if (i % 8 == 7) printf("\n"); - } - return 0; -} diff --git a/src/libnacl/tests/auth.out b/src/libnacl/tests/auth.out deleted file mode 100644 index 35e5909d..00000000 --- a/src/libnacl/tests/auth.out +++ /dev/null @@ -1,4 +0,0 @@ -,0x16,0x4b,0x7a,0x7b,0xfc,0xf8,0x19,0xe2 -,0xe3,0x95,0xfb,0xe7,0x3b,0x56,0xe0,0xa3 -,0x87,0xbd,0x64,0x22,0x2e,0x83,0x1f,0xd6 -,0x10,0x27,0x0c,0xd7,0xea,0x25,0x05,0x54 diff --git a/src/libnacl/tests/auth2.c b/src/libnacl/tests/auth2.c deleted file mode 100644 index ba191de4..00000000 --- a/src/libnacl/tests/auth2.c +++ /dev/null @@ -1,34 +0,0 @@ -/* "Test Case AUTH256-4" from RFC 4868 */ - -#include -#include "crypto_auth_hmacsha256.h" - -unsigned char key[32] = { - 0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08 -,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,0x10 -,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18 -,0x19,0x1a,0x1b,0x1c,0x1d,0x1e,0x1f,0x20 -} ; - -unsigned char c[50] = { - 0xcd,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd -,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd -,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd -,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd -,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd -,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd -,0xcd,0xcd -} ; - -unsigned char a[32]; - -main() -{ - int i; - crypto_auth_hmacsha256(a,c,sizeof c,key); - for (i = 0;i < 32;++i) { - printf(",0x%02x",(unsigned int) a[i]); - if (i % 8 == 7) printf("\n"); - } - return 0; -} diff --git a/src/libnacl/tests/auth2.out b/src/libnacl/tests/auth2.out deleted file mode 100644 index 955951a2..00000000 --- a/src/libnacl/tests/auth2.out +++ /dev/null @@ -1,4 +0,0 @@ -,0x37,0x2e,0xfc,0xf9,0xb4,0x0b,0x35,0xc2 -,0x11,0x5b,0x13,0x46,0x90,0x3d,0x2e,0xf4 -,0x2f,0xce,0xd4,0x6f,0x08,0x46,0xe7,0x25 -,0x7b,0xb1,0x56,0xd3,0xd7,0xb3,0x0d,0x3f diff --git a/src/libnacl/tests/auth3.c b/src/libnacl/tests/auth3.c deleted file mode 100644 index b713b388..00000000 --- a/src/libnacl/tests/auth3.c +++ /dev/null @@ -1,34 +0,0 @@ -/* "Test Case AUTH256-4" from RFC 4868 */ - -#include -#include "crypto_auth_hmacsha256.h" - -unsigned char key[32] = { - 0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08 -,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,0x10 -,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18 -,0x19,0x1a,0x1b,0x1c,0x1d,0x1e,0x1f,0x20 -} ; - -unsigned char c[50] = { - 0xcd,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd -,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd -,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd -,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd -,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd -,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd -,0xcd,0xcd -} ; - -unsigned char a[32] = { - 0x37,0x2e,0xfc,0xf9,0xb4,0x0b,0x35,0xc2 -,0x11,0x5b,0x13,0x46,0x90,0x3d,0x2e,0xf4 -,0x2f,0xce,0xd4,0x6f,0x08,0x46,0xe7,0x25 -,0x7b,0xb1,0x56,0xd3,0xd7,0xb3,0x0d,0x3f -} ; - -main() -{ - printf("%d\n",crypto_auth_hmacsha256_verify(a,c,sizeof c,key)); - return 0; -} diff --git a/src/libnacl/tests/auth3.out b/src/libnacl/tests/auth3.out deleted file mode 100644 index 573541ac..00000000 --- a/src/libnacl/tests/auth3.out +++ /dev/null @@ -1 +0,0 @@ -0 diff --git a/src/libnacl/tests/auth4.out b/src/libnacl/tests/auth4.out deleted file mode 100644 index 573541ac..00000000 --- a/src/libnacl/tests/auth4.out +++ /dev/null @@ -1 +0,0 @@ -0 diff --git a/src/libnacl/tests/auth5.c b/src/libnacl/tests/auth5.c deleted file mode 100644 index 92d8fea3..00000000 --- a/src/libnacl/tests/auth5.c +++ /dev/null @@ -1,37 +0,0 @@ -#include -#include -#include "crypto_auth_hmacsha512256.h" -#include "randombytes.h" -#include "windows/windows-quirks.h" - -unsigned char key[32]; -unsigned char c[10000]; -unsigned char a[32]; - -main() -{ - int clen; - int i; - for (clen = 0;clen < 10000;++clen) { - randombytes(key,sizeof key); - randombytes(c,clen); - crypto_auth_hmacsha512256(a,c,clen,key); - if (crypto_auth_hmacsha512256_verify(a,c,clen,key) != 0) { - printf("fail %d\n",clen); - return 100; - } - if (clen > 0) { - c[random() % clen] += 1 + (random() % 255); - if (crypto_auth_hmacsha512256_verify(a,c,clen,key) == 0) { - printf("forgery %d\n",clen); - return 100; - } - a[random() % sizeof a] += 1 + (random() % 255); - if (crypto_auth_hmacsha512256_verify(a,c,clen,key) == 0) { - printf("forgery %d\n",clen); - return 100; - } - } - } - return 0; -} diff --git a/src/libnacl/tests/auth5.out b/src/libnacl/tests/auth5.out deleted file mode 100644 index e69de29b..00000000 diff --git a/src/libnacl/tests/auth6.out b/src/libnacl/tests/auth6.out deleted file mode 100644 index e69de29b..00000000 diff --git a/src/libnacl/tests/box.c b/src/libnacl/tests/box.c deleted file mode 100644 index b57a9883..00000000 --- a/src/libnacl/tests/box.c +++ /dev/null @@ -1,63 +0,0 @@ -#include -#include "crypto_box_curve25519xsalsa20poly1305.h" - -unsigned char alicesk[32] = { - 0x77,0x07,0x6d,0x0a,0x73,0x18,0xa5,0x7d -,0x3c,0x16,0xc1,0x72,0x51,0xb2,0x66,0x45 -,0xdf,0x4c,0x2f,0x87,0xeb,0xc0,0x99,0x2a -,0xb1,0x77,0xfb,0xa5,0x1d,0xb9,0x2c,0x2a -} ; - -unsigned char bobpk[32] = { - 0xde,0x9e,0xdb,0x7d,0x7b,0x7d,0xc1,0xb4 -,0xd3,0x5b,0x61,0xc2,0xec,0xe4,0x35,0x37 -,0x3f,0x83,0x43,0xc8,0x5b,0x78,0x67,0x4d -,0xad,0xfc,0x7e,0x14,0x6f,0x88,0x2b,0x4f -} ; - -unsigned char nonce[24] = { - 0x69,0x69,0x6e,0xe9,0x55,0xb6,0x2b,0x73 -,0xcd,0x62,0xbd,0xa8,0x75,0xfc,0x73,0xd6 -,0x82,0x19,0xe0,0x03,0x6b,0x7a,0x0b,0x37 -} ; - -// API requires first 32 bytes to be 0 -unsigned char m[163] = { - 0, 0, 0, 0, 0, 0, 0, 0 -, 0, 0, 0, 0, 0, 0, 0, 0 -, 0, 0, 0, 0, 0, 0, 0, 0 -, 0, 0, 0, 0, 0, 0, 0, 0 -,0xbe,0x07,0x5f,0xc5,0x3c,0x81,0xf2,0xd5 -,0xcf,0x14,0x13,0x16,0xeb,0xeb,0x0c,0x7b -,0x52,0x28,0xc5,0x2a,0x4c,0x62,0xcb,0xd4 -,0x4b,0x66,0x84,0x9b,0x64,0x24,0x4f,0xfc -,0xe5,0xec,0xba,0xaf,0x33,0xbd,0x75,0x1a -,0x1a,0xc7,0x28,0xd4,0x5e,0x6c,0x61,0x29 -,0x6c,0xdc,0x3c,0x01,0x23,0x35,0x61,0xf4 -,0x1d,0xb6,0x6c,0xce,0x31,0x4a,0xdb,0x31 -,0x0e,0x3b,0xe8,0x25,0x0c,0x46,0xf0,0x6d -,0xce,0xea,0x3a,0x7f,0xa1,0x34,0x80,0x57 -,0xe2,0xf6,0x55,0x6a,0xd6,0xb1,0x31,0x8a -,0x02,0x4a,0x83,0x8f,0x21,0xaf,0x1f,0xde -,0x04,0x89,0x77,0xeb,0x48,0xf5,0x9f,0xfd -,0x49,0x24,0xca,0x1c,0x60,0x90,0x2e,0x52 -,0xf0,0xa0,0x89,0xbc,0x76,0x89,0x70,0x40 -,0xe0,0x82,0xf9,0x37,0x76,0x38,0x48,0x64 -,0x5e,0x07,0x05 -} ; - -unsigned char c[163]; - -main() -{ - int i; - crypto_box_curve25519xsalsa20poly1305( - c,m,163,nonce,bobpk,alicesk - ); - for (i = 16;i < 163;++i) { - printf(",0x%02x",(unsigned int) c[i]); - if (i % 8 == 7) printf("\n"); - } - printf("\n"); - return 0; -} diff --git a/src/libnacl/tests/box.out b/src/libnacl/tests/box.out deleted file mode 100644 index 2b6c51ea..00000000 --- a/src/libnacl/tests/box.out +++ /dev/null @@ -1,19 +0,0 @@ -,0xf3,0xff,0xc7,0x70,0x3f,0x94,0x00,0xe5 -,0x2a,0x7d,0xfb,0x4b,0x3d,0x33,0x05,0xd9 -,0x8e,0x99,0x3b,0x9f,0x48,0x68,0x12,0x73 -,0xc2,0x96,0x50,0xba,0x32,0xfc,0x76,0xce -,0x48,0x33,0x2e,0xa7,0x16,0x4d,0x96,0xa4 -,0x47,0x6f,0xb8,0xc5,0x31,0xa1,0x18,0x6a -,0xc0,0xdf,0xc1,0x7c,0x98,0xdc,0xe8,0x7b -,0x4d,0xa7,0xf0,0x11,0xec,0x48,0xc9,0x72 -,0x71,0xd2,0xc2,0x0f,0x9b,0x92,0x8f,0xe2 -,0x27,0x0d,0x6f,0xb8,0x63,0xd5,0x17,0x38 -,0xb4,0x8e,0xee,0xe3,0x14,0xa7,0xcc,0x8a -,0xb9,0x32,0x16,0x45,0x48,0xe5,0x26,0xae -,0x90,0x22,0x43,0x68,0x51,0x7a,0xcf,0xea -,0xbd,0x6b,0xb3,0x73,0x2b,0xc0,0xe9,0xda -,0x99,0x83,0x2b,0x61,0xca,0x01,0xb6,0xde -,0x56,0x24,0x4a,0x9e,0x88,0xd5,0xf9,0xb3 -,0x79,0x73,0xf6,0x22,0xa4,0x3d,0x14,0xa6 -,0x59,0x9b,0x1f,0x65,0x4c,0xb4,0x5a,0x74 -,0xe3,0x55,0xa5 diff --git a/src/libnacl/tests/box2.c b/src/libnacl/tests/box2.c deleted file mode 100644 index 0a531142..00000000 --- a/src/libnacl/tests/box2.c +++ /dev/null @@ -1,64 +0,0 @@ -#include -#include "crypto_box_curve25519xsalsa20poly1305.h" - -unsigned char bobsk[32] = { - 0x5d,0xab,0x08,0x7e,0x62,0x4a,0x8a,0x4b -,0x79,0xe1,0x7f,0x8b,0x83,0x80,0x0e,0xe6 -,0x6f,0x3b,0xb1,0x29,0x26,0x18,0xb6,0xfd -,0x1c,0x2f,0x8b,0x27,0xff,0x88,0xe0,0xeb -} ; - -unsigned char alicepk[32] = { - 0x85,0x20,0xf0,0x09,0x89,0x30,0xa7,0x54 -,0x74,0x8b,0x7d,0xdc,0xb4,0x3e,0xf7,0x5a -,0x0d,0xbf,0x3a,0x0d,0x26,0x38,0x1a,0xf4 -,0xeb,0xa4,0xa9,0x8e,0xaa,0x9b,0x4e,0x6a -} ; - -unsigned char nonce[24] = { - 0x69,0x69,0x6e,0xe9,0x55,0xb6,0x2b,0x73 -,0xcd,0x62,0xbd,0xa8,0x75,0xfc,0x73,0xd6 -,0x82,0x19,0xe0,0x03,0x6b,0x7a,0x0b,0x37 -} ; - -// API requires first 16 bytes to be 0 -unsigned char c[163] = { - 0, 0, 0, 0, 0, 0, 0, 0 -, 0, 0, 0, 0, 0, 0, 0, 0 -,0xf3,0xff,0xc7,0x70,0x3f,0x94,0x00,0xe5 -,0x2a,0x7d,0xfb,0x4b,0x3d,0x33,0x05,0xd9 -,0x8e,0x99,0x3b,0x9f,0x48,0x68,0x12,0x73 -,0xc2,0x96,0x50,0xba,0x32,0xfc,0x76,0xce -,0x48,0x33,0x2e,0xa7,0x16,0x4d,0x96,0xa4 -,0x47,0x6f,0xb8,0xc5,0x31,0xa1,0x18,0x6a -,0xc0,0xdf,0xc1,0x7c,0x98,0xdc,0xe8,0x7b -,0x4d,0xa7,0xf0,0x11,0xec,0x48,0xc9,0x72 -,0x71,0xd2,0xc2,0x0f,0x9b,0x92,0x8f,0xe2 -,0x27,0x0d,0x6f,0xb8,0x63,0xd5,0x17,0x38 -,0xb4,0x8e,0xee,0xe3,0x14,0xa7,0xcc,0x8a -,0xb9,0x32,0x16,0x45,0x48,0xe5,0x26,0xae -,0x90,0x22,0x43,0x68,0x51,0x7a,0xcf,0xea -,0xbd,0x6b,0xb3,0x73,0x2b,0xc0,0xe9,0xda -,0x99,0x83,0x2b,0x61,0xca,0x01,0xb6,0xde -,0x56,0x24,0x4a,0x9e,0x88,0xd5,0xf9,0xb3 -,0x79,0x73,0xf6,0x22,0xa4,0x3d,0x14,0xa6 -,0x59,0x9b,0x1f,0x65,0x4c,0xb4,0x5a,0x74 -,0xe3,0x55,0xa5 -} ; - -unsigned char m[163]; - -main() -{ - int i; - if (crypto_box_curve25519xsalsa20poly1305_open( - m,c,163,nonce,alicepk,bobsk - ) == 0) { - for (i = 32;i < 163;++i) { - printf(",0x%02x",(unsigned int) m[i]); - if (i % 8 == 7) printf("\n"); - } - printf("\n"); - } - return 0; -} diff --git a/src/libnacl/tests/box2.out b/src/libnacl/tests/box2.out deleted file mode 100644 index c61d4557..00000000 --- a/src/libnacl/tests/box2.out +++ /dev/null @@ -1,17 +0,0 @@ -,0xbe,0x07,0x5f,0xc5,0x3c,0x81,0xf2,0xd5 -,0xcf,0x14,0x13,0x16,0xeb,0xeb,0x0c,0x7b -,0x52,0x28,0xc5,0x2a,0x4c,0x62,0xcb,0xd4 -,0x4b,0x66,0x84,0x9b,0x64,0x24,0x4f,0xfc -,0xe5,0xec,0xba,0xaf,0x33,0xbd,0x75,0x1a -,0x1a,0xc7,0x28,0xd4,0x5e,0x6c,0x61,0x29 -,0x6c,0xdc,0x3c,0x01,0x23,0x35,0x61,0xf4 -,0x1d,0xb6,0x6c,0xce,0x31,0x4a,0xdb,0x31 -,0x0e,0x3b,0xe8,0x25,0x0c,0x46,0xf0,0x6d -,0xce,0xea,0x3a,0x7f,0xa1,0x34,0x80,0x57 -,0xe2,0xf6,0x55,0x6a,0xd6,0xb1,0x31,0x8a -,0x02,0x4a,0x83,0x8f,0x21,0xaf,0x1f,0xde -,0x04,0x89,0x77,0xeb,0x48,0xf5,0x9f,0xfd -,0x49,0x24,0xca,0x1c,0x60,0x90,0x2e,0x52 -,0xf0,0xa0,0x89,0xbc,0x76,0x89,0x70,0x40 -,0xe0,0x82,0xf9,0x37,0x76,0x38,0x48,0x64 -,0x5e,0x07,0x05 diff --git a/src/libnacl/tests/box3.out b/src/libnacl/tests/box3.out deleted file mode 100644 index 2b6c51ea..00000000 --- a/src/libnacl/tests/box3.out +++ /dev/null @@ -1,19 +0,0 @@ -,0xf3,0xff,0xc7,0x70,0x3f,0x94,0x00,0xe5 -,0x2a,0x7d,0xfb,0x4b,0x3d,0x33,0x05,0xd9 -,0x8e,0x99,0x3b,0x9f,0x48,0x68,0x12,0x73 -,0xc2,0x96,0x50,0xba,0x32,0xfc,0x76,0xce -,0x48,0x33,0x2e,0xa7,0x16,0x4d,0x96,0xa4 -,0x47,0x6f,0xb8,0xc5,0x31,0xa1,0x18,0x6a -,0xc0,0xdf,0xc1,0x7c,0x98,0xdc,0xe8,0x7b -,0x4d,0xa7,0xf0,0x11,0xec,0x48,0xc9,0x72 -,0x71,0xd2,0xc2,0x0f,0x9b,0x92,0x8f,0xe2 -,0x27,0x0d,0x6f,0xb8,0x63,0xd5,0x17,0x38 -,0xb4,0x8e,0xee,0xe3,0x14,0xa7,0xcc,0x8a -,0xb9,0x32,0x16,0x45,0x48,0xe5,0x26,0xae -,0x90,0x22,0x43,0x68,0x51,0x7a,0xcf,0xea -,0xbd,0x6b,0xb3,0x73,0x2b,0xc0,0xe9,0xda -,0x99,0x83,0x2b,0x61,0xca,0x01,0xb6,0xde -,0x56,0x24,0x4a,0x9e,0x88,0xd5,0xf9,0xb3 -,0x79,0x73,0xf6,0x22,0xa4,0x3d,0x14,0xa6 -,0x59,0x9b,0x1f,0x65,0x4c,0xb4,0x5a,0x74 -,0xe3,0x55,0xa5 diff --git a/src/libnacl/tests/box4.out b/src/libnacl/tests/box4.out deleted file mode 100644 index c61d4557..00000000 --- a/src/libnacl/tests/box4.out +++ /dev/null @@ -1,17 +0,0 @@ -,0xbe,0x07,0x5f,0xc5,0x3c,0x81,0xf2,0xd5 -,0xcf,0x14,0x13,0x16,0xeb,0xeb,0x0c,0x7b -,0x52,0x28,0xc5,0x2a,0x4c,0x62,0xcb,0xd4 -,0x4b,0x66,0x84,0x9b,0x64,0x24,0x4f,0xfc -,0xe5,0xec,0xba,0xaf,0x33,0xbd,0x75,0x1a -,0x1a,0xc7,0x28,0xd4,0x5e,0x6c,0x61,0x29 -,0x6c,0xdc,0x3c,0x01,0x23,0x35,0x61,0xf4 -,0x1d,0xb6,0x6c,0xce,0x31,0x4a,0xdb,0x31 -,0x0e,0x3b,0xe8,0x25,0x0c,0x46,0xf0,0x6d -,0xce,0xea,0x3a,0x7f,0xa1,0x34,0x80,0x57 -,0xe2,0xf6,0x55,0x6a,0xd6,0xb1,0x31,0x8a -,0x02,0x4a,0x83,0x8f,0x21,0xaf,0x1f,0xde -,0x04,0x89,0x77,0xeb,0x48,0xf5,0x9f,0xfd -,0x49,0x24,0xca,0x1c,0x60,0x90,0x2e,0x52 -,0xf0,0xa0,0x89,0xbc,0x76,0x89,0x70,0x40 -,0xe0,0x82,0xf9,0x37,0x76,0x38,0x48,0x64 -,0x5e,0x07,0x05 diff --git a/src/libnacl/tests/box5.out b/src/libnacl/tests/box5.out deleted file mode 100644 index e69de29b..00000000 diff --git a/src/libnacl/tests/box6.out b/src/libnacl/tests/box6.out deleted file mode 100644 index e69de29b..00000000 diff --git a/src/libnacl/tests/box7.c b/src/libnacl/tests/box7.c deleted file mode 100644 index 809301c1..00000000 --- a/src/libnacl/tests/box7.c +++ /dev/null @@ -1,36 +0,0 @@ -#include -#include "crypto_box.h" -#include "randombytes.h" - -unsigned char alicesk[crypto_box_SECRETKEYBYTES]; -unsigned char alicepk[crypto_box_PUBLICKEYBYTES]; -unsigned char bobsk[crypto_box_SECRETKEYBYTES]; -unsigned char bobpk[crypto_box_PUBLICKEYBYTES]; -unsigned char n[crypto_box_NONCEBYTES]; -unsigned char m[10000]; -unsigned char c[10000]; -unsigned char m2[10000]; - -main() -{ - int mlen; - int i; - - for (mlen = 0;mlen < 1000 && mlen + crypto_box_ZEROBYTES < sizeof m;++mlen) { - crypto_box_keypair(alicepk,alicesk); - crypto_box_keypair(bobpk,bobsk); - randombytes(n,crypto_box_NONCEBYTES); - randombytes(m + crypto_box_ZEROBYTES,mlen); - crypto_box(c,m,mlen + crypto_box_ZEROBYTES,n,bobpk,alicesk); - if (crypto_box_open(m2,c,mlen + crypto_box_ZEROBYTES,n,alicepk,bobsk) == 0) { - for (i = 0;i < mlen + crypto_box_ZEROBYTES;++i) - if (m2[i] != m[i]) { - printf("bad decryption\n"); - break; - } - } else { - printf("ciphertext fails verification\n"); - } - } - return 0; -} diff --git a/src/libnacl/tests/box7.out b/src/libnacl/tests/box7.out deleted file mode 100644 index e69de29b..00000000 diff --git a/src/libnacl/tests/box8.c b/src/libnacl/tests/box8.c deleted file mode 100644 index 8f2b919a..00000000 --- a/src/libnacl/tests/box8.c +++ /dev/null @@ -1,43 +0,0 @@ -#include -#include -#include "crypto_box.h" -#include "randombytes.h" -#include "windows/windows-quirks.h" - -unsigned char alicesk[crypto_box_SECRETKEYBYTES]; -unsigned char alicepk[crypto_box_PUBLICKEYBYTES]; -unsigned char bobsk[crypto_box_SECRETKEYBYTES]; -unsigned char bobpk[crypto_box_PUBLICKEYBYTES]; -unsigned char n[crypto_box_NONCEBYTES]; -unsigned char m[10000]; -unsigned char c[10000]; -unsigned char m2[10000]; - -main() -{ - int mlen; - int i; - int caught; - - for (mlen = 0;mlen < 1000 && mlen + crypto_box_ZEROBYTES < sizeof m;++mlen) { - crypto_box_keypair(alicepk,alicesk); - crypto_box_keypair(bobpk,bobsk); - randombytes(n,crypto_box_NONCEBYTES); - randombytes(m + crypto_box_ZEROBYTES,mlen); - crypto_box(c,m,mlen + crypto_box_ZEROBYTES,n,bobpk,alicesk); - caught = 0; - while (caught < 10) { - c[random() % (mlen + crypto_box_ZEROBYTES)] = random(); - if (crypto_box_open(m2,c,mlen + crypto_box_ZEROBYTES,n,alicepk,bobsk) == 0) { - for (i = 0;i < mlen + crypto_box_ZEROBYTES;++i) - if (m2[i] != m[i]) { - printf("forgery\n"); - return 100; - } - } else { - ++caught; - } - } - } - return 0; -} diff --git a/src/libnacl/tests/box8.out b/src/libnacl/tests/box8.out deleted file mode 100644 index e69de29b..00000000 diff --git a/src/libnacl/tests/core1.c b/src/libnacl/tests/core1.c deleted file mode 100644 index 9a8fc51d..00000000 --- a/src/libnacl/tests/core1.c +++ /dev/null @@ -1,30 +0,0 @@ -#include -#include "crypto_core_hsalsa20.h" - -unsigned char shared[32] = { - 0x4a,0x5d,0x9d,0x5b,0xa4,0xce,0x2d,0xe1 -,0x72,0x8e,0x3b,0xf4,0x80,0x35,0x0f,0x25 -,0xe0,0x7e,0x21,0xc9,0x47,0xd1,0x9e,0x33 -,0x76,0xf0,0x9b,0x3c,0x1e,0x16,0x17,0x42 -} ; - -unsigned char zero[32] = { 0 }; - -unsigned char c[16] = { - 0x65,0x78,0x70,0x61,0x6e,0x64,0x20,0x33 -,0x32,0x2d,0x62,0x79,0x74,0x65,0x20,0x6b -} ; - -unsigned char firstkey[32]; - -main() -{ - int i; - crypto_core_hsalsa20(firstkey,zero,shared,c); - for (i = 0;i < 32;++i) { - if (i > 0) printf(","); else printf(" "); - printf("0x%02x",(unsigned int) firstkey[i]); - if (i % 8 == 7) printf("\n"); - } - return 0; -} diff --git a/src/libnacl/tests/core1.out b/src/libnacl/tests/core1.out deleted file mode 100644 index 715a489d..00000000 --- a/src/libnacl/tests/core1.out +++ /dev/null @@ -1,4 +0,0 @@ - 0x1b,0x27,0x55,0x64,0x73,0xe9,0x85,0xd4 -,0x62,0xcd,0x51,0x19,0x7a,0x9a,0x46,0xc7 -,0x60,0x09,0x54,0x9e,0xac,0x64,0x74,0xf2 -,0x06,0xc4,0xee,0x08,0x44,0xf6,0x83,0x89 diff --git a/src/libnacl/tests/core2.c b/src/libnacl/tests/core2.c deleted file mode 100644 index 08402285..00000000 --- a/src/libnacl/tests/core2.c +++ /dev/null @@ -1,33 +0,0 @@ -#include -#include "crypto_core_hsalsa20.h" - -unsigned char firstkey[32] = { - 0x1b,0x27,0x55,0x64,0x73,0xe9,0x85,0xd4 -,0x62,0xcd,0x51,0x19,0x7a,0x9a,0x46,0xc7 -,0x60,0x09,0x54,0x9e,0xac,0x64,0x74,0xf2 -,0x06,0xc4,0xee,0x08,0x44,0xf6,0x83,0x89 -} ; - -unsigned char nonceprefix[16] = { - 0x69,0x69,0x6e,0xe9,0x55,0xb6,0x2b,0x73 -,0xcd,0x62,0xbd,0xa8,0x75,0xfc,0x73,0xd6 -} ; - -unsigned char c[16] = { - 0x65,0x78,0x70,0x61,0x6e,0x64,0x20,0x33 -,0x32,0x2d,0x62,0x79,0x74,0x65,0x20,0x6b -} ; - -unsigned char secondkey[32]; - -main() -{ - int i; - crypto_core_hsalsa20(secondkey,nonceprefix,firstkey,c); - for (i = 0;i < 32;++i) { - if (i > 0) printf(","); else printf(" "); - printf("0x%02x",(unsigned int) secondkey[i]); - if (i % 8 == 7) printf("\n"); - } - return 0; -} diff --git a/src/libnacl/tests/core2.out b/src/libnacl/tests/core2.out deleted file mode 100644 index f4682af0..00000000 --- a/src/libnacl/tests/core2.out +++ /dev/null @@ -1,4 +0,0 @@ - 0xdc,0x90,0x8d,0xda,0x0b,0x93,0x44,0xa9 -,0x53,0x62,0x9b,0x73,0x38,0x20,0x77,0x88 -,0x80,0xf3,0xce,0xb4,0x21,0xbb,0x61,0xb9 -,0x1c,0xbd,0x4c,0x3e,0x66,0x25,0x6c,0xe4 diff --git a/src/libnacl/tests/core3.c b/src/libnacl/tests/core3.c deleted file mode 100644 index 4c759a5b..00000000 --- a/src/libnacl/tests/core3.c +++ /dev/null @@ -1,41 +0,0 @@ -#include -#include "crypto_core_salsa20.h" -#include "crypto_hash_sha256.h" - -unsigned char secondkey[32] = { - 0xdc,0x90,0x8d,0xda,0x0b,0x93,0x44,0xa9 -,0x53,0x62,0x9b,0x73,0x38,0x20,0x77,0x88 -,0x80,0xf3,0xce,0xb4,0x21,0xbb,0x61,0xb9 -,0x1c,0xbd,0x4c,0x3e,0x66,0x25,0x6c,0xe4 -} ; - -unsigned char noncesuffix[8] = { - 0x82,0x19,0xe0,0x03,0x6b,0x7a,0x0b,0x37 -} ; - -unsigned char c[16] = { - 0x65,0x78,0x70,0x61,0x6e,0x64,0x20,0x33 -,0x32,0x2d,0x62,0x79,0x74,0x65,0x20,0x6b -} ; - -unsigned char in[16] = { 0 } ; - -unsigned char output[64 * 256 * 256]; - -unsigned char h[32]; - -main() -{ - int i; - long long pos = 0; - for (i = 0;i < 8;++i) in[i] = noncesuffix[i]; - do { - do { - crypto_core_salsa20(output + pos,in,secondkey,c); - pos += 64; - } while (++in[8]); - } while (++in[9]); - crypto_hash_sha256(h,output,sizeof output); - for (i = 0;i < 32;++i) printf("%02x",h[i]); printf("\n"); - return 0; -} diff --git a/src/libnacl/tests/core3.out b/src/libnacl/tests/core3.out deleted file mode 100644 index 5fa208c1..00000000 --- a/src/libnacl/tests/core3.out +++ /dev/null @@ -1 +0,0 @@ -662b9d0e3463029156069b12f918691a98f7dfb2ca0393c96bbfc6b1fbd630a2 diff --git a/src/libnacl/tests/core4.c b/src/libnacl/tests/core4.c deleted file mode 100644 index 1f238c5e..00000000 --- a/src/libnacl/tests/core4.c +++ /dev/null @@ -1,33 +0,0 @@ -#include -#include "crypto_core_salsa20.h" - -unsigned char k[32] = { - 1, 2, 3, 4, 5, 6, 7, 8 -, 9, 10, 11, 12, 13, 14, 15, 16 -,201,202,203,204,205,206,207,208 -,209,210,211,212,213,214,215,216 -} ; - -unsigned char in[16] = { - 101,102,103,104,105,106,107,108 -,109,110,111,112,113,114,115,116 -} ; - -unsigned char c[16] = { - 101,120,112, 97,110,100, 32, 51 -, 50, 45, 98,121,116,101, 32,107 -} ; - -unsigned char out[64]; - -main() -{ - int i; - crypto_core_salsa20(out,in,k,c); - for (i = 0;i < 64;++i) { - if (i > 0) printf(","); else printf(" "); - printf("%3d",(unsigned int) out[i]); - if (i % 8 == 7) printf("\n"); - } - return 0; -} diff --git a/src/libnacl/tests/core4.out b/src/libnacl/tests/core4.out deleted file mode 100644 index d04e5b5e..00000000 --- a/src/libnacl/tests/core4.out +++ /dev/null @@ -1,8 +0,0 @@ - 69, 37, 68, 39, 41, 15,107,193 -,255,139,122, 6,170,233,217, 98 -, 89,144,182,106, 21, 51,200, 65 -,239, 49,222, 34,215,114, 40,126 -,104,197, 7,225,197,153, 31, 2 -,102, 78, 76,176, 84,245,246,184 -,177,160,133,130, 6, 72,149,119 -,192,195,132,236,234,103,246, 74 diff --git a/src/libnacl/tests/core5.c b/src/libnacl/tests/core5.c deleted file mode 100644 index 6353477d..00000000 --- a/src/libnacl/tests/core5.c +++ /dev/null @@ -1,32 +0,0 @@ -#include -#include "crypto_core_hsalsa20.h" - -unsigned char k[32] = { - 0xee,0x30,0x4f,0xca,0x27,0x00,0x8d,0x8c -,0x12,0x6f,0x90,0x02,0x79,0x01,0xd8,0x0f -,0x7f,0x1d,0x8b,0x8d,0xc9,0x36,0xcf,0x3b -,0x9f,0x81,0x96,0x92,0x82,0x7e,0x57,0x77 -} ; - -unsigned char in[16] = { - 0x81,0x91,0x8e,0xf2,0xa5,0xe0,0xda,0x9b -,0x3e,0x90,0x60,0x52,0x1e,0x4b,0xb3,0x52 -} ; - -unsigned char c[16] = { - 101,120,112, 97,110,100, 32, 51 -, 50, 45, 98,121,116,101, 32,107 -} ; - -unsigned char out[32]; - -main() -{ - int i; - crypto_core_hsalsa20(out,in,k,c); - for (i = 0;i < 32;++i) { - printf(",0x%02x",(unsigned int) out[i]); - if (i % 8 == 7) printf("\n"); - } - return 0; -} diff --git a/src/libnacl/tests/core5.out b/src/libnacl/tests/core5.out deleted file mode 100644 index 562cf717..00000000 --- a/src/libnacl/tests/core5.out +++ /dev/null @@ -1,4 +0,0 @@ -,0xbc,0x1b,0x30,0xfc,0x07,0x2c,0xc1,0x40 -,0x75,0xe4,0xba,0xa7,0x31,0xb5,0xa8,0x45 -,0xea,0x9b,0x11,0xe9,0xa5,0x19,0x1f,0x94 -,0xe1,0x8c,0xba,0x8f,0xd8,0x21,0xa7,0xcd diff --git a/src/libnacl/tests/core6.c b/src/libnacl/tests/core6.c deleted file mode 100644 index 67f35df9..00000000 --- a/src/libnacl/tests/core6.c +++ /dev/null @@ -1,47 +0,0 @@ -#include -#include "crypto_core_salsa20.h" - -unsigned char k[32] = { - 0xee,0x30,0x4f,0xca,0x27,0x00,0x8d,0x8c -,0x12,0x6f,0x90,0x02,0x79,0x01,0xd8,0x0f -,0x7f,0x1d,0x8b,0x8d,0xc9,0x36,0xcf,0x3b -,0x9f,0x81,0x96,0x92,0x82,0x7e,0x57,0x77 -} ; - -unsigned char in[16] = { - 0x81,0x91,0x8e,0xf2,0xa5,0xe0,0xda,0x9b -,0x3e,0x90,0x60,0x52,0x1e,0x4b,0xb3,0x52 -} ; - -unsigned char c[16] = { - 101,120,112, 97,110,100, 32, 51 -, 50, 45, 98,121,116,101, 32,107 -} ; - -unsigned char out[64]; - -void print(unsigned char *x,unsigned char *y) -{ - int i; - unsigned int borrow = 0; - for (i = 0;i < 4;++i) { - unsigned int xi = x[i]; - unsigned int yi = y[i]; - printf(",0x%02x",255 & (xi - yi - borrow)); - borrow = (xi < yi + borrow); - } -} - -main() -{ - crypto_core_salsa20(out,in,k,c); - print(out,c); - print(out + 20,c + 4); printf("\n"); - print(out + 40,c + 8); - print(out + 60,c + 12); printf("\n"); - print(out + 24,in); - print(out + 28,in + 4); printf("\n"); - print(out + 32,in + 8); - print(out + 36,in + 12); printf("\n"); - return 0; -} diff --git a/src/libnacl/tests/core6.out b/src/libnacl/tests/core6.out deleted file mode 100644 index 562cf717..00000000 --- a/src/libnacl/tests/core6.out +++ /dev/null @@ -1,4 +0,0 @@ -,0xbc,0x1b,0x30,0xfc,0x07,0x2c,0xc1,0x40 -,0x75,0xe4,0xba,0xa7,0x31,0xb5,0xa8,0x45 -,0xea,0x9b,0x11,0xe9,0xa5,0x19,0x1f,0x94 -,0xe1,0x8c,0xba,0x8f,0xd8,0x21,0xa7,0xcd diff --git a/src/libnacl/tests/hash.c b/src/libnacl/tests/hash.c deleted file mode 100644 index 8de470aa..00000000 --- a/src/libnacl/tests/hash.c +++ /dev/null @@ -1,14 +0,0 @@ -#include -#include "crypto_hash.h" - -unsigned char x[8] = "testing\n"; -unsigned char h[crypto_hash_BYTES]; - -int main() -{ - int i; - crypto_hash(h,x,sizeof x); - for (i = 0;i < crypto_hash_BYTES;++i) printf("%02x",(unsigned int) h[i]); - printf("\n"); - return 0; -} diff --git a/src/libnacl/tests/hash.out b/src/libnacl/tests/hash.out deleted file mode 100644 index df582172..00000000 --- a/src/libnacl/tests/hash.out +++ /dev/null @@ -1 +0,0 @@ -24f950aac7b9ea9b3cb728228a0c82b67c39e96b4b344798870d5daee93e3ae5931baae8c7cacfea4b629452c38026a81d138bc7aad1af3ef7bfd5ec646d6c28 diff --git a/src/libnacl/tests/hash2.out b/src/libnacl/tests/hash2.out deleted file mode 100644 index df582172..00000000 --- a/src/libnacl/tests/hash2.out +++ /dev/null @@ -1 +0,0 @@ -24f950aac7b9ea9b3cb728228a0c82b67c39e96b4b344798870d5daee93e3ae5931baae8c7cacfea4b629452c38026a81d138bc7aad1af3ef7bfd5ec646d6c28 diff --git a/src/libnacl/tests/hash3.c b/src/libnacl/tests/hash3.c deleted file mode 100644 index 10b89b90..00000000 --- a/src/libnacl/tests/hash3.c +++ /dev/null @@ -1,14 +0,0 @@ -#include -#include "crypto_hash_sha512.h" - -unsigned char x[8] = "testing\n"; -unsigned char h[crypto_hash_sha512_BYTES]; - -int main() -{ - int i; - crypto_hash_sha512(h,x,sizeof x); - for (i = 0;i < crypto_hash_sha512_BYTES;++i) printf("%02x",(unsigned int) h[i]); - printf("\n"); - return 0; -} diff --git a/src/libnacl/tests/hash3.out b/src/libnacl/tests/hash3.out deleted file mode 100644 index df582172..00000000 --- a/src/libnacl/tests/hash3.out +++ /dev/null @@ -1 +0,0 @@ -24f950aac7b9ea9b3cb728228a0c82b67c39e96b4b344798870d5daee93e3ae5931baae8c7cacfea4b629452c38026a81d138bc7aad1af3ef7bfd5ec646d6c28 diff --git a/src/libnacl/tests/hash4.out b/src/libnacl/tests/hash4.out deleted file mode 100644 index df582172..00000000 --- a/src/libnacl/tests/hash4.out +++ /dev/null @@ -1 +0,0 @@ -24f950aac7b9ea9b3cb728228a0c82b67c39e96b4b344798870d5daee93e3ae5931baae8c7cacfea4b629452c38026a81d138bc7aad1af3ef7bfd5ec646d6c28 diff --git a/src/libnacl/tests/onetimeauth.c b/src/libnacl/tests/onetimeauth.c deleted file mode 100644 index 60a2df14..00000000 --- a/src/libnacl/tests/onetimeauth.c +++ /dev/null @@ -1,42 +0,0 @@ -#include -#include "crypto_onetimeauth_poly1305.h" - -unsigned char rs[32] = { - 0xee,0xa6,0xa7,0x25,0x1c,0x1e,0x72,0x91 -,0x6d,0x11,0xc2,0xcb,0x21,0x4d,0x3c,0x25 -,0x25,0x39,0x12,0x1d,0x8e,0x23,0x4e,0x65 -,0x2d,0x65,0x1f,0xa4,0xc8,0xcf,0xf8,0x80 -} ; - -unsigned char c[131] = { - 0x8e,0x99,0x3b,0x9f,0x48,0x68,0x12,0x73 -,0xc2,0x96,0x50,0xba,0x32,0xfc,0x76,0xce -,0x48,0x33,0x2e,0xa7,0x16,0x4d,0x96,0xa4 -,0x47,0x6f,0xb8,0xc5,0x31,0xa1,0x18,0x6a -,0xc0,0xdf,0xc1,0x7c,0x98,0xdc,0xe8,0x7b -,0x4d,0xa7,0xf0,0x11,0xec,0x48,0xc9,0x72 -,0x71,0xd2,0xc2,0x0f,0x9b,0x92,0x8f,0xe2 -,0x27,0x0d,0x6f,0xb8,0x63,0xd5,0x17,0x38 -,0xb4,0x8e,0xee,0xe3,0x14,0xa7,0xcc,0x8a -,0xb9,0x32,0x16,0x45,0x48,0xe5,0x26,0xae -,0x90,0x22,0x43,0x68,0x51,0x7a,0xcf,0xea -,0xbd,0x6b,0xb3,0x73,0x2b,0xc0,0xe9,0xda -,0x99,0x83,0x2b,0x61,0xca,0x01,0xb6,0xde -,0x56,0x24,0x4a,0x9e,0x88,0xd5,0xf9,0xb3 -,0x79,0x73,0xf6,0x22,0xa4,0x3d,0x14,0xa6 -,0x59,0x9b,0x1f,0x65,0x4c,0xb4,0x5a,0x74 -,0xe3,0x55,0xa5 -} ; - -unsigned char a[16]; - -main() -{ - int i; - crypto_onetimeauth_poly1305(a,c,131,rs); - for (i = 0;i < 16;++i) { - printf(",0x%02x",(unsigned int) a[i]); - if (i % 8 == 7) printf("\n"); - } - return 0; -} diff --git a/src/libnacl/tests/onetimeauth.out b/src/libnacl/tests/onetimeauth.out deleted file mode 100644 index 6d914615..00000000 --- a/src/libnacl/tests/onetimeauth.out +++ /dev/null @@ -1,2 +0,0 @@ -,0xf3,0xff,0xc7,0x70,0x3f,0x94,0x00,0xe5 -,0x2a,0x7d,0xfb,0x4b,0x3d,0x33,0x05,0xd9 diff --git a/src/libnacl/tests/onetimeauth2.c b/src/libnacl/tests/onetimeauth2.c deleted file mode 100644 index 64c1a9cd..00000000 --- a/src/libnacl/tests/onetimeauth2.c +++ /dev/null @@ -1,40 +0,0 @@ -#include -#include "crypto_onetimeauth_poly1305.h" - -unsigned char rs[32] = { - 0xee,0xa6,0xa7,0x25,0x1c,0x1e,0x72,0x91 -,0x6d,0x11,0xc2,0xcb,0x21,0x4d,0x3c,0x25 -,0x25,0x39,0x12,0x1d,0x8e,0x23,0x4e,0x65 -,0x2d,0x65,0x1f,0xa4,0xc8,0xcf,0xf8,0x80 -} ; - -unsigned char c[131] = { - 0x8e,0x99,0x3b,0x9f,0x48,0x68,0x12,0x73 -,0xc2,0x96,0x50,0xba,0x32,0xfc,0x76,0xce -,0x48,0x33,0x2e,0xa7,0x16,0x4d,0x96,0xa4 -,0x47,0x6f,0xb8,0xc5,0x31,0xa1,0x18,0x6a -,0xc0,0xdf,0xc1,0x7c,0x98,0xdc,0xe8,0x7b -,0x4d,0xa7,0xf0,0x11,0xec,0x48,0xc9,0x72 -,0x71,0xd2,0xc2,0x0f,0x9b,0x92,0x8f,0xe2 -,0x27,0x0d,0x6f,0xb8,0x63,0xd5,0x17,0x38 -,0xb4,0x8e,0xee,0xe3,0x14,0xa7,0xcc,0x8a -,0xb9,0x32,0x16,0x45,0x48,0xe5,0x26,0xae -,0x90,0x22,0x43,0x68,0x51,0x7a,0xcf,0xea -,0xbd,0x6b,0xb3,0x73,0x2b,0xc0,0xe9,0xda -,0x99,0x83,0x2b,0x61,0xca,0x01,0xb6,0xde -,0x56,0x24,0x4a,0x9e,0x88,0xd5,0xf9,0xb3 -,0x79,0x73,0xf6,0x22,0xa4,0x3d,0x14,0xa6 -,0x59,0x9b,0x1f,0x65,0x4c,0xb4,0x5a,0x74 -,0xe3,0x55,0xa5 -} ; - -unsigned char a[16] = { - 0xf3,0xff,0xc7,0x70,0x3f,0x94,0x00,0xe5 -,0x2a,0x7d,0xfb,0x4b,0x3d,0x33,0x05,0xd9 -} ; - -main() -{ - printf("%d\n",crypto_onetimeauth_poly1305_verify(a,c,131,rs)); - return 0; -} diff --git a/src/libnacl/tests/onetimeauth2.out b/src/libnacl/tests/onetimeauth2.out deleted file mode 100644 index 573541ac..00000000 --- a/src/libnacl/tests/onetimeauth2.out +++ /dev/null @@ -1 +0,0 @@ -0 diff --git a/src/libnacl/tests/onetimeauth5.out b/src/libnacl/tests/onetimeauth5.out deleted file mode 100644 index 6d914615..00000000 --- a/src/libnacl/tests/onetimeauth5.out +++ /dev/null @@ -1,2 +0,0 @@ -,0xf3,0xff,0xc7,0x70,0x3f,0x94,0x00,0xe5 -,0x2a,0x7d,0xfb,0x4b,0x3d,0x33,0x05,0xd9 diff --git a/src/libnacl/tests/onetimeauth6.out b/src/libnacl/tests/onetimeauth6.out deleted file mode 100644 index 573541ac..00000000 --- a/src/libnacl/tests/onetimeauth6.out +++ /dev/null @@ -1 +0,0 @@ -0 diff --git a/src/libnacl/tests/onetimeauth7.c b/src/libnacl/tests/onetimeauth7.c deleted file mode 100644 index e4b38618..00000000 --- a/src/libnacl/tests/onetimeauth7.c +++ /dev/null @@ -1,37 +0,0 @@ -#include -#include -#include "crypto_onetimeauth_poly1305.h" -#include "randombytes.h" -#include "windows/windows-quirks.h" - -unsigned char key[32]; -unsigned char c[10000]; -unsigned char a[16]; - -main() -{ - int clen; - int i; - for (clen = 0;clen < 10000;++clen) { - randombytes(key,sizeof key); - randombytes(c,clen); - crypto_onetimeauth_poly1305(a,c,clen,key); - if (crypto_onetimeauth_poly1305_verify(a,c,clen,key) != 0) { - printf("fail %d\n",clen); - return 100; - } - if (clen > 0) { - c[random() % clen] += 1 + (random() % 255); - if (crypto_onetimeauth_poly1305_verify(a,c,clen,key) == 0) { - printf("forgery %d\n",clen); - return 100; - } - a[random() % sizeof a] += 1 + (random() % 255); - if (crypto_onetimeauth_poly1305_verify(a,c,clen,key) == 0) { - printf("forgery %d\n",clen); - return 100; - } - } - } - return 0; -} diff --git a/src/libnacl/tests/onetimeauth7.out b/src/libnacl/tests/onetimeauth7.out deleted file mode 100644 index e69de29b..00000000 diff --git a/src/libnacl/tests/onetimeauth8.out b/src/libnacl/tests/onetimeauth8.out deleted file mode 100644 index e69de29b..00000000 diff --git a/src/libnacl/tests/scalarmult.c b/src/libnacl/tests/scalarmult.c deleted file mode 100644 index d9265954..00000000 --- a/src/libnacl/tests/scalarmult.c +++ /dev/null @@ -1,23 +0,0 @@ -#include -#include "crypto_scalarmult_curve25519.h" - -unsigned char alicesk[32] = { - 0x77,0x07,0x6d,0x0a,0x73,0x18,0xa5,0x7d -,0x3c,0x16,0xc1,0x72,0x51,0xb2,0x66,0x45 -,0xdf,0x4c,0x2f,0x87,0xeb,0xc0,0x99,0x2a -,0xb1,0x77,0xfb,0xa5,0x1d,0xb9,0x2c,0x2a -} ; - -unsigned char alicepk[32]; - -main() -{ - int i; - crypto_scalarmult_curve25519_base(alicepk,alicesk); - for (i = 0;i < 32;++i) { - if (i > 0) printf(","); else printf(" "); - printf("0x%02x",(unsigned int) alicepk[i]); - if (i % 8 == 7) printf("\n"); - } - return 0; -} diff --git a/src/libnacl/tests/scalarmult.out b/src/libnacl/tests/scalarmult.out deleted file mode 100644 index ddd130d6..00000000 --- a/src/libnacl/tests/scalarmult.out +++ /dev/null @@ -1,4 +0,0 @@ - 0x85,0x20,0xf0,0x09,0x89,0x30,0xa7,0x54 -,0x74,0x8b,0x7d,0xdc,0xb4,0x3e,0xf7,0x5a -,0x0d,0xbf,0x3a,0x0d,0x26,0x38,0x1a,0xf4 -,0xeb,0xa4,0xa9,0x8e,0xaa,0x9b,0x4e,0x6a diff --git a/src/libnacl/tests/scalarmult2.c b/src/libnacl/tests/scalarmult2.c deleted file mode 100644 index 90e6360d..00000000 --- a/src/libnacl/tests/scalarmult2.c +++ /dev/null @@ -1,23 +0,0 @@ -#include -#include "crypto_scalarmult_curve25519.h" - -unsigned char bobsk[32] = { - 0x5d,0xab,0x08,0x7e,0x62,0x4a,0x8a,0x4b -,0x79,0xe1,0x7f,0x8b,0x83,0x80,0x0e,0xe6 -,0x6f,0x3b,0xb1,0x29,0x26,0x18,0xb6,0xfd -,0x1c,0x2f,0x8b,0x27,0xff,0x88,0xe0,0xeb -} ; - -unsigned char bobpk[32]; - -main() -{ - int i; - crypto_scalarmult_curve25519_base(bobpk,bobsk); - for (i = 0;i < 32;++i) { - if (i > 0) printf(","); else printf(" "); - printf("0x%02x",(unsigned int) bobpk[i]); - if (i % 8 == 7) printf("\n"); - } - return 0; -} diff --git a/src/libnacl/tests/scalarmult2.out b/src/libnacl/tests/scalarmult2.out deleted file mode 100644 index b5391865..00000000 --- a/src/libnacl/tests/scalarmult2.out +++ /dev/null @@ -1,4 +0,0 @@ - 0xde,0x9e,0xdb,0x7d,0x7b,0x7d,0xc1,0xb4 -,0xd3,0x5b,0x61,0xc2,0xec,0xe4,0x35,0x37 -,0x3f,0x83,0x43,0xc8,0x5b,0x78,0x67,0x4d -,0xad,0xfc,0x7e,0x14,0x6f,0x88,0x2b,0x4f diff --git a/src/libnacl/tests/scalarmult3.out b/src/libnacl/tests/scalarmult3.out deleted file mode 100644 index ddd130d6..00000000 --- a/src/libnacl/tests/scalarmult3.out +++ /dev/null @@ -1,4 +0,0 @@ - 0x85,0x20,0xf0,0x09,0x89,0x30,0xa7,0x54 -,0x74,0x8b,0x7d,0xdc,0xb4,0x3e,0xf7,0x5a -,0x0d,0xbf,0x3a,0x0d,0x26,0x38,0x1a,0xf4 -,0xeb,0xa4,0xa9,0x8e,0xaa,0x9b,0x4e,0x6a diff --git a/src/libnacl/tests/scalarmult4.out b/src/libnacl/tests/scalarmult4.out deleted file mode 100644 index b5391865..00000000 --- a/src/libnacl/tests/scalarmult4.out +++ /dev/null @@ -1,4 +0,0 @@ - 0xde,0x9e,0xdb,0x7d,0x7b,0x7d,0xc1,0xb4 -,0xd3,0x5b,0x61,0xc2,0xec,0xe4,0x35,0x37 -,0x3f,0x83,0x43,0xc8,0x5b,0x78,0x67,0x4d -,0xad,0xfc,0x7e,0x14,0x6f,0x88,0x2b,0x4f diff --git a/src/libnacl/tests/scalarmult5.c b/src/libnacl/tests/scalarmult5.c deleted file mode 100644 index 14f8159d..00000000 --- a/src/libnacl/tests/scalarmult5.c +++ /dev/null @@ -1,30 +0,0 @@ -#include -#include "crypto_scalarmult_curve25519.h" - -unsigned char alicesk[32] = { - 0x77,0x07,0x6d,0x0a,0x73,0x18,0xa5,0x7d -,0x3c,0x16,0xc1,0x72,0x51,0xb2,0x66,0x45 -,0xdf,0x4c,0x2f,0x87,0xeb,0xc0,0x99,0x2a -,0xb1,0x77,0xfb,0xa5,0x1d,0xb9,0x2c,0x2a -} ; - -unsigned char bobpk[32] = { - 0xde,0x9e,0xdb,0x7d,0x7b,0x7d,0xc1,0xb4 -,0xd3,0x5b,0x61,0xc2,0xec,0xe4,0x35,0x37 -,0x3f,0x83,0x43,0xc8,0x5b,0x78,0x67,0x4d -,0xad,0xfc,0x7e,0x14,0x6f,0x88,0x2b,0x4f -} ; - -unsigned char k[32]; - -main() -{ - int i; - crypto_scalarmult_curve25519(k,alicesk,bobpk); - for (i = 0;i < 32;++i) { - if (i > 0) printf(","); else printf(" "); - printf("0x%02x",(unsigned int) k[i]); - if (i % 8 == 7) printf("\n"); - } - return 0; -} diff --git a/src/libnacl/tests/scalarmult5.out b/src/libnacl/tests/scalarmult5.out deleted file mode 100644 index bec21130..00000000 --- a/src/libnacl/tests/scalarmult5.out +++ /dev/null @@ -1,4 +0,0 @@ - 0x4a,0x5d,0x9d,0x5b,0xa4,0xce,0x2d,0xe1 -,0x72,0x8e,0x3b,0xf4,0x80,0x35,0x0f,0x25 -,0xe0,0x7e,0x21,0xc9,0x47,0xd1,0x9e,0x33 -,0x76,0xf0,0x9b,0x3c,0x1e,0x16,0x17,0x42 diff --git a/src/libnacl/tests/scalarmult6.c b/src/libnacl/tests/scalarmult6.c deleted file mode 100644 index 89bf9bdd..00000000 --- a/src/libnacl/tests/scalarmult6.c +++ /dev/null @@ -1,30 +0,0 @@ -#include -#include "crypto_scalarmult_curve25519.h" - -unsigned char bobsk[32] = { - 0x5d,0xab,0x08,0x7e,0x62,0x4a,0x8a,0x4b -,0x79,0xe1,0x7f,0x8b,0x83,0x80,0x0e,0xe6 -,0x6f,0x3b,0xb1,0x29,0x26,0x18,0xb6,0xfd -,0x1c,0x2f,0x8b,0x27,0xff,0x88,0xe0,0xeb -} ; - -unsigned char alicepk[32] = { - 0x85,0x20,0xf0,0x09,0x89,0x30,0xa7,0x54 -,0x74,0x8b,0x7d,0xdc,0xb4,0x3e,0xf7,0x5a -,0x0d,0xbf,0x3a,0x0d,0x26,0x38,0x1a,0xf4 -,0xeb,0xa4,0xa9,0x8e,0xaa,0x9b,0x4e,0x6a -} ; - -unsigned char k[32]; - -main() -{ - int i; - crypto_scalarmult_curve25519(k,bobsk,alicepk); - for (i = 0;i < 32;++i) { - if (i > 0) printf(","); else printf(" "); - printf("0x%02x",(unsigned int) k[i]); - if (i % 8 == 7) printf("\n"); - } - return 0; -} diff --git a/src/libnacl/tests/scalarmult6.out b/src/libnacl/tests/scalarmult6.out deleted file mode 100644 index bec21130..00000000 --- a/src/libnacl/tests/scalarmult6.out +++ /dev/null @@ -1,4 +0,0 @@ - 0x4a,0x5d,0x9d,0x5b,0xa4,0xce,0x2d,0xe1 -,0x72,0x8e,0x3b,0xf4,0x80,0x35,0x0f,0x25 -,0xe0,0x7e,0x21,0xc9,0x47,0xd1,0x9e,0x33 -,0x76,0xf0,0x9b,0x3c,0x1e,0x16,0x17,0x42 diff --git a/src/libnacl/tests/scalarmult7.out b/src/libnacl/tests/scalarmult7.out deleted file mode 100644 index bec21130..00000000 --- a/src/libnacl/tests/scalarmult7.out +++ /dev/null @@ -1,4 +0,0 @@ - 0x4a,0x5d,0x9d,0x5b,0xa4,0xce,0x2d,0xe1 -,0x72,0x8e,0x3b,0xf4,0x80,0x35,0x0f,0x25 -,0xe0,0x7e,0x21,0xc9,0x47,0xd1,0x9e,0x33 -,0x76,0xf0,0x9b,0x3c,0x1e,0x16,0x17,0x42 diff --git a/src/libnacl/tests/secretbox.c b/src/libnacl/tests/secretbox.c deleted file mode 100644 index 773f5b62..00000000 --- a/src/libnacl/tests/secretbox.c +++ /dev/null @@ -1,56 +0,0 @@ -#include -#include "crypto_secretbox_xsalsa20poly1305.h" - -unsigned char firstkey[32] = { - 0x1b,0x27,0x55,0x64,0x73,0xe9,0x85,0xd4 -,0x62,0xcd,0x51,0x19,0x7a,0x9a,0x46,0xc7 -,0x60,0x09,0x54,0x9e,0xac,0x64,0x74,0xf2 -,0x06,0xc4,0xee,0x08,0x44,0xf6,0x83,0x89 -} ; - -unsigned char nonce[24] = { - 0x69,0x69,0x6e,0xe9,0x55,0xb6,0x2b,0x73 -,0xcd,0x62,0xbd,0xa8,0x75,0xfc,0x73,0xd6 -,0x82,0x19,0xe0,0x03,0x6b,0x7a,0x0b,0x37 -} ; - -// API requires first 32 bytes to be 0 -unsigned char m[163] = { - 0, 0, 0, 0, 0, 0, 0, 0 -, 0, 0, 0, 0, 0, 0, 0, 0 -, 0, 0, 0, 0, 0, 0, 0, 0 -, 0, 0, 0, 0, 0, 0, 0, 0 -,0xbe,0x07,0x5f,0xc5,0x3c,0x81,0xf2,0xd5 -,0xcf,0x14,0x13,0x16,0xeb,0xeb,0x0c,0x7b -,0x52,0x28,0xc5,0x2a,0x4c,0x62,0xcb,0xd4 -,0x4b,0x66,0x84,0x9b,0x64,0x24,0x4f,0xfc -,0xe5,0xec,0xba,0xaf,0x33,0xbd,0x75,0x1a -,0x1a,0xc7,0x28,0xd4,0x5e,0x6c,0x61,0x29 -,0x6c,0xdc,0x3c,0x01,0x23,0x35,0x61,0xf4 -,0x1d,0xb6,0x6c,0xce,0x31,0x4a,0xdb,0x31 -,0x0e,0x3b,0xe8,0x25,0x0c,0x46,0xf0,0x6d -,0xce,0xea,0x3a,0x7f,0xa1,0x34,0x80,0x57 -,0xe2,0xf6,0x55,0x6a,0xd6,0xb1,0x31,0x8a -,0x02,0x4a,0x83,0x8f,0x21,0xaf,0x1f,0xde -,0x04,0x89,0x77,0xeb,0x48,0xf5,0x9f,0xfd -,0x49,0x24,0xca,0x1c,0x60,0x90,0x2e,0x52 -,0xf0,0xa0,0x89,0xbc,0x76,0x89,0x70,0x40 -,0xe0,0x82,0xf9,0x37,0x76,0x38,0x48,0x64 -,0x5e,0x07,0x05 -} ; - -unsigned char c[163]; - -main() -{ - int i; - crypto_secretbox_xsalsa20poly1305( - c,m,163,nonce,firstkey - ); - for (i = 16;i < 163;++i) { - printf(",0x%02x",(unsigned int) c[i]); - if (i % 8 == 7) printf("\n"); - } - printf("\n"); - return 0; -} diff --git a/src/libnacl/tests/secretbox.out b/src/libnacl/tests/secretbox.out deleted file mode 100644 index 2b6c51ea..00000000 --- a/src/libnacl/tests/secretbox.out +++ /dev/null @@ -1,19 +0,0 @@ -,0xf3,0xff,0xc7,0x70,0x3f,0x94,0x00,0xe5 -,0x2a,0x7d,0xfb,0x4b,0x3d,0x33,0x05,0xd9 -,0x8e,0x99,0x3b,0x9f,0x48,0x68,0x12,0x73 -,0xc2,0x96,0x50,0xba,0x32,0xfc,0x76,0xce -,0x48,0x33,0x2e,0xa7,0x16,0x4d,0x96,0xa4 -,0x47,0x6f,0xb8,0xc5,0x31,0xa1,0x18,0x6a -,0xc0,0xdf,0xc1,0x7c,0x98,0xdc,0xe8,0x7b -,0x4d,0xa7,0xf0,0x11,0xec,0x48,0xc9,0x72 -,0x71,0xd2,0xc2,0x0f,0x9b,0x92,0x8f,0xe2 -,0x27,0x0d,0x6f,0xb8,0x63,0xd5,0x17,0x38 -,0xb4,0x8e,0xee,0xe3,0x14,0xa7,0xcc,0x8a -,0xb9,0x32,0x16,0x45,0x48,0xe5,0x26,0xae -,0x90,0x22,0x43,0x68,0x51,0x7a,0xcf,0xea -,0xbd,0x6b,0xb3,0x73,0x2b,0xc0,0xe9,0xda -,0x99,0x83,0x2b,0x61,0xca,0x01,0xb6,0xde -,0x56,0x24,0x4a,0x9e,0x88,0xd5,0xf9,0xb3 -,0x79,0x73,0xf6,0x22,0xa4,0x3d,0x14,0xa6 -,0x59,0x9b,0x1f,0x65,0x4c,0xb4,0x5a,0x74 -,0xe3,0x55,0xa5 diff --git a/src/libnacl/tests/secretbox2.c b/src/libnacl/tests/secretbox2.c deleted file mode 100644 index b6a2a937..00000000 --- a/src/libnacl/tests/secretbox2.c +++ /dev/null @@ -1,57 +0,0 @@ -#include -#include "crypto_secretbox_xsalsa20poly1305.h" - -unsigned char firstkey[32] = { - 0x1b,0x27,0x55,0x64,0x73,0xe9,0x85,0xd4 -,0x62,0xcd,0x51,0x19,0x7a,0x9a,0x46,0xc7 -,0x60,0x09,0x54,0x9e,0xac,0x64,0x74,0xf2 -,0x06,0xc4,0xee,0x08,0x44,0xf6,0x83,0x89 -} ; - -unsigned char nonce[24] = { - 0x69,0x69,0x6e,0xe9,0x55,0xb6,0x2b,0x73 -,0xcd,0x62,0xbd,0xa8,0x75,0xfc,0x73,0xd6 -,0x82,0x19,0xe0,0x03,0x6b,0x7a,0x0b,0x37 -} ; - -// API requires first 16 bytes to be 0 -unsigned char c[163] = { - 0, 0, 0, 0, 0, 0, 0, 0 -, 0, 0, 0, 0, 0, 0, 0, 0 -,0xf3,0xff,0xc7,0x70,0x3f,0x94,0x00,0xe5 -,0x2a,0x7d,0xfb,0x4b,0x3d,0x33,0x05,0xd9 -,0x8e,0x99,0x3b,0x9f,0x48,0x68,0x12,0x73 -,0xc2,0x96,0x50,0xba,0x32,0xfc,0x76,0xce -,0x48,0x33,0x2e,0xa7,0x16,0x4d,0x96,0xa4 -,0x47,0x6f,0xb8,0xc5,0x31,0xa1,0x18,0x6a -,0xc0,0xdf,0xc1,0x7c,0x98,0xdc,0xe8,0x7b -,0x4d,0xa7,0xf0,0x11,0xec,0x48,0xc9,0x72 -,0x71,0xd2,0xc2,0x0f,0x9b,0x92,0x8f,0xe2 -,0x27,0x0d,0x6f,0xb8,0x63,0xd5,0x17,0x38 -,0xb4,0x8e,0xee,0xe3,0x14,0xa7,0xcc,0x8a -,0xb9,0x32,0x16,0x45,0x48,0xe5,0x26,0xae -,0x90,0x22,0x43,0x68,0x51,0x7a,0xcf,0xea -,0xbd,0x6b,0xb3,0x73,0x2b,0xc0,0xe9,0xda -,0x99,0x83,0x2b,0x61,0xca,0x01,0xb6,0xde -,0x56,0x24,0x4a,0x9e,0x88,0xd5,0xf9,0xb3 -,0x79,0x73,0xf6,0x22,0xa4,0x3d,0x14,0xa6 -,0x59,0x9b,0x1f,0x65,0x4c,0xb4,0x5a,0x74 -,0xe3,0x55,0xa5 -} ; - -unsigned char m[163]; - -main() -{ - int i; - if (crypto_secretbox_xsalsa20poly1305_open( - m,c,163,nonce,firstkey - ) == 0) { - for (i = 32;i < 163;++i) { - printf(",0x%02x",(unsigned int) m[i]); - if (i % 8 == 7) printf("\n"); - } - printf("\n"); - } - return 0; -} diff --git a/src/libnacl/tests/secretbox2.out b/src/libnacl/tests/secretbox2.out deleted file mode 100644 index c61d4557..00000000 --- a/src/libnacl/tests/secretbox2.out +++ /dev/null @@ -1,17 +0,0 @@ -,0xbe,0x07,0x5f,0xc5,0x3c,0x81,0xf2,0xd5 -,0xcf,0x14,0x13,0x16,0xeb,0xeb,0x0c,0x7b -,0x52,0x28,0xc5,0x2a,0x4c,0x62,0xcb,0xd4 -,0x4b,0x66,0x84,0x9b,0x64,0x24,0x4f,0xfc -,0xe5,0xec,0xba,0xaf,0x33,0xbd,0x75,0x1a -,0x1a,0xc7,0x28,0xd4,0x5e,0x6c,0x61,0x29 -,0x6c,0xdc,0x3c,0x01,0x23,0x35,0x61,0xf4 -,0x1d,0xb6,0x6c,0xce,0x31,0x4a,0xdb,0x31 -,0x0e,0x3b,0xe8,0x25,0x0c,0x46,0xf0,0x6d -,0xce,0xea,0x3a,0x7f,0xa1,0x34,0x80,0x57 -,0xe2,0xf6,0x55,0x6a,0xd6,0xb1,0x31,0x8a -,0x02,0x4a,0x83,0x8f,0x21,0xaf,0x1f,0xde -,0x04,0x89,0x77,0xeb,0x48,0xf5,0x9f,0xfd -,0x49,0x24,0xca,0x1c,0x60,0x90,0x2e,0x52 -,0xf0,0xa0,0x89,0xbc,0x76,0x89,0x70,0x40 -,0xe0,0x82,0xf9,0x37,0x76,0x38,0x48,0x64 -,0x5e,0x07,0x05 diff --git a/src/libnacl/tests/secretbox3.out b/src/libnacl/tests/secretbox3.out deleted file mode 100644 index 2b6c51ea..00000000 --- a/src/libnacl/tests/secretbox3.out +++ /dev/null @@ -1,19 +0,0 @@ -,0xf3,0xff,0xc7,0x70,0x3f,0x94,0x00,0xe5 -,0x2a,0x7d,0xfb,0x4b,0x3d,0x33,0x05,0xd9 -,0x8e,0x99,0x3b,0x9f,0x48,0x68,0x12,0x73 -,0xc2,0x96,0x50,0xba,0x32,0xfc,0x76,0xce -,0x48,0x33,0x2e,0xa7,0x16,0x4d,0x96,0xa4 -,0x47,0x6f,0xb8,0xc5,0x31,0xa1,0x18,0x6a -,0xc0,0xdf,0xc1,0x7c,0x98,0xdc,0xe8,0x7b -,0x4d,0xa7,0xf0,0x11,0xec,0x48,0xc9,0x72 -,0x71,0xd2,0xc2,0x0f,0x9b,0x92,0x8f,0xe2 -,0x27,0x0d,0x6f,0xb8,0x63,0xd5,0x17,0x38 -,0xb4,0x8e,0xee,0xe3,0x14,0xa7,0xcc,0x8a -,0xb9,0x32,0x16,0x45,0x48,0xe5,0x26,0xae -,0x90,0x22,0x43,0x68,0x51,0x7a,0xcf,0xea -,0xbd,0x6b,0xb3,0x73,0x2b,0xc0,0xe9,0xda -,0x99,0x83,0x2b,0x61,0xca,0x01,0xb6,0xde -,0x56,0x24,0x4a,0x9e,0x88,0xd5,0xf9,0xb3 -,0x79,0x73,0xf6,0x22,0xa4,0x3d,0x14,0xa6 -,0x59,0x9b,0x1f,0x65,0x4c,0xb4,0x5a,0x74 -,0xe3,0x55,0xa5 diff --git a/src/libnacl/tests/secretbox4.out b/src/libnacl/tests/secretbox4.out deleted file mode 100644 index c61d4557..00000000 --- a/src/libnacl/tests/secretbox4.out +++ /dev/null @@ -1,17 +0,0 @@ -,0xbe,0x07,0x5f,0xc5,0x3c,0x81,0xf2,0xd5 -,0xcf,0x14,0x13,0x16,0xeb,0xeb,0x0c,0x7b -,0x52,0x28,0xc5,0x2a,0x4c,0x62,0xcb,0xd4 -,0x4b,0x66,0x84,0x9b,0x64,0x24,0x4f,0xfc -,0xe5,0xec,0xba,0xaf,0x33,0xbd,0x75,0x1a -,0x1a,0xc7,0x28,0xd4,0x5e,0x6c,0x61,0x29 -,0x6c,0xdc,0x3c,0x01,0x23,0x35,0x61,0xf4 -,0x1d,0xb6,0x6c,0xce,0x31,0x4a,0xdb,0x31 -,0x0e,0x3b,0xe8,0x25,0x0c,0x46,0xf0,0x6d -,0xce,0xea,0x3a,0x7f,0xa1,0x34,0x80,0x57 -,0xe2,0xf6,0x55,0x6a,0xd6,0xb1,0x31,0x8a -,0x02,0x4a,0x83,0x8f,0x21,0xaf,0x1f,0xde -,0x04,0x89,0x77,0xeb,0x48,0xf5,0x9f,0xfd -,0x49,0x24,0xca,0x1c,0x60,0x90,0x2e,0x52 -,0xf0,0xa0,0x89,0xbc,0x76,0x89,0x70,0x40 -,0xe0,0x82,0xf9,0x37,0x76,0x38,0x48,0x64 -,0x5e,0x07,0x05 diff --git a/src/libnacl/tests/secretbox5.out b/src/libnacl/tests/secretbox5.out deleted file mode 100644 index e69de29b..00000000 diff --git a/src/libnacl/tests/secretbox6.out b/src/libnacl/tests/secretbox6.out deleted file mode 100644 index e69de29b..00000000 diff --git a/src/libnacl/tests/secretbox7.c b/src/libnacl/tests/secretbox7.c deleted file mode 100644 index d4be9b49..00000000 --- a/src/libnacl/tests/secretbox7.c +++ /dev/null @@ -1,32 +0,0 @@ -#include -#include "crypto_secretbox.h" -#include "randombytes.h" - -unsigned char k[crypto_secretbox_KEYBYTES]; -unsigned char n[crypto_secretbox_NONCEBYTES]; -unsigned char m[10000]; -unsigned char c[10000]; -unsigned char m2[10000]; - -main() -{ - int mlen; - int i; - - for (mlen = 0;mlen < 1000 && mlen + crypto_secretbox_ZEROBYTES < sizeof m;++mlen) { - randombytes(k,crypto_secretbox_KEYBYTES); - randombytes(n,crypto_secretbox_NONCEBYTES); - randombytes(m + crypto_secretbox_ZEROBYTES,mlen); - crypto_secretbox(c,m,mlen + crypto_secretbox_ZEROBYTES,n,k); - if (crypto_secretbox_open(m2,c,mlen + crypto_secretbox_ZEROBYTES,n,k) == 0) { - for (i = 0;i < mlen + crypto_secretbox_ZEROBYTES;++i) - if (m2[i] != m[i]) { - printf("bad decryption\n"); - break; - } - } else { - printf("ciphertext fails verification\n"); - } - } - return 0; -} diff --git a/src/libnacl/tests/secretbox7.out b/src/libnacl/tests/secretbox7.out deleted file mode 100644 index e69de29b..00000000 diff --git a/src/libnacl/tests/secretbox8.c b/src/libnacl/tests/secretbox8.c deleted file mode 100644 index 3e0e8f80..00000000 --- a/src/libnacl/tests/secretbox8.c +++ /dev/null @@ -1,39 +0,0 @@ -#include -#include -#include "crypto_secretbox.h" -#include "randombytes.h" -#include "windows/windows-quirks.h" - -unsigned char k[crypto_secretbox_KEYBYTES]; -unsigned char n[crypto_secretbox_NONCEBYTES]; -unsigned char m[10000]; -unsigned char c[10000]; -unsigned char m2[10000]; - -main() -{ - int mlen; - int i; - int caught; - - for (mlen = 0;mlen < 1000 && mlen + crypto_secretbox_ZEROBYTES < sizeof m;++mlen) { - randombytes(k,crypto_secretbox_KEYBYTES); - randombytes(n,crypto_secretbox_NONCEBYTES); - randombytes(m + crypto_secretbox_ZEROBYTES,mlen); - crypto_secretbox(c,m,mlen + crypto_secretbox_ZEROBYTES,n,k); - caught = 0; - while (caught < 10) { - c[random() % (mlen + crypto_secretbox_ZEROBYTES)] = random(); - if (crypto_secretbox_open(m2,c,mlen + crypto_secretbox_ZEROBYTES,n,k) == 0) { - for (i = 0;i < mlen + crypto_secretbox_ZEROBYTES;++i) - if (m2[i] != m[i]) { - printf("forgery\n"); - return 100; - } - } else { - ++caught; - } - } - } - return 0; -} diff --git a/src/libnacl/tests/secretbox8.out b/src/libnacl/tests/secretbox8.out deleted file mode 100644 index e69de29b..00000000 diff --git a/src/libnacl/tests/stream.c b/src/libnacl/tests/stream.c deleted file mode 100644 index ebb39398..00000000 --- a/src/libnacl/tests/stream.c +++ /dev/null @@ -1,29 +0,0 @@ -#include -#include "crypto_stream_xsalsa20.h" -#include "crypto_hash_sha256.h" - -unsigned char firstkey[32] = { - 0x1b,0x27,0x55,0x64,0x73,0xe9,0x85,0xd4 -,0x62,0xcd,0x51,0x19,0x7a,0x9a,0x46,0xc7 -,0x60,0x09,0x54,0x9e,0xac,0x64,0x74,0xf2 -,0x06,0xc4,0xee,0x08,0x44,0xf6,0x83,0x89 -} ; - -unsigned char nonce[24] = { - 0x69,0x69,0x6e,0xe9,0x55,0xb6,0x2b,0x73 -,0xcd,0x62,0xbd,0xa8,0x75,0xfc,0x73,0xd6 -,0x82,0x19,0xe0,0x03,0x6b,0x7a,0x0b,0x37 -} ; - -unsigned char output[4194304]; - -unsigned char h[32]; - -main() -{ - int i; - crypto_stream_xsalsa20(output,4194304,nonce,firstkey); - crypto_hash_sha256(h,output,sizeof output); - for (i = 0;i < 32;++i) printf("%02x",h[i]); printf("\n"); - return 0; -} diff --git a/src/libnacl/tests/stream.out b/src/libnacl/tests/stream.out deleted file mode 100644 index 5fa208c1..00000000 --- a/src/libnacl/tests/stream.out +++ /dev/null @@ -1 +0,0 @@ -662b9d0e3463029156069b12f918691a98f7dfb2ca0393c96bbfc6b1fbd630a2 diff --git a/src/libnacl/tests/stream2.c b/src/libnacl/tests/stream2.c deleted file mode 100644 index 12f13de4..00000000 --- a/src/libnacl/tests/stream2.c +++ /dev/null @@ -1,27 +0,0 @@ -#include -#include "crypto_stream_salsa20.h" -#include "crypto_hash_sha256.h" - -unsigned char secondkey[32] = { - 0xdc,0x90,0x8d,0xda,0x0b,0x93,0x44,0xa9 -,0x53,0x62,0x9b,0x73,0x38,0x20,0x77,0x88 -,0x80,0xf3,0xce,0xb4,0x21,0xbb,0x61,0xb9 -,0x1c,0xbd,0x4c,0x3e,0x66,0x25,0x6c,0xe4 -} ; - -unsigned char noncesuffix[8] = { - 0x82,0x19,0xe0,0x03,0x6b,0x7a,0x0b,0x37 -} ; - -unsigned char output[4194304]; - -unsigned char h[32]; - -main() -{ - int i; - crypto_stream_salsa20(output,4194304,noncesuffix,secondkey); - crypto_hash_sha256(h,output,sizeof output); - for (i = 0;i < 32;++i) printf("%02x",h[i]); printf("\n"); - return 0; -} diff --git a/src/libnacl/tests/stream2.out b/src/libnacl/tests/stream2.out deleted file mode 100644 index 5fa208c1..00000000 --- a/src/libnacl/tests/stream2.out +++ /dev/null @@ -1 +0,0 @@ -662b9d0e3463029156069b12f918691a98f7dfb2ca0393c96bbfc6b1fbd630a2 diff --git a/src/libnacl/tests/stream3.c b/src/libnacl/tests/stream3.c deleted file mode 100644 index 7798dc18..00000000 --- a/src/libnacl/tests/stream3.c +++ /dev/null @@ -1,28 +0,0 @@ -#include -#include "crypto_stream_xsalsa20.h" - -unsigned char firstkey[32] = { - 0x1b,0x27,0x55,0x64,0x73,0xe9,0x85,0xd4 -,0x62,0xcd,0x51,0x19,0x7a,0x9a,0x46,0xc7 -,0x60,0x09,0x54,0x9e,0xac,0x64,0x74,0xf2 -,0x06,0xc4,0xee,0x08,0x44,0xf6,0x83,0x89 -} ; - -unsigned char nonce[24] = { - 0x69,0x69,0x6e,0xe9,0x55,0xb6,0x2b,0x73 -,0xcd,0x62,0xbd,0xa8,0x75,0xfc,0x73,0xd6 -,0x82,0x19,0xe0,0x03,0x6b,0x7a,0x0b,0x37 -} ; - -unsigned char rs[32]; - -main() -{ - int i; - crypto_stream_xsalsa20(rs,32,nonce,firstkey); - for (i = 0;i < 32;++i) { - printf(",0x%02x",(unsigned int) rs[i]); - if (i % 8 == 7) printf("\n"); - } - return 0; -} diff --git a/src/libnacl/tests/stream3.out b/src/libnacl/tests/stream3.out deleted file mode 100644 index 9cd78798..00000000 --- a/src/libnacl/tests/stream3.out +++ /dev/null @@ -1,4 +0,0 @@ -,0xee,0xa6,0xa7,0x25,0x1c,0x1e,0x72,0x91 -,0x6d,0x11,0xc2,0xcb,0x21,0x4d,0x3c,0x25 -,0x25,0x39,0x12,0x1d,0x8e,0x23,0x4e,0x65 -,0x2d,0x65,0x1f,0xa4,0xc8,0xcf,0xf8,0x80 diff --git a/src/libnacl/tests/stream4.c b/src/libnacl/tests/stream4.c deleted file mode 100644 index 84d8c523..00000000 --- a/src/libnacl/tests/stream4.c +++ /dev/null @@ -1,53 +0,0 @@ -#include -#include "crypto_stream_xsalsa20.h" - -unsigned char firstkey[32] = { - 0x1b,0x27,0x55,0x64,0x73,0xe9,0x85,0xd4 -,0x62,0xcd,0x51,0x19,0x7a,0x9a,0x46,0xc7 -,0x60,0x09,0x54,0x9e,0xac,0x64,0x74,0xf2 -,0x06,0xc4,0xee,0x08,0x44,0xf6,0x83,0x89 -} ; - -unsigned char nonce[24] = { - 0x69,0x69,0x6e,0xe9,0x55,0xb6,0x2b,0x73 -,0xcd,0x62,0xbd,0xa8,0x75,0xfc,0x73,0xd6 -,0x82,0x19,0xe0,0x03,0x6b,0x7a,0x0b,0x37 -} ; - -unsigned char m[163] = { - 0, 0, 0, 0, 0, 0, 0, 0 -, 0, 0, 0, 0, 0, 0, 0, 0 -, 0, 0, 0, 0, 0, 0, 0, 0 -, 0, 0, 0, 0, 0, 0, 0, 0 -,0xbe,0x07,0x5f,0xc5,0x3c,0x81,0xf2,0xd5 -,0xcf,0x14,0x13,0x16,0xeb,0xeb,0x0c,0x7b -,0x52,0x28,0xc5,0x2a,0x4c,0x62,0xcb,0xd4 -,0x4b,0x66,0x84,0x9b,0x64,0x24,0x4f,0xfc -,0xe5,0xec,0xba,0xaf,0x33,0xbd,0x75,0x1a -,0x1a,0xc7,0x28,0xd4,0x5e,0x6c,0x61,0x29 -,0x6c,0xdc,0x3c,0x01,0x23,0x35,0x61,0xf4 -,0x1d,0xb6,0x6c,0xce,0x31,0x4a,0xdb,0x31 -,0x0e,0x3b,0xe8,0x25,0x0c,0x46,0xf0,0x6d -,0xce,0xea,0x3a,0x7f,0xa1,0x34,0x80,0x57 -,0xe2,0xf6,0x55,0x6a,0xd6,0xb1,0x31,0x8a -,0x02,0x4a,0x83,0x8f,0x21,0xaf,0x1f,0xde -,0x04,0x89,0x77,0xeb,0x48,0xf5,0x9f,0xfd -,0x49,0x24,0xca,0x1c,0x60,0x90,0x2e,0x52 -,0xf0,0xa0,0x89,0xbc,0x76,0x89,0x70,0x40 -,0xe0,0x82,0xf9,0x37,0x76,0x38,0x48,0x64 -,0x5e,0x07,0x05 -} ; - -unsigned char c[163]; - -main() -{ - int i; - crypto_stream_xsalsa20_xor(c,m,163,nonce,firstkey); - for (i = 32;i < 163;++i) { - printf(",0x%02x",(unsigned int) c[i]); - if (i % 8 == 7) printf("\n"); - } - printf("\n"); - return 0; -} diff --git a/src/libnacl/tests/stream4.out b/src/libnacl/tests/stream4.out deleted file mode 100644 index 0d3d8e94..00000000 --- a/src/libnacl/tests/stream4.out +++ /dev/null @@ -1,17 +0,0 @@ -,0x8e,0x99,0x3b,0x9f,0x48,0x68,0x12,0x73 -,0xc2,0x96,0x50,0xba,0x32,0xfc,0x76,0xce -,0x48,0x33,0x2e,0xa7,0x16,0x4d,0x96,0xa4 -,0x47,0x6f,0xb8,0xc5,0x31,0xa1,0x18,0x6a -,0xc0,0xdf,0xc1,0x7c,0x98,0xdc,0xe8,0x7b -,0x4d,0xa7,0xf0,0x11,0xec,0x48,0xc9,0x72 -,0x71,0xd2,0xc2,0x0f,0x9b,0x92,0x8f,0xe2 -,0x27,0x0d,0x6f,0xb8,0x63,0xd5,0x17,0x38 -,0xb4,0x8e,0xee,0xe3,0x14,0xa7,0xcc,0x8a -,0xb9,0x32,0x16,0x45,0x48,0xe5,0x26,0xae -,0x90,0x22,0x43,0x68,0x51,0x7a,0xcf,0xea -,0xbd,0x6b,0xb3,0x73,0x2b,0xc0,0xe9,0xda -,0x99,0x83,0x2b,0x61,0xca,0x01,0xb6,0xde -,0x56,0x24,0x4a,0x9e,0x88,0xd5,0xf9,0xb3 -,0x79,0x73,0xf6,0x22,0xa4,0x3d,0x14,0xa6 -,0x59,0x9b,0x1f,0x65,0x4c,0xb4,0x5a,0x74 -,0xe3,0x55,0xa5 diff --git a/src/libnacl/tests/stream5.out b/src/libnacl/tests/stream5.out deleted file mode 100644 index 5fa208c1..00000000 --- a/src/libnacl/tests/stream5.out +++ /dev/null @@ -1 +0,0 @@ -662b9d0e3463029156069b12f918691a98f7dfb2ca0393c96bbfc6b1fbd630a2 diff --git a/src/libnacl/tests/stream6.out b/src/libnacl/tests/stream6.out deleted file mode 100644 index 5fa208c1..00000000 --- a/src/libnacl/tests/stream6.out +++ /dev/null @@ -1 +0,0 @@ -662b9d0e3463029156069b12f918691a98f7dfb2ca0393c96bbfc6b1fbd630a2 diff --git a/src/libnacl/tests/stream7.out b/src/libnacl/tests/stream7.out deleted file mode 100644 index 9cd78798..00000000 --- a/src/libnacl/tests/stream7.out +++ /dev/null @@ -1,4 +0,0 @@ -,0xee,0xa6,0xa7,0x25,0x1c,0x1e,0x72,0x91 -,0x6d,0x11,0xc2,0xcb,0x21,0x4d,0x3c,0x25 -,0x25,0x39,0x12,0x1d,0x8e,0x23,0x4e,0x65 -,0x2d,0x65,0x1f,0xa4,0xc8,0xcf,0xf8,0x80 diff --git a/src/libnacl/tests/stream8.out b/src/libnacl/tests/stream8.out deleted file mode 100644 index 0d3d8e94..00000000 --- a/src/libnacl/tests/stream8.out +++ /dev/null @@ -1,17 +0,0 @@ -,0x8e,0x99,0x3b,0x9f,0x48,0x68,0x12,0x73 -,0xc2,0x96,0x50,0xba,0x32,0xfc,0x76,0xce -,0x48,0x33,0x2e,0xa7,0x16,0x4d,0x96,0xa4 -,0x47,0x6f,0xb8,0xc5,0x31,0xa1,0x18,0x6a -,0xc0,0xdf,0xc1,0x7c,0x98,0xdc,0xe8,0x7b -,0x4d,0xa7,0xf0,0x11,0xec,0x48,0xc9,0x72 -,0x71,0xd2,0xc2,0x0f,0x9b,0x92,0x8f,0xe2 -,0x27,0x0d,0x6f,0xb8,0x63,0xd5,0x17,0x38 -,0xb4,0x8e,0xee,0xe3,0x14,0xa7,0xcc,0x8a -,0xb9,0x32,0x16,0x45,0x48,0xe5,0x26,0xae -,0x90,0x22,0x43,0x68,0x51,0x7a,0xcf,0xea -,0xbd,0x6b,0xb3,0x73,0x2b,0xc0,0xe9,0xda -,0x99,0x83,0x2b,0x61,0xca,0x01,0xb6,0xde -,0x56,0x24,0x4a,0x9e,0x88,0xd5,0xf9,0xb3 -,0x79,0x73,0xf6,0x22,0xa4,0x3d,0x14,0xa6 -,0x59,0x9b,0x1f,0x65,0x4c,0xb4,0x5a,0x74 -,0xe3,0x55,0xa5 diff --git a/src/libnacl/try-anything.c b/src/libnacl/try-anything.c deleted file mode 100644 index aa6a2851..00000000 --- a/src/libnacl/try-anything.c +++ /dev/null @@ -1,177 +0,0 @@ -/* - * try-anything.c version 20090215 - * D. J. Bernstein - * Public domain. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#ifndef _WIN32 -# include -#endif -#include "cpucycles.h" -#include "windows/windows-quirks.h" - -typedef uint32_t uint32; - -static uint32 seed[32] = { 3,1,4,1,5,9,2,6,5,3,5,8,9,7,9,3,2,3,8,4,6,2,6,4,3,3,8,3,2,7,9,5 } ; -static uint32 in[12]; -static uint32 out[8]; -static int outleft = 0; - -#define ROTATE(x,b) (((x) << (b)) | ((x) >> (32 - (b)))) -#define MUSH(i,b) x = t[i] += (((x ^ seed[i]) + sum) ^ ROTATE(x,b)); - -static void surf(void) -{ - uint32 t[12]; uint32 x; uint32 sum = 0; - int r; int i; int loop; - - for (i = 0;i < 12;++i) t[i] = in[i] ^ seed[12 + i]; - for (i = 0;i < 8;++i) out[i] = seed[24 + i]; - x = t[11]; - for (loop = 0;loop < 2;++loop) { - for (r = 0;r < 16;++r) { - sum += 0x9e3779b9; - MUSH(0,5) MUSH(1,7) MUSH(2,9) MUSH(3,13) - MUSH(4,5) MUSH(5,7) MUSH(6,9) MUSH(7,13) - MUSH(8,5) MUSH(9,7) MUSH(10,9) MUSH(11,13) - } - for (i = 0;i < 8;++i) out[i] ^= t[i + 4]; - } -} - -void randombytes(unsigned char *x,unsigned long long xlen) -{ - while (xlen > 0) { - if (!outleft) { - if (!++in[0]) if (!++in[1]) if (!++in[2]) ++in[3]; - surf(); - outleft = 8; - } - *x = out[--outleft]; - ++x; - --xlen; - } -} - -extern void preallocate(void); -extern void allocate(void); -extern void predoit(void); -extern void doit(void); -extern char checksum[]; -extern const char *checksum_compute(void); -extern const char *primitiveimplementation; - -static void printword(const char *s) -{ - if (!*s) putchar('-'); - while (*s) { - if (*s == ' ') putchar('_'); - else if (*s == '\t') putchar('_'); - else if (*s == '\r') putchar('_'); - else if (*s == '\n') putchar('_'); - else putchar(*s); - ++s; - } - putchar(' '); -} - -static void printnum(long long x) -{ - printf("%lld ",x); -} - -static void fail(const char *why) -{ - printf("%s\n",why); - exit(111); -} - -unsigned char *alignedcalloc(unsigned long long len) -{ - unsigned char *x = (unsigned char *) calloc(1,len + 256); - long long i; - if (!x) fail("out of memory"); - /* will never deallocate so shifting is ok */ - for (i = 0;i < len + 256;++i) x[i] = random(); - x += 64; - x += 63 & (-(unsigned long) x); - for (i = 0;i < len;++i) x[i] = 0; - return x; -} - -#define TIMINGS 63 -static long long cycles[TIMINGS + 1]; - -void limits() -{ -#ifdef RLIM_INFINITY - struct rlimit r; - r.rlim_cur = 0; - r.rlim_max = 0; -#ifdef RLIMIT_NOFILE - setrlimit(RLIMIT_NOFILE,&r); -#endif -#ifdef RLIMIT_NPROC - setrlimit(RLIMIT_NPROC,&r); -#endif -#ifdef RLIMIT_CORE - setrlimit(RLIMIT_CORE,&r); -#endif -#endif -} - -int main() -{ - long long i; - long long j; - long long abovej; - long long belowj; - long long checksumcycles; - long long cyclespersecond; - const char *problem; - - cyclespersecond = cpucycles_persecond(); - preallocate(); - limits(); - - allocate(); - srandom(getpid()); - - cycles[0] = cpucycles(); - problem = checksum_compute(); if (problem) fail(problem); - cycles[1] = cpucycles(); - checksumcycles = cycles[1] - cycles[0]; - - predoit(); - for (i = 0;i <= TIMINGS;++i) { - cycles[i] = cpucycles(); - } - for (i = 0;i <= TIMINGS;++i) { - cycles[i] = cpucycles(); - doit(); - } - for (i = 0;i < TIMINGS;++i) cycles[i] = cycles[i + 1] - cycles[i]; - for (j = 0;j < TIMINGS;++j) { - belowj = 0; - for (i = 0;i < TIMINGS;++i) if (cycles[i] < cycles[j]) ++belowj; - abovej = 0; - for (i = 0;i < TIMINGS;++i) if (cycles[i] > cycles[j]) ++abovej; - if (belowj * 2 < TIMINGS && abovej * 2 < TIMINGS) break; - } - - printword(checksum); - printnum(cycles[j]); - printnum(checksumcycles); - printnum(cyclespersecond); - printword(primitiveimplementation); - printf("\n"); - return 0; -} diff --git a/src/libnacl/version b/src/libnacl/version deleted file mode 100644 index 97840598..00000000 --- a/src/libnacl/version +++ /dev/null @@ -1 +0,0 @@ -20110221 diff --git a/src/libnacl/windows/include/windows-quirks.h b/src/libnacl/windows/include/windows-quirks.h deleted file mode 100644 index 11d82bf9..00000000 --- a/src/libnacl/windows/include/windows-quirks.h +++ /dev/null @@ -1,18 +0,0 @@ - -#include - -#ifdef _WIN32 - -static void -srandom(unsigned seed) -{ - srand(seed); -} - -static long -random(void) -{ - return (long) rand(); -} - -#endif diff --git a/src/plugins/Makefile.am b/src/plugins/Makefile.am index 76719e04..61b9192c 100644 --- a/src/plugins/Makefile.am +++ b/src/plugins/Makefile.am @@ -10,6 +10,6 @@ if USE_LDNS SUBDIRS += \ example-ldns-aaaa-blocking \ example-ldns-blocking \ - example-ldns-forward-after-nxdomain \ - example-ldns-opendns-deviceid + example-ldns-opendns-deviceid \ + example-ldns-opendns-set-client-ip endif diff --git a/src/plugins/example-ldns-aaaa-blocking/example-ldns-aaaa-blocking.c b/src/plugins/example-ldns-aaaa-blocking/example-ldns-aaaa-blocking.c index 3c06a4ba..5c0f089e 100644 --- a/src/plugins/example-ldns-aaaa-blocking/example-ldns-aaaa-blocking.c +++ b/src/plugins/example-ldns-aaaa-blocking/example-ldns-aaaa-blocking.c @@ -1,6 +1,10 @@ #include +#ifdef _WIN32 +# include +#endif + #include #include diff --git a/src/plugins/example-ldns-blocking/example-ldns-blocking.c b/src/plugins/example-ldns-blocking/example-ldns-blocking.c index f7a99fd2..28dd6282 100644 --- a/src/plugins/example-ldns-blocking/example-ldns-blocking.c +++ b/src/plugins/example-ldns-blocking/example-ldns-blocking.c @@ -7,6 +7,10 @@ #include #include +#ifdef _WIN32 +# include +#endif + #include #include diff --git a/src/plugins/example-ldns-forward-after-nxdomain/Makefile.am b/src/plugins/example-ldns-forward-after-nxdomain/Makefile.am deleted file mode 100644 index 4de6787f..00000000 --- a/src/plugins/example-ldns-forward-after-nxdomain/Makefile.am +++ /dev/null @@ -1,21 +0,0 @@ - -pkglib_LTLIBRARIES = \ - libdcplugin_example_ldns_forward_after_nxdomain.la - -libdcplugin_example_ldns_forward_after_nxdomain_la_LIBTOOLFLAGS = --tag=disable-static - -libdcplugin_example_ldns_forward_after_nxdomain_la_SOURCES = \ - example-ldns-forward-after-nxdomain.c - -libdcplugin_example_ldns_forward_after_nxdomain_la_LIBADD = @LDNS_LIBS@ - -libdcplugin_example_ldns_forward_after_nxdomain_la_LDFLAGS = \ - $(AM_LDFLAGS) \ - -avoid-version \ - -export-dynamic \ - -module \ - -no-undefined - -libdcplugin_example_ldns_forward_after_nxdomain_la_CPPFLAGS = \ - $(LTDLINCL) \ - -I../../include diff --git a/src/plugins/example-ldns-forward-after-nxdomain/example-ldns-forward-after-nxdomain.c b/src/plugins/example-ldns-forward-after-nxdomain/example-ldns-forward-after-nxdomain.c deleted file mode 100644 index 0226d2f7..00000000 --- a/src/plugins/example-ldns-forward-after-nxdomain/example-ldns-forward-after-nxdomain.c +++ /dev/null @@ -1,96 +0,0 @@ - -#include -#include - -DCPLUGIN_MAIN(__FILE__); - -typedef struct Forwarder_ { - ldns_resolver *resolver; -} Forwarder; - -const char * -dcplugin_description(DCPlugin * const dcplugin) -{ - return "Resolve a name without dnscrypt after an NXDOMAIN response"; -} - -const char * -dcplugin_long_description(DCPlugin * const dcplugin) -{ - return - "Example usage:\n" - "\n" - "# dnscrypt-proxy --plugin \\\n" - " libdcplugin_example_ldns_forward_after_nxdomain.la,/etc/resolv.conf"; -} - -int -dcplugin_init(DCPlugin * const dcplugin, int argc, char *argv[]) -{ - Forwarder *forwarder; - const char *resolver_conf = NULL; - - forwarder = calloc(1U, sizeof *forwarder); - dcplugin_set_user_data(dcplugin, forwarder); - if (forwarder == NULL) { - return -1; - } - if (argc > 1) { - resolver_conf = argv[1]; - } - if (ldns_resolver_new_frm_file(&forwarder->resolver, resolver_conf) - != LDNS_STATUS_OK) { - return -1; - } - ldns_resolver_set_retry(forwarder->resolver, 1); - ldns_resolver_set_timeout(forwarder->resolver, (struct timeval) { - .tv_sec = 2, .tv_usec = 0 - }); - return 0; -} - -int -dcplugin_destroy(DCPlugin *dcplugin) -{ - Forwarder *forwarder = dcplugin_get_user_data(dcplugin); - - if (forwarder == NULL) { - return 0; - } - ldns_resolver_deep_free(forwarder->resolver); - free(forwarder); - - return 0; -} - -DCPluginSyncFilterResult -dcplugin_sync_post_filter(DCPlugin *dcplugin, DCPluginDNSPacket *dcp_packet) -{ - Forwarder *forwarder = dcplugin_get_user_data(dcplugin); - ldns_pkt *query = NULL; - ldns_pkt *response = NULL; - uint8_t *query_wire = dcplugin_get_wire_data(dcp_packet); - uint8_t *response_wire = NULL; - size_t response_wire_len; - - if (LDNS_RCODE_WIRE(query_wire) != LDNS_RCODE_NXDOMAIN) { - return DCP_SYNC_FILTER_RESULT_OK; - } - LDNS_AA_CLR(query_wire); - LDNS_QR_CLR(query_wire); - LDNS_TC_CLR(query_wire); - ldns_wire2pkt(&query, query_wire, dcplugin_get_wire_data_len(dcp_packet)); - ldns_pkt_set_edns_data(query, ldns_rdf_new_frm_str(LDNS_RDF_TYPE_HEX, "")); - ldns_send(&response, forwarder->resolver, query); - ldns_pkt_free(query); - ldns_pkt2wire(&response_wire, response, &response_wire_len); - ldns_pkt_free(response); - if (response_wire_len > dcplugin_get_wire_data_max_len(dcp_packet)) { - free(response_wire); - return DCP_SYNC_FILTER_RESULT_ERROR; - } - dcplugin_set_wire_data(dcp_packet, response_wire, response_wire_len); - free(response_wire); - - return DCP_SYNC_FILTER_RESULT_OK; -} diff --git a/src/plugins/example-ldns-opendns-deviceid/example-ldns-opendns-deviceid.c b/src/plugins/example-ldns-opendns-deviceid/example-ldns-opendns-deviceid.c index 31e2bbdb..d2aa2507 100644 --- a/src/plugins/example-ldns-opendns-deviceid/example-ldns-opendns-deviceid.c +++ b/src/plugins/example-ldns-opendns-deviceid/example-ldns-opendns-deviceid.c @@ -4,6 +4,10 @@ #include #include +#ifdef _WIN32 +# include +#endif + #include #include @@ -22,17 +26,23 @@ const char * dcplugin_long_description(DCPlugin * const dcplugin) { return - "This plugin is only useful when using OpenDNS with specific routers\n" - "and enterprise products.\n" + "This plugin tags outgoing packets with a 64-bit shared secret key\n" + "for the OpenDNS Umbrella Mobility service.\n" + "\n" + "If you happen to have an OpenDNS Umbrella Mobility account,\n" + "your secret key ('device id') can be retrieved with:\n" + "\n" + "$ dig txt debug.opendns.com\n" "\n" - "# dnscrypt-proxy --plugin \\\n" - " libdcplugin_example_ldns_opendns_deviceid.la,XXXXXXXXXXXXXXXX"; + "# env OPENDNS_DEVICE_ID='' dnscrypt-proxy --plugin \\\n" + " libdcplugin_example_ldns_opendns_deviceid.la"; } int dcplugin_init(DCPlugin * const dcplugin, int argc, char *argv[]) { char *device_id; + char *device_id_env; char *edns_hex; size_t edns_hex_size = sizeof EDNS_HEADER EDNS_DEV_ID; @@ -43,14 +53,14 @@ dcplugin_init(DCPlugin * const dcplugin, int argc, char *argv[]) } memcpy(edns_hex, EDNS_HEADER EDNS_DEV_ID, edns_hex_size); assert(sizeof EDNS_DEV_ID - 1U == (size_t) 16U); - device_id = getenv("OPENDNS_DEVICE_ID"); - if (argc > 1 && strlen(argv[1]) == (size_t) 16U) { - device_id = argv[1]; - } + device_id = device_id_env = getenv("OPENDNS_DEVICE_ID"); if (device_id != NULL) { memcpy(edns_hex + sizeof EDNS_HEADER - (size_t) 1U, device_id, sizeof EDNS_DEV_ID); } + if (device_id_env != NULL) { + memset(device_id_env, 0, strlen(device_id_env)); + } return 0; } diff --git a/src/plugins/example-ldns-opendns-set-client-ip/Makefile.am b/src/plugins/example-ldns-opendns-set-client-ip/Makefile.am new file mode 100644 index 00000000..5b9bb769 --- /dev/null +++ b/src/plugins/example-ldns-opendns-set-client-ip/Makefile.am @@ -0,0 +1,21 @@ + +pkglib_LTLIBRARIES = \ + libdcplugin_example_ldns_opendns_set_client_ip.la + +libdcplugin_example_ldns_opendns_set_client_ip_la_LIBTOOLFLAGS = --tag=disable-static + +libdcplugin_example_ldns_opendns_set_client_ip_la_SOURCES = \ + example-ldns-opendns-set-client-ip.c + +libdcplugin_example_ldns_opendns_set_client_ip_la_LIBADD = @LDNS_LIBS@ + +libdcplugin_example_ldns_opendns_set_client_ip_la_LDFLAGS = \ + $(AM_LDFLAGS) \ + -avoid-version \ + -export-dynamic \ + -module \ + -no-undefined + +libdcplugin_example_ldns_opendns_set_client_ip_la_CPPFLAGS = \ + $(LTDLINCL) \ + -I../../include diff --git a/src/plugins/example-ldns-opendns-set-client-ip/example-ldns-opendns-set-client-ip.c b/src/plugins/example-ldns-opendns-set-client-ip/example-ldns-opendns-set-client-ip.c new file mode 100644 index 00000000..dda9ab04 --- /dev/null +++ b/src/plugins/example-ldns-opendns-set-client-ip/example-ldns-opendns-set-client-ip.c @@ -0,0 +1,178 @@ + +#include +#ifndef _WIN32 +# include +# include +# include +#endif + +#include +#include +#include +#include + +#ifdef _WIN32 +# include +#endif + +#include +#include +#include + +DCPLUGIN_MAIN(__FILE__); + +#define EDNS_HEADER "4f56" "0014" "4f444e5300" "00" +#define EDNS_HEADER_CLIENT_IP "10" +#define EDNS_CLIENT_IP "7f000001" +#define EDNS_HEADER_FODDER "40" +#define EDNS_FODDER "deadbeefabad1dea" + +#define EDNS_DATA EDNS_HEADER \ + EDNS_HEADER_CLIENT_IP EDNS_CLIENT_IP EDNS_HEADER_FODDER EDNS_FODDER + +#define EDNS_CLIENT_IP_OFFSET (sizeof EDNS_HEADER - 1U + \ + sizeof EDNS_HEADER_CLIENT_IP - 1U) + +#define EDNS_FODDER_OFFSET (sizeof EDNS_HEADER - 1U + \ + sizeof EDNS_HEADER_CLIENT_IP - 1U + \ + sizeof EDNS_CLIENT_IP - 1U + \ + sizeof EDNS_HEADER_FODDER - 1U) + +const char * +dcplugin_description(DCPlugin * const dcplugin) +{ + return "Apply the OpenDNS settings defined for a specific IP address"; +} + +const char * +dcplugin_long_description(DCPlugin * const dcplugin) +{ + return + "The IP address must be a hex-encoded IPv4 address.\n" + "\n" + "Usage:\n" + "\n" + "# dnscrypt-proxy --plugin \\\n" + " libdcplugin_example_ldns_opendns_set_client_ip.la,192.30.252.130"; +} + +static int +_inet_pton(const int af, const char * const src, void * const dst) +{ + unsigned char *dstc; + unsigned int a, b, c, d; + char more; + + if (af != AF_INET) { + errno = EAFNOSUPPORT; + return -1; + } + if (sscanf(src, "%u.%u.%u.%u%c", &a, &b, &c, &d, &more) != 4) { + return 0; + } + if (a > 0xff || b > 0xff || c > 0xff || d > 0xff) { + return 0; + } + dstc = (unsigned char *) dst; + assert(sizeof(struct in_addr) >= 4U); + dstc[0] = (unsigned char) a; + dstc[1] = (unsigned char) b; + dstc[2] = (unsigned char) c; + dstc[3] = (unsigned char) d; + + return 1; +} + +static int +parse_client_ip(const char *ip_s, char * const edns_hex) +{ + char ip_hex[8U + 1U]; + struct in_addr ip_in_addr; + unsigned char *sa; + const size_t ip_s_len = strlen(ip_s); + + if (ip_s_len <= INET_ADDRSTRLEN && strchr(ip_s, '.') != NULL && + _inet_pton(AF_INET, ip_s, &ip_in_addr) > 0) { + sa = (unsigned char *) &ip_in_addr.s_addr; + snprintf(ip_hex, sizeof ip_hex, "%02X%02X%02X%02X", + sa[0], sa[1], sa[2], sa[3]); + memcpy(edns_hex + EDNS_CLIENT_IP_OFFSET, + ip_hex, sizeof EDNS_CLIENT_IP - 1U); + } else if (ip_s_len == sizeof EDNS_CLIENT_IP - 1U) { + memcpy(edns_hex + EDNS_CLIENT_IP_OFFSET, + ip_s, sizeof EDNS_CLIENT_IP - 1U); + } else { + return -1; + } + return 0; +} + +int +dcplugin_init(DCPlugin * const dcplugin, int argc, char *argv[]) +{ + char *edns_hex; + size_t edns_hex_size = sizeof EDNS_DATA; + + ldns_init_random(NULL, 0U); + edns_hex = malloc(edns_hex_size); + dcplugin_set_user_data(dcplugin, edns_hex); + if (edns_hex == NULL) { + return -1; + } + memcpy(edns_hex, EDNS_DATA, edns_hex_size); + assert(sizeof EDNS_CLIENT_IP - 1U == (size_t) 8U); + if (argc > 1 && argv[1] != NULL) { + parse_client_ip(argv[1], edns_hex); + } + return 0; +} + +int +dcplugin_destroy(DCPlugin *dcplugin) +{ + free(dcplugin_get_user_data(dcplugin)); + + return 0; +} + +static void +fill_with_random_hex_data(char * const str, size_t size) +{ + size_t i = (size_t) 0U; + uint16_t rnd; + + while (i < size) { + rnd = ldns_get_random(); + str[i++] = "0123456789abcdef"[rnd & 0xf]; + str[i++] = "0123456789abcdef"[(rnd >> 8) & 0xf]; + } +} + +DCPluginSyncFilterResult +dcplugin_sync_pre_filter(DCPlugin *dcplugin, DCPluginDNSPacket *dcp_packet) +{ + uint8_t *new_packet; + ldns_rdf *edns_data; + char *edns_data_str; + ldns_pkt *packet; + size_t new_packet_size; + + ldns_wire2pkt(&packet, dcplugin_get_wire_data(dcp_packet), + dcplugin_get_wire_data_len(dcp_packet)); + + edns_data_str = dcplugin_get_user_data(dcplugin); + fill_with_random_hex_data(edns_data_str + EDNS_FODDER_OFFSET, + sizeof EDNS_FODDER - 1U); + edns_data = ldns_rdf_new_frm_str(LDNS_RDF_TYPE_HEX, edns_data_str); + ldns_pkt_set_edns_data(packet, edns_data); + + ldns_pkt2wire(&new_packet, packet, &new_packet_size); + if (dcplugin_get_wire_data_max_len(dcp_packet) >= new_packet_size) { + dcplugin_set_wire_data(dcp_packet, new_packet, new_packet_size); + } + + free(new_packet); + ldns_pkt_free(packet); + + return DCP_SYNC_FILTER_RESULT_OK; +} diff --git a/src/plugins/example-logging/example-logging.c b/src/plugins/example-logging/example-logging.c index b8d96f08..8986d3a5 100644 --- a/src/plugins/example-logging/example-logging.c +++ b/src/plugins/example-logging/example-logging.c @@ -25,7 +25,7 @@ dcplugin_long_description(DCPlugin * const dcplugin) "This plugin logs the client queries to the standard output (default)\n" "or to a file.\n" "\n" - " # dnscrypt-proxy --plugin libdcplugin_example_logging,/tmp/dns.log"; + " # dnscrypt-proxy --plugin libdcplugin_example_logging,/var/log/dns.log"; } int diff --git a/src/proxy/Makefile.am b/src/proxy/Makefile.am index ef6ae800..e9ea5502 100644 --- a/src/proxy/Makefile.am +++ b/src/proxy/Makefile.am @@ -18,6 +18,8 @@ dnscrypt_proxy_SOURCES = \ getpwnam.h \ logger.c \ logger.h \ + minicsv.c \ + minicsv.h \ options.c \ options.h \ pathnames.h \ @@ -27,8 +29,6 @@ dnscrypt_proxy_SOURCES = \ probes_no_dtrace.h \ safe_rw.c \ safe_rw.h \ - salsa20_random.c \ - salsa20_random.h \ sandboxes.c \ sandboxes.h \ stack_trace.c \ @@ -48,26 +48,20 @@ AM_CFLAGS = @CWFLAGS@ AM_CPPFLAGS = \ -I../ext \ - -I../libevent/include \ - -I../@NACL_PATH@/include/local + -I../libevent-modified/include \ + -DPKGDATADIR='"${pkgdatadir}"' dnscrypt_proxy_LDADD = \ - ../libevent/libevent_extra.la \ - ../libevent/libevent_core.la \ - ../@NACL_PATH@/lib/local/libnacl.a + ../libevent-modified/libevent_extra.la \ + ../libevent-modified/libevent_core.la dnscrypt_proxy_DEPENDENCIES = \ - ../libevent/libevent_extra.la \ - ../libevent/libevent_core.la \ - ../libnacl/.done + ../libevent-modified/libevent_extra.la \ + ../libevent-modified/libevent_core.la BUILT_SOURCES = \ - ../libnacl/.done \ probes.h -../libnacl/.done: - cd ../libnacl && $(MAKE) $(AM_MAKEFLAGS) - probes.h: @PROBES_SOURCE@ cat @PROBES_SOURCE@ > $@ @@ -78,6 +72,13 @@ CLEANFILES = \ probes.h \ probes_dnscrypt_proxy.h +if HAVE_SYSTEMD + +dnscrypt_proxy_CFLAGS = $(SYSTEMD_CFLAGS) $(SYSTEMD_DAEMON_CFLAGS) +dnscrypt_proxy_LDADD += $(SYSTEMD_LIBS) $(SYSTEMD_DAEMON_LIBS) + +endif + if PLUGINS AM_CPPFLAGS += \ diff --git a/src/proxy/app.c b/src/proxy/app.c index 8f947537..24d96338 100644 --- a/src/proxy/app.c +++ b/src/proxy/app.c @@ -2,7 +2,9 @@ #include #include +#include #include +#include #include #include #include @@ -14,10 +16,16 @@ #include #include +#include + +#ifdef HAVE_LIBSYSTEMD +# include +# include +#endif + #include "app.h" #include "dnscrypt_client.h" #include "dnscrypt_proxy.h" -#include "salsa20_random.h" #include "logger.h" #include "options.h" #include "sandboxes.h" @@ -86,12 +94,17 @@ proxy_context_init(ProxyContext * const proxy_context, int argc, char *argv[]) { memset(proxy_context, 0, sizeof *proxy_context); proxy_context->event_loop = NULL; + proxy_context->log_file = NULL; + proxy_context->max_log_level = LOG_INFO; proxy_context->tcp_accept_timer = NULL; proxy_context->tcp_conn_listener = NULL; + proxy_context->udp_current_max_size = DNS_MAX_PACKET_SIZE_UDP_NO_EDNS_SEND; + proxy_context->udp_max_size = (size_t) DNS_DEFAULT_EDNS_PAYLOAD_SIZE; proxy_context->udp_listener_event = NULL; proxy_context->udp_proxy_resolver_event = NULL; proxy_context->udp_proxy_resolver_handle = -1; proxy_context->udp_listener_handle = -1; + proxy_context->tcp_listener_handle = -1; if (options_parse(&app_context, proxy_context, argc, argv) != 0) { return -1; } @@ -171,7 +184,7 @@ revoke_privileges(ProxyContext * const proxy_context) init_tz(); (void) strerror(ENOENT); #ifndef DEBUG - salsa20_random_stir(); + randombytes_stir(); # ifndef _WIN32 if (proxy_context->user_dir != NULL) { if (chdir(proxy_context->user_dir) != 0 || @@ -219,11 +232,12 @@ dnscrypt_proxy_start_listeners(ProxyContext * const proxy_context) evutil_format_sockaddr_port((const struct sockaddr *) &proxy_context->resolver_sockaddr, resolver_addr_s, sizeof resolver_addr_s); - logger(proxy_context, LOG_INFO, "Proxying from %s to %s", + logger(proxy_context, LOG_NOTICE, "Proxying from %s to %s", local_addr_s, resolver_addr_s); - proxy_context->listeners_started = 1; - +#ifdef HAVE_LIBSYSTEMD + sd_notify(0, "READY=1"); +#endif return 0; } @@ -239,6 +253,55 @@ dnscrypt_proxy_loop_break(void) return 0; } +#ifdef HAVE_LIBSYSTEMD +static int +init_descriptors_from_systemd(ProxyContext * const proxy_context) +{ + int num_sd_fds; + int sock; + + num_sd_fds = sd_listen_fds(0); + if (num_sd_fds == 0) { + return 0; + } + if (num_sd_fds != 2) { + logger(proxy_context, LOG_ERR, "Wrong number of systemd sockets: %d - " + "should be 2", num_sd_fds); + return -1; + } + assert(num_sd_fds <= INT_MAX - SD_LISTEN_FDS_START); + for (sock = SD_LISTEN_FDS_START; sock < SD_LISTEN_FDS_START + num_sd_fds; + ++sock) { + if (sd_is_socket(sock, AF_INET, SOCK_DGRAM, 0) > 0 || + sd_is_socket(sock, AF_INET6, SOCK_DGRAM, 0) > 0) { + proxy_context->udp_listener_handle = sock; + } + if (sd_is_socket(sock, AF_INET, SOCK_STREAM, 1) > 0 || + sd_is_socket(sock, AF_INET6, SOCK_STREAM, 1) > 0) { + proxy_context->tcp_listener_handle = sock; + } + } + if (proxy_context->udp_listener_handle < 0) { + logger_noformat(proxy_context, LOG_ERR, + "No systemd UDP socket passed in"); + return -1; + } + if (proxy_context->tcp_listener_handle < 0) { + logger_noformat(proxy_context, LOG_ERR, + "No systemd TCP socket passed in"); + return -1; + } + if (getsockname(proxy_context->udp_listener_handle, + (struct sockaddr *) &proxy_context->local_sockaddr, + &proxy_context->local_sockaddr_len) != 0) { + logger_noformat(proxy_context, LOG_ERR, + "Unable to get the local systemd UDP socket address"); + return -1; + } + return 0; +} +#endif + int dnscrypt_proxy_main(int argc, char *argv[]) { @@ -256,6 +319,20 @@ dnscrypt_proxy_main(int argc, char *argv[]) logger_noformat(NULL, LOG_ERR, "Unable to start the proxy"); exit(1); } + logger_noformat(&proxy_context, LOG_NOTICE, "Starting " PACKAGE_STRING); +#ifdef USE_ONLY_PORTABLE_IMPLEMENTATIONS + randombytes_stir(); +#else + logger_noformat(&proxy_context, LOG_INFO, + "Initializing libsodium for optimal performance"); + if (sodium_init() != 0) { + exit(1); + } +#endif +#ifdef HAVE_SODIUM_MLOCK + sodium_mlock(&proxy_context, sizeof proxy_context); +#endif + randombytes_set_implementation(&randombytes_salsa20_implementation); #ifdef PLUGINS if (plugin_support_context_load(app_context.dcps_context) != 0) { logger_noformat(NULL, LOG_ERR, "Unable to load plugins"); @@ -267,9 +344,17 @@ dnscrypt_proxy_main(int argc, char *argv[]) dnscrypt_client_init_with_new_key_pair(&proxy_context.dnscrypt_client); logger_noformat(&proxy_context, LOG_INFO, "Done"); - if (cert_updater_init(&proxy_context) != 0 || - udp_listener_bind(&proxy_context) != 0 || - tcp_listener_bind(&proxy_context) != 0) { + if (cert_updater_init(&proxy_context) != 0) { + exit(1); + } +#ifdef HAVE_LIBSYSTEMD + if (init_descriptors_from_systemd(&proxy_context) != 0) { + exit(1); + } +#endif + if (proxy_context.test_only == 0 && + (udp_listener_bind(&proxy_context) != 0 || + tcp_listener_bind(&proxy_context) != 0)) { exit(1); } #ifdef SIGPIPE @@ -280,10 +365,18 @@ dnscrypt_proxy_main(int argc, char *argv[]) if (cert_updater_start(&proxy_context) != 0) { exit(1); } + +#ifdef HAVE_LIBSYSTEMD + sd_notifyf(0, "MAINPID=%lu", (unsigned long) getpid()); +#endif if (skip_dispatch == 0) { event_base_dispatch(proxy_context.event_loop); } - logger_noformat(&proxy_context, LOG_INFO, "Stopping proxy"); + logger_noformat(&proxy_context, LOG_NOTICE, "Stopping proxy"); +#ifdef HAVE_LIBSYSTEMD + sd_notify(0, "STOPPING=1"); +#endif + cert_updater_free(&proxy_context); udp_listener_stop(&proxy_context); tcp_listener_stop(&proxy_context); @@ -292,8 +385,11 @@ dnscrypt_proxy_main(int argc, char *argv[]) plugin_support_context_free(app_context.dcps_context); #endif proxy_context_free(&proxy_context); +#ifdef HAVE_SODIUM_MLOCK + sodium_munlock(&proxy_context, sizeof proxy_context); +#endif app_context.proxy_context = NULL; - salsa20_random_close(); + randombytes_close(); return 0; } diff --git a/src/proxy/cert.c b/src/proxy/cert.c index 672e5054..34cce48b 100644 --- a/src/proxy/cert.c +++ b/src/proxy/cert.c @@ -18,13 +18,13 @@ #include #include +#include + #include "cert.h" #include "cert_p.h" -#include "crypto_sign_ed25519.h" #include "dnscrypt_proxy.h" #include "logger.h" #include "probes.h" -#include "salsa20_random.h" #include "utils.h" static int cert_updater_update(ProxyContext * const proxy_context); @@ -70,7 +70,7 @@ cert_parse_bincert(ProxyContext * const proxy_context, memcpy(&ts_end, bincert->ts_end, sizeof ts_end); ts_end = htonl(ts_end); - uint32_t now_u32 = (uint32_t) time(NULL); + const uint32_t now_u32 = (uint32_t) time(NULL); if (now_u32 < ts_begin) { logger_noformat(proxy_context, LOG_INFO, @@ -153,6 +153,51 @@ cert_open_bincert(ProxyContext * const proxy_context, return 0; } +static void +cert_print_bincert_info(ProxyContext * const proxy_context, + const Bincert * const bincert) +{ + (void) proxy_context; + (void) bincert; + +#ifdef HAVE_GMTIME_R + struct tm ts_begin_tm; + struct tm ts_end_tm; + time_t ts_begin_t; + time_t ts_end_t; + uint32_t serial; + uint32_t ts_begin; + uint32_t ts_end; + _Bool gm_ret; + + assert(bincert != NULL); + + memcpy(&ts_begin, bincert->ts_begin, sizeof ts_begin); + ts_begin_t = (time_t) htonl(ts_begin); + assert(ts_begin_t > (time_t) 0); + + memcpy(&ts_end, bincert->ts_end, sizeof ts_end); + ts_end_t = (time_t) htonl(ts_end); + assert(ts_end_t > (time_t) 0); + + gm_ret = (gmtime_r(&ts_begin_t, &ts_begin_tm) != NULL && + gmtime_r(&ts_end_t, &ts_end_tm) != NULL); + assert(gm_ret != 0); + assert(ts_end_t >= ts_begin_t); + + memcpy(&serial, bincert->serial, sizeof serial); + + logger(proxy_context, LOG_INFO, + "Chosen certificate #%" PRIu32 " is valid " + "from [%d-%02d-%02d] to [%d-%02d-%02d]", + htonl(serial), + ts_begin_tm.tm_year + 1900, + ts_begin_tm.tm_mon + 1, ts_begin_tm.tm_mday + 1, + ts_end_tm.tm_year + 1900, + ts_end_tm.tm_mon + 1, ts_end_tm.tm_mday + 1); +#endif +} + static void cert_print_server_key(ProxyContext * const proxy_context) { @@ -209,6 +254,10 @@ cert_reschedule_query_after_failure(ProxyContext * const proxy_context) } cert_reschedule_query(proxy_context, query_retry_delay); DNSCRYPT_PROXY_CERTS_UPDATE_RETRY(); + if (proxy_context->test_only != 0 && + cert_updater->query_retry_step > CERT_QUERY_TEST_RETRY_STEPS) { + exit(DNSCRYPT_EXIT_CERT_TIMEOUT); + } } static void @@ -219,7 +268,7 @@ cert_reschedule_query_after_success(ProxyContext * const proxy_context) } cert_reschedule_query(proxy_context, (time_t) CERT_QUERY_RETRY_DELAY_AFTER_SUCCESS_MIN_DELAY - + (time_t) salsa20_random_uniform + + (time_t) randombytes_uniform (CERT_QUERY_RETRY_DELAY_AFTER_SUCCESS_JITTER)); } @@ -256,8 +305,26 @@ cert_query_cb(int result, char type, int count, int ttl, "No useable certificates found"); cert_reschedule_query_after_failure(proxy_context); DNSCRYPT_PROXY_CERTS_UPDATE_ERROR_NOCERTS(); + if (proxy_context->test_only) { + exit(DNSCRYPT_EXIT_CERT_NOCERTS); + } return; } + if (proxy_context->test_only != 0) { + const uint32_t now_u32 = (uint32_t) time(NULL); + uint32_t ts_end; + + memcpy(&ts_end, bincert->ts_end, sizeof ts_end); + ts_end = htonl(ts_end); + + if (ts_end < (uint32_t) proxy_context->test_cert_margin || + now_u32 > ts_end - (uint32_t) proxy_context->test_cert_margin) { + logger_noformat(proxy_context, LOG_WARNING, + "The certificate is not valid for the given safety margin"); + DNSCRYPT_PROXY_CERTS_UPDATE_ERROR_NOCERTS(); + exit(DNSCRYPT_EXIT_CERT_MARGIN); + } + } COMPILER_ASSERT(sizeof proxy_context->resolver_publickey == sizeof bincert->server_publickey); memcpy(proxy_context->resolver_publickey, bincert->server_publickey, @@ -266,11 +333,17 @@ cert_query_cb(int result, char type, int count, int ttl, sizeof bincert->magic_query); memcpy(proxy_context->dnscrypt_magic_query, bincert->magic_query, sizeof proxy_context->dnscrypt_magic_query); + cert_print_bincert_info(proxy_context, bincert); cert_print_server_key(proxy_context); dnscrypt_client_init_magic_query(&proxy_context->dnscrypt_client, bincert->magic_query); memset(bincert, 0, sizeof *bincert); free(bincert); + if (proxy_context->test_only) { + DNSCRYPT_PROXY_CERTS_UPDATE_DONE((unsigned char *) + proxy_context->resolver_publickey); + exit(0); + } dnscrypt_client_init_nmkey(&proxy_context->dnscrypt_client, proxy_context->resolver_publickey); dnscrypt_proxy_start_listeners(proxy_context); @@ -337,7 +410,7 @@ int cert_updater_start(ProxyContext * const proxy_context) { evdns_set_random_init_fn(NULL); - evdns_set_random_bytes_fn(salsa20_random_buf); + evdns_set_random_bytes_fn(randombytes_buf); cert_updater_update(proxy_context); return 0; diff --git a/src/proxy/cert.h b/src/proxy/cert.h index 1434f2f0..eb8617a7 100644 --- a/src/proxy/cert.h +++ b/src/proxy/cert.h @@ -11,6 +11,10 @@ #define CERT_QUERY_RETRY_DELAY_AFTER_SUCCESS_MIN_DELAY (60 * 60) #define CERT_QUERY_RETRY_DELAY_AFTER_SUCCESS_JITTER 100 +#ifndef CERT_QUERY_TEST_RETRY_STEPS +# define CERT_QUERY_TEST_RETRY_STEPS 10 +#endif + typedef struct CertUpdater_ { struct evdns_base *evdns_base; struct event *cert_timer; diff --git a/src/proxy/cert_p.h b/src/proxy/cert_p.h index 095e8aac..5ef000ed 100644 --- a/src/proxy/cert_p.h +++ b/src/proxy/cert_p.h @@ -6,7 +6,7 @@ #include -#include "crypto_box.h" +#include #define CERT_MAGIC_CERT "DNSC" diff --git a/src/proxy/dnscrypt.c b/src/proxy/dnscrypt.c index 1055ed95..68030132 100644 --- a/src/proxy/dnscrypt.c +++ b/src/proxy/dnscrypt.c @@ -12,10 +12,9 @@ #include #include +#include #include "dnscrypt.h" -#include "salsa20_random.h" -#include "randombytes.h" #include "utils.h" size_t @@ -33,23 +32,6 @@ dnscrypt_query_header_size(void) + crypto_box_MACBYTES; } -static int -dnscrypt_memcmp(const void * const b1_, const void * const b2_, - const size_t size) -{ - const uint8_t *b1 = b1_; - const uint8_t *b2 = b2_; - size_t i = (size_t) 0U; - uint8_t d = (uint8_t) 0U; - - assert(size > (size_t) 0U); - do { - d |= b1[i] ^ b2[i]; - } while (++i < size); - - return (int) d; -} - int dnscrypt_cmp_client_nonce(const uint8_t client_nonce[crypto_box_HALF_NONCEBYTES], const uint8_t * const buf, const size_t len) @@ -57,8 +39,8 @@ dnscrypt_cmp_client_nonce(const uint8_t client_nonce[crypto_box_HALF_NONCEBYTES] const size_t client_nonce_offset = sizeof DNSCRYPT_MAGIC_RESPONSE - 1U; if (len < client_nonce_offset + crypto_box_HALF_NONCEBYTES || - dnscrypt_memcmp(client_nonce, buf + client_nonce_offset, - crypto_box_HALF_NONCEBYTES) != 0) { + sodium_memcmp(client_nonce, buf + client_nonce_offset, + crypto_box_HALF_NONCEBYTES) != 0) { return -1; } return 0; @@ -73,12 +55,16 @@ dnscrypt_pad(uint8_t *buf, const size_t len, const size_t max_len) if (max_len < len + DNSCRYPT_MIN_PAD_LEN) { return len; } - padded_len = len + DNSCRYPT_MIN_PAD_LEN + salsa20_random_uniform +#ifdef RANDOM_LENGTH_PADDING + padded_len = len + DNSCRYPT_MIN_PAD_LEN + randombytes_uniform ((uint32_t) (max_len - len - DNSCRYPT_MIN_PAD_LEN + 1U)); padded_len += DNSCRYPT_BLOCK_SIZE - padded_len % DNSCRYPT_BLOCK_SIZE; if (padded_len > max_len) { padded_len = max_len; } +#else + padded_len = max_len; +#endif assert(padded_len >= len); padding_len = padded_len - len; memset(buf_padding_area, 0, padding_len); @@ -88,13 +74,6 @@ dnscrypt_pad(uint8_t *buf, const size_t len, const size_t max_len) return padded_len; } -void -randombytes(unsigned char * const buf, const unsigned long long buf_len) -{ - assert(buf_len <= SIZE_MAX); - salsa20_random_buf(buf, buf_len); -} - void dnscrypt_key_to_fingerprint(char fingerprint[80U], const uint8_t * const key) { @@ -118,68 +97,18 @@ dnscrypt_key_to_fingerprint(char fingerprint[80U], const uint8_t * const key) } } -static int -_dnscrypt_parse_char(uint8_t key[crypto_box_PUBLICKEYBYTES], - size_t * const key_pos_p, int * const state_p, - const int c, uint8_t * const val_p) -{ - uint8_t c_val; - - switch (*state_p) { - case 0: - case 1: - if (isspace(c) || (c == ':' && *state_p == 0)) { - break; - } - if (c == '#') { - *state_p = 2; - break; - } - if (!isxdigit(c)) { - return -1; - } - c_val = (uint8_t) ((c >= '0' && c <= '9') ? c - '0' : c - 'a' + 10); - assert(c_val < 16U); - if (*state_p == 0) { - *val_p = c_val * 16U; - *state_p = 1; - } else { - *val_p |= c_val; - key[(*key_pos_p)++] = *val_p; - if (*key_pos_p >= crypto_box_PUBLICKEYBYTES) { - return 0; - } - *state_p = 0; - } - break; - case 2: - if (c == '\n') { - *state_p = 0; - } - } - return 1; -} - int dnscrypt_fingerprint_to_key(const char * const fingerprint, uint8_t key[crypto_box_PUBLICKEYBYTES]) { - const char *p = fingerprint; - size_t key_pos = (size_t) 0U; - int c; - int ret; - int state = 0; - uint8_t val = 0U; - - if (fingerprint == NULL) { - return -1; - } - while ((c = tolower((int) (unsigned char) *p)) != 0) { - ret = _dnscrypt_parse_char(key, &key_pos, &state, c, &val); - if (ret <= 0) { - return ret; - } - p++; + size_t key_len; + + if (fingerprint != NULL && + sodium_hex2bin(key, crypto_box_PUBLICKEYBYTES, + fingerprint, strlen(fingerprint), + ": \t\r\n", &key_len, NULL) == 0 && + key_len == crypto_box_PUBLICKEYBYTES) { + return 0; } return -1; } diff --git a/src/proxy/dnscrypt.h b/src/proxy/dnscrypt.h index 42f80d12..bedf4660 100644 --- a/src/proxy/dnscrypt.h +++ b/src/proxy/dnscrypt.h @@ -5,7 +5,7 @@ #include #include -#include "crypto_box.h" +#include #define DNSCRYPT_MAGIC_QUERY_LEN 8U #define DNSCRYPT_MAGIC_RESPONSE "r6fnvWj8" @@ -19,7 +19,6 @@ #ifndef DNSCRYPT_MIN_PAD_LEN # define DNSCRYPT_MIN_PAD_LEN 8U #endif -#define crypto_box_MACBYTES (crypto_box_ZEROBYTES - crypto_box_BOXZEROBYTES) #define crypto_box_HALF_NONCEBYTES (crypto_box_NONCEBYTES / 2U) size_t dnscrypt_response_header_size(void); diff --git a/src/proxy/dnscrypt_client.c b/src/proxy/dnscrypt_client.c index 91dc0135..9f5841e5 100644 --- a/src/proxy/dnscrypt_client.c +++ b/src/proxy/dnscrypt_client.c @@ -15,10 +15,10 @@ #include #include +#include #include "dnscrypt.h" #include "dnscrypt_client.h" -#include "salsa20_random.h" #include "utils.h" static void @@ -35,14 +35,14 @@ dnscrypt_make_client_nonce(DNSCryptClient * const client, } client->nonce_ts_last = ts; - tsn = (ts << 10) | (salsa20_random() & 0x3ff); + tsn = (ts << 10) | (randombytes_random() & 0x3ff); #ifdef WORDS_BIGENDIAN tsn = (((uint64_t) htonl((uint32_t) tsn)) << 32) | htonl((uint32_t) (tsn >> 32)); #endif COMPILER_ASSERT(crypto_box_HALF_NONCEBYTES == 12U); memcpy(client_nonce, &tsn, 8U); - suffix = salsa20_random(); + suffix = randombytes_random(); memcpy(client_nonce + 8U, &suffix, 4U); } @@ -125,9 +125,9 @@ dnscrypt_client_uncurve(const DNSCryptClient * const client, nonce, client->nmkey)) { return -1; } - dnscrypt_memzero(nonce, sizeof nonce); + sodium_memzero(nonce, sizeof nonce); assert(len >= DNSCRYPT_SERVER_BOX_OFFSET + crypto_box_BOXZEROBYTES); - while (buf[--len] == 0U) { } + while (len > 0U && buf[--len] == 0U) { } if (buf[len] != 0x80) { return -1; } @@ -153,6 +153,9 @@ dnscrypt_client_init_nmkey(DNSCryptClient * const client, { #if crypto_box_BEFORENMBYTES != crypto_box_PUBLICKEYBYTES # error crypto_box_BEFORENMBYTES != crypto_box_PUBLICKEYBYTES +#endif +#ifdef HAVE_SODIUM_MLOCK + sodium_mlock(client->nmkey, crypto_box_BEFORENMBYTES); #endif memcpy(client->nmkey, server_publickey, crypto_box_PUBLICKEYBYTES); crypto_box_beforenm(client->nmkey, client->nmkey, client->secretkey); @@ -160,14 +163,6 @@ dnscrypt_client_init_nmkey(DNSCryptClient * const client, return 0; } -int -dnscrypt_client_wipe_secretkey(DNSCryptClient * const client) -{ - salsa20_random_buf(client->secretkey, crypto_box_SECRETKEYBYTES); - - return 0; -} - int dnscrypt_client_init_with_key_pair(DNSCryptClient * const client, const uint8_t client_publickey[crypto_box_PUBLICKEYBYTES], @@ -186,7 +181,7 @@ dnscrypt_client_create_key_pair(DNSCryptClient * const client, { (void) client; crypto_box_keypair(client_publickey, client_secretkey); - salsa20_random_stir(); + randombytes_stir(); return 0; } @@ -197,10 +192,17 @@ dnscrypt_client_init_with_new_key_pair(DNSCryptClient * const client) uint8_t client_publickey[crypto_box_PUBLICKEYBYTES]; uint8_t client_secretkey[crypto_box_SECRETKEYBYTES]; +#ifdef HAVE_SODIUM_MLOCK + sodium_mlock(client_secretkey, crypto_box_SECRETKEYBYTES); +#endif dnscrypt_client_create_key_pair(client, client_publickey, client_secretkey); dnscrypt_client_init_with_key_pair(client, client_publickey, client_secretkey); + sodium_memzero(client_secretkey, crypto_box_SECRETKEYBYTES); +#ifdef HAVE_SODIUM_MLOCK + sodium_munlock(client_secretkey, crypto_box_SECRETKEYBYTES); +#endif return 0; } diff --git a/src/proxy/dnscrypt_proxy.h b/src/proxy/dnscrypt_proxy.h index 2d6084e1..21006d35 100644 --- a/src/proxy/dnscrypt_proxy.h +++ b/src/proxy/dnscrypt_proxy.h @@ -5,14 +5,14 @@ #include #include +#include #include #include +#include #include "app.h" #include "cert.h" -#include "crypto_box.h" -#include "crypto_sign_ed25519.h" #include "dnscrypt_client.h" #include "queue.h" @@ -21,12 +21,12 @@ #endif #define DNS_MAX_PACKET_SIZE_UDP_RECV (65536U - 20U - 8U) -#define DNS_MAX_PACKET_SIZE_UDP_SEND 512U +#define DNS_MAX_PACKET_SIZE_UDP_NO_EDNS_SEND 512U -#if DNS_MAX_PACKET_SIZE_UDP_RECV > DNS_MAX_PACKET_SIZE_UDP_SEND +#if DNS_MAX_PACKET_SIZE_UDP_RECV > DNS_MAX_PACKET_SIZE_UDP_NO_EDNS_SEND # define DNS_MAX_PACKET_SIZE_UDP DNS_MAX_PACKET_SIZE_UDP_RECV #else -# define DNS_MAX_PACKET_SIZE_UDP DNS_MAX_PACKET_SIZE_UDP_SEND +# define DNS_MAX_PACKET_SIZE_UDP DNS_MAX_PACKET_SIZE_UDP_NO_EDNS_SEND #endif #ifndef DNS_DEFAULT_STANDARD_DNS_PORT @@ -39,6 +39,18 @@ # define DNS_DEFAULT_RESOLVER_PORT "443" #endif +#ifndef DEFAULT_RESOLVERS_LIST +# ifdef _WIN32 +# define DEFAULT_RESOLVERS_LIST "dnscrypt-resolvers.csv" +# else +# define DEFAULT_RESOLVERS_LIST PKGDATADIR "/dnscrypt-resolvers.csv" +# endif +#endif + +#ifndef DEFAULT_RESOLVER_NAME +# define DEFAULT_RESOLVER_NAME NULL +#endif + #define DNS_HEADER_SIZE 12U #define DNS_FLAGS_TC 2U #define DNS_FLAGS_QR 128U @@ -61,6 +73,12 @@ #define DNS_DEFAULT_EDNS_PAYLOAD_SIZE 1252U +#define DNSCRYPT_PROTOCOL_VERSIONS "2" + +#define DNSCRYPT_EXIT_CERT_NOCERTS 2 +#define DNSCRYPT_EXIT_CERT_TIMEOUT 3 +#define DNSCRYPT_EXIT_CERT_MARGIN 4 + typedef TAILQ_HEAD(TCPRequestQueue_, TCPRequest_) TCPRequestQueue; typedef TAILQ_HEAD(UDPRequestQueue_, UDPRequest_) UDPRequestQueue; @@ -81,6 +99,8 @@ typedef struct ProxyContext_ { const char *pid_file; const char *provider_name; const char *provider_publickey_s; + const char *resolvers_list; + const char *resolver_name; const char *resolver_ip; struct evconnlistener *tcp_conn_listener; struct event *tcp_accept_timer; @@ -90,18 +110,24 @@ typedef struct ProxyContext_ { ev_socklen_t local_sockaddr_len; ev_socklen_t resolver_sockaddr_len; size_t edns_payload_size; + size_t udp_current_max_size; + size_t udp_max_size; + evutil_socket_t tcp_listener_handle; evutil_socket_t udp_listener_handle; evutil_socket_t udp_proxy_resolver_handle; #ifndef _WIN32 uid_t user_id; gid_t user_group; #endif + time_t test_cert_margin; unsigned int connections_count; unsigned int connections_count_max; int log_fd; + int max_log_level; _Bool daemonize; _Bool listeners_started; _Bool tcp_only; + _Bool test_only; } ProxyContext; int dnscrypt_proxy_start_listeners(ProxyContext * const proxy_context); diff --git a/src/proxy/edns.c b/src/proxy/edns.c index 6f111ac3..27f87521 100644 --- a/src/proxy/edns.c +++ b/src/proxy/edns.c @@ -83,8 +83,8 @@ edns_get_payload_size(const uint8_t * const dns_packet, } payload_size = (dns_packet[offset + DNS_OFFSET_EDNS_PAYLOAD_SIZE] << 8) | dns_packet[offset + DNS_OFFSET_EDNS_PAYLOAD_SIZE + 1U]; - if (payload_size < DNS_MAX_PACKET_SIZE_UDP_SEND) { - payload_size = DNS_MAX_PACKET_SIZE_UDP_SEND; + if (payload_size < DNS_MAX_PACKET_SIZE_UDP_NO_EDNS_SEND) { + payload_size = DNS_MAX_PACKET_SIZE_UDP_NO_EDNS_SEND; } return (ssize_t) payload_size; } @@ -99,7 +99,7 @@ edns_add_section(ProxyContext * const proxy_context, assert(edns_payload_size <= (size_t) 0xFFFF); assert(DNS_OFFSET_ARCOUNT + 2U <= DNS_HEADER_SIZE); - if (edns_payload_size <= DNS_MAX_PACKET_SIZE_UDP_SEND || + if (edns_payload_size <= DNS_MAX_PACKET_SIZE_UDP_NO_EDNS_SEND || *dns_packet_len_p <= DNS_HEADER_SIZE) { *request_edns_payload_size = (size_t) 0U; return -1; diff --git a/src/proxy/logger.c b/src/proxy/logger.c index a9fb5cfc..cfb65b0c 100644 --- a/src/proxy/logger.c +++ b/src/proxy/logger.c @@ -43,11 +43,17 @@ logger(struct ProxyContext_ * const context, size_t len; int log_fd; + if (context != NULL) { + if (crit > context->max_log_level) { + return 0; + } + } else { #ifndef DEBUG - if (crit == LOG_DEBUG) { - return 0; - } + if (crit > LOG_INFO) { + return 0; + } #endif + } switch (crit) { case LOG_INFO: urgency = "[INFO] "; diff --git a/src/proxy/logger.h b/src/proxy/logger.h index efe61a25..103ddac7 100644 --- a/src/proxy/logger.h +++ b/src/proxy/logger.h @@ -27,11 +27,14 @@ #endif #ifdef _WIN32 -# define LOG_INFO 1 -# define LOG_WARNING 2 +# define LOG_EMERG 0 +# define LOG_ALERT 1 +# define LOG_CRIT 2 # define LOG_ERR 3 -# define LOG_NOTICE 4 -# define LOG_DEBUG 5 +# define LOG_WARNING 4 +# define LOG_NOTICE 5 +# define LOG_INFO 6 +# define LOG_DEBUG 7 #endif struct ProxyContext_; @@ -40,7 +43,7 @@ int logger_open_syslog(struct ProxyContext_ * const context); int logger(struct ProxyContext_ * const context, const int crit, const char * const format, ...) -__attribute__ ((format(printf, 3, 4))); + __attribute__ ((format(printf, 3, 4))); int logger_noformat(struct ProxyContext_ * const context, const int crit, const char * const msg); diff --git a/src/proxy/minicsv.c b/src/proxy/minicsv.c new file mode 100644 index 00000000..e2590a5b --- /dev/null +++ b/src/proxy/minicsv.c @@ -0,0 +1,106 @@ + +#include +#include +#include + +#include "minicsv.h" + +static inline void +_minicsv_out_col(char * const col_start, char ** const cols, + size_t * const cols_count_p, const size_t cols_max) +{ + if (*cols_count_p < cols_max) { + cols[*cols_count_p] = col_start; + } + (*cols_count_p)++; +} + +static inline void +_minicsv_parse_line_noquote(const int c, char ** const pos_p, + char ** const col_start_p, int * const state_p, + char ** const cols, size_t * const cols_count_p, + const size_t cols_max) +{ + switch (c) { + case '\n': + *state_p = 2; + case MINICSV_DELIM: + *(*pos_p)++ = 0; + _minicsv_out_col(*col_start_p, cols, cols_count_p, cols_max); + *col_start_p = *pos_p; + break; + case MINICSV_QUOTE: + *state_p = 1; + *col_start_p = ++*pos_p; + break; + case '\r': + **pos_p = 0; + default: + (*pos_p)++; + } +} + +static inline void +_minicsv_parse_line_quote(const int c, char ** const pos_p, + int * const state_p) +{ + if (c == MINICSV_QUOTE) { + if (*(*pos_p + 1U) == MINICSV_QUOTE) { + memmove(*pos_p, *pos_p + 1U, strlen(*pos_p)); + } else { + **pos_p = 0; + *state_p = 0; + } + } + (*pos_p)++; +} + +char * +minicsv_parse_line(char * const buf, char ** const cols, + size_t * const cols_count_p, const size_t cols_max) +{ + char *col_start = buf; + char *pos = buf; + int c; + int state = 0; + + *cols_count_p = (size_t) 0U; + while ((c = *pos) != 0) { + switch (state) { + case 0: + _minicsv_parse_line_noquote(c, &pos, &col_start, &state, + cols, cols_count_p, cols_max); + break; + case 1: + _minicsv_parse_line_quote(c, &pos, &state); + break; + case 2: + return pos; + } + } + if (state == 0) { + _minicsv_out_col(col_start, cols, cols_count_p, cols_max); + } + return pos; +} + +void +minicsv_trim_cols(char ** const cols, const size_t cols_count) +{ + char *col; + size_t col_end; + size_t i = (size_t) 0U; + + while (i < cols_count) { + col = cols[i]; + while (*col != 0 && isspace((int) (unsigned char) *col)) { + cols[i] = ++col; + } + col_end = strlen(col); + while (col_end > (size_t) 0U && + isspace((int) (unsigned char) col[--col_end])) { + col[col_end] = 0; + } + i++; + } +} diff --git a/src/proxy/minicsv.h b/src/proxy/minicsv.h new file mode 100644 index 00000000..e836c6a6 --- /dev/null +++ b/src/proxy/minicsv.h @@ -0,0 +1,32 @@ + +/* + * Copyright (c) 2015 + * Frank Denis + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * 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. + */ + +#ifndef __MINICSV_H__ +#define __MINICSV_H__ + +#include + +#define MINICSV_DELIM ',' +#define MINICSV_QUOTE '"' + +char * minicsv_parse_line(char * const buf, char ** const cols, + size_t * const cols_count_p, const size_t cols_max); + +void minicsv_trim_cols(char ** const cols, const size_t cols_count); + +#endif diff --git a/src/proxy/options.c b/src/proxy/options.c index 6439b5c2..1e83006a 100644 --- a/src/proxy/options.c +++ b/src/proxy/options.c @@ -12,14 +12,18 @@ #include #include #include +#include #include #include #include +#include + #include "dnscrypt_proxy.h" #include "getpwnam.h" #include "options.h" #include "logger.h" +#include "minicsv.h" #include "pid_file.h" #include "utils.h" #include "windows_service.h" @@ -34,18 +38,22 @@ static struct option getopt_long_options[] = { #endif { "edns-payload-size", 1, NULL, 'e' }, { "help", 0, NULL, 'h' }, - { "provider-key", 1, NULL, 'k' }, + { "resolvers-list", 1, NULL, 'L' }, + { "resolver-name", 1, NULL, 'R' }, #ifndef _WIN32 { "logfile", 1, NULL, 'l' }, #endif + { "loglevel", 1, NULL, 'm' }, { "max-active-requests", 1, NULL, 'n' }, #ifndef _WIN32 { "pidfile", 1, NULL, 'p' }, #endif { "plugin", 1, NULL, 'X' }, + { "provider-name", 1, NULL, 'N' }, + { "provider-key", 1, NULL, 'k' }, { "resolver-address", 1, NULL, 'r' }, { "user", 1, NULL, 'u' }, - { "provider-name", 1, NULL, 'N' }, + { "test", 1, NULL, 't' }, { "tcp-only", 0, NULL, 'T' }, { "version", 0, NULL, 'V' }, #ifdef _WIN32 @@ -56,27 +64,15 @@ static struct option getopt_long_options[] = { { NULL, 0, NULL, 0 } }; #ifndef _WIN32 -static const char *getopt_options = "a:de:hk:l:n:p:r:u:N:TVX"; +static const char *getopt_options = "a:de:hk:L:l:m:n:p:r:R:t:u:N:TVX"; #else -static const char *getopt_options = "a:e:hk:n:r:u:N:TVX"; +static const char *getopt_options = "a:e:hk:L:m:n:r:R:t:u:N:TVX"; #endif #ifndef DEFAULT_CONNECTIONS_COUNT_MAX # define DEFAULT_CONNECTIONS_COUNT_MAX 250U #endif -#ifndef DEFAULT_PROVIDER_PUBLICKEY -# define DEFAULT_PROVIDER_PUBLICKEY \ - "B735:1140:206F:225D:3E2B:D822:D7FD:691E:" \ - "A1C3:3CC8:D666:8D0C:BE04:BFAB:CA43:FB79" -#endif -#ifndef DEFAULT_PROVIDER_NAME -# define DEFAULT_PROVIDER_NAME "2.dnscrypt-cert.opendns.com." -#endif -#ifndef DEFAULT_RESOLVER_IP -# define DEFAULT_RESOLVER_IP "208.67.220.220:443" -#endif - static void options_version(void) { @@ -116,23 +112,240 @@ void options_init_with_default(AppContext * const app_context, proxy_context->log_fd = -1; proxy_context->log_file = NULL; proxy_context->pid_file = NULL; - proxy_context->provider_name = DEFAULT_PROVIDER_NAME; - proxy_context->provider_publickey_s = DEFAULT_PROVIDER_PUBLICKEY; - proxy_context->resolver_ip = DEFAULT_RESOLVER_IP; + proxy_context->resolvers_list = DEFAULT_RESOLVERS_LIST; + proxy_context->resolver_name = DEFAULT_RESOLVER_NAME; + proxy_context->provider_name = NULL; + proxy_context->provider_publickey_s = NULL; + proxy_context->resolver_ip = NULL; #ifndef _WIN32 proxy_context->user_id = (uid_t) 0; proxy_context->user_group = (uid_t) 0; #endif proxy_context->user_dir = NULL; proxy_context->daemonize = 0; + proxy_context->test_cert_margin = (time_t) -1; + proxy_context->test_only = 0; proxy_context->tcp_only = 0; } +static int +options_check_protocol_versions(const char * const provider_name) +{ + const size_t dnscrypt_protocol_versions_len = + sizeof DNSCRYPT_PROTOCOL_VERSIONS - (size_t) 1U; + + if (strncmp(provider_name, DNSCRYPT_PROTOCOL_VERSIONS, + dnscrypt_protocol_versions_len) != 0 || + provider_name[dnscrypt_protocol_versions_len] != '.') { + return -1; + } + return 0; +} + +static char * +options_read_file(const char * const file_name) +{ + FILE *fp; + char *file_buf; + size_t file_size = (size_t) 0U; + + assert(file_name != NULL); + if ((fp = fopen(file_name, "rb")) == NULL) { + return NULL; + } + while (fgetc(fp) != EOF && file_size < SIZE_MAX) { + file_size++; + } + if (feof(fp) == 0 || file_size <= (size_t) 0U) { + fclose(fp); + return NULL; + } + rewind(fp); + if ((file_buf = malloc(file_size)) == NULL) { + fclose(fp); + return NULL; + } + if (fread(file_buf, file_size, (size_t) 1U, fp) != 1U) { + fclose(fp); + free(file_buf); + return NULL; + } + (void) fclose(fp); + + return file_buf; +} + +static const char * +options_get_col(char * const * const headers, const size_t headers_count, + char * const * const cols, const size_t cols_count, + const char * const header) +{ + size_t i = (size_t) 0U; + + while (i < headers_count) { + if (strcmp(header, headers[i]) == 0) { + if (i < cols_count) { + return cols[i]; + } + break; + } + i++; + } + return NULL; +} + +static int +options_parse_resolver(ProxyContext * const proxy_context, + char * const * const headers, const size_t headers_count, + char * const * const cols, const size_t cols_count) +{ + const char *provider_name; + const char *provider_publickey_s; + const char *resolver_ip; + const char *resolver_name; + + resolver_name = options_get_col(headers, headers_count, + cols, cols_count, "Name"); + if (evutil_ascii_strcasecmp(resolver_name, + proxy_context->resolver_name) != 0) { + return 0; + } + provider_name = options_get_col(headers, headers_count, + cols, cols_count, "Provider name"); + provider_publickey_s = options_get_col(headers, headers_count, + cols, cols_count, + "Provider public key"); + resolver_ip = options_get_col(headers, headers_count, + cols, cols_count, "Resolver address"); + if (provider_name == NULL || *provider_name == 0) { + logger(proxy_context, LOG_ERR, + "Resolvers list is missing a provider name for [%s]", + resolver_name); + return -1; + } + if (provider_publickey_s == NULL || *provider_publickey_s == 0) { + logger(proxy_context, LOG_ERR, + "Resolvers list is missing a public key for [%s]", + resolver_name); + return -1; + } + if (resolver_ip == NULL || *resolver_ip == 0) { + logger(proxy_context, LOG_ERR, + "Resolvers list is missing a resolver address for [%s]", + resolver_name); + return -1; + } + proxy_context->provider_name = strdup(provider_name); + proxy_context->provider_publickey_s = strdup(provider_publickey_s); + proxy_context->resolver_ip = strdup(resolver_ip); + if (proxy_context->provider_name == NULL || + proxy_context->provider_publickey_s == NULL || + proxy_context->resolver_ip == NULL) { + logger_noformat(proxy_context, LOG_EMERG, "Out of memory"); + exit(1); + } + return 1; +} + +static int +options_parse_resolvers_list(ProxyContext * const proxy_context, char *buf) +{ + char *cols[OPTIONS_RESOLVERS_LIST_MAX_COLS]; + char *headers[OPTIONS_RESOLVERS_LIST_MAX_COLS]; + size_t cols_count; + size_t headers_count; + + assert(proxy_context->resolver_name != NULL); + buf = minicsv_parse_line(buf, headers, &headers_count, + sizeof headers / sizeof headers[0]); + if (headers_count < 4U) { + return -1; + } + do { + buf = minicsv_parse_line(buf, cols, &cols_count, + sizeof cols / sizeof cols[0]); + minicsv_trim_cols(cols, cols_count); + if (cols_count < 4U || *cols[0] == 0 || *cols[0] == '#') { + continue; + } + if (options_parse_resolver(proxy_context, headers, headers_count, + cols, cols_count) > 0) { + return 0; + } + } while (*buf != 0); + + return -1; +} + +static int +options_use_resolver_name(ProxyContext * const proxy_context) +{ + char *file_buf; + + file_buf = options_read_file(proxy_context->resolvers_list); + if (file_buf == NULL) { + logger(proxy_context, LOG_ERR, "Unable to read [%s]", + proxy_context->resolvers_list); + exit(1); + } + assert(proxy_context->resolver_name != NULL); + if (options_parse_resolvers_list(proxy_context, file_buf) < 0) { + logger(proxy_context, LOG_ERR, + "No resolver named [%s] found in the [%s] list", + proxy_context->resolver_name, proxy_context->resolvers_list); + } + free(file_buf); + + return 0; +} + static int options_apply(ProxyContext * const proxy_context) { - if (proxy_context->resolver_ip == NULL) { - options_usage(); + if (proxy_context->resolver_name != NULL) { + if (proxy_context->resolvers_list == NULL) { + logger_noformat(proxy_context, LOG_ERR, + "Resolvers list (-L command-line switch) required"); + exit(1); + } + if (options_use_resolver_name(proxy_context) != 0) { + logger(proxy_context, LOG_ERR, + "Resolver name (-R command-line switch) required. " + "See [%s] for a list of public resolvers.", + proxy_context->resolvers_list); + exit(1); + } + } + if (proxy_context->resolver_ip == NULL || + *proxy_context->resolver_ip == 0 || + proxy_context->provider_name == NULL || + *proxy_context->provider_name == 0 || + proxy_context->provider_publickey_s == NULL || + *proxy_context->provider_publickey_s == 0) { + logger_noformat(proxy_context, LOG_ERR, + "Resolver information required."); + logger_noformat(proxy_context, LOG_ERR, + "The easiest way to do so is to provide a resolver name."); + logger_noformat(proxy_context, LOG_ERR, + "Example: dnscrypt-proxy -R mydnsprovider"); + logger(proxy_context, LOG_ERR, + "See the file [%s] for a list of compatible public resolvers", + proxy_context->resolvers_list); + logger_noformat(proxy_context, LOG_ERR, + "The name is the first column in this table."); + logger_noformat(proxy_context, LOG_ERR, + "Alternatively, an IP address, a provider name " + "and a provider key can be supplied."); +#ifdef _WIN32 + logger_noformat(proxy_context, LOG_ERR, + "Consult http://dnscrypt.org " + "and https://github.com/jedisct1/dnscrypt-proxy/blob/master/README-WINDOWS.markdown " + "for details."); +#else + logger_noformat(proxy_context, LOG_ERR, + "Please consult http://dnscrypt.org " + "and the dnscrypt-proxy(8) man page for details."); +#endif exit(1); } if (proxy_context->provider_name == NULL || @@ -140,6 +353,11 @@ options_apply(ProxyContext * const proxy_context) logger_noformat(proxy_context, LOG_ERR, "Provider name required"); exit(1); } + if (options_check_protocol_versions(proxy_context->provider_name) != 0) { + logger_noformat(proxy_context, LOG_ERR, + "Unsupported server protocol version"); + exit(1); + } if (proxy_context->provider_publickey_s == NULL) { logger_noformat(proxy_context, LOG_ERR, "Provider key required"); exit(1); @@ -176,8 +394,11 @@ int options_parse(AppContext * const app_context, ProxyContext * const proxy_context, int argc, char *argv[]) { - int opt_flag; - int option_index = 0; + int opt_flag; + int option_index = 0; +#ifdef _WIN32 + _Bool option_install = 0; +#endif options_init_with_default(app_context, proxy_context); while ((opt_flag = getopt_long(argc, argv, @@ -200,10 +421,17 @@ options_parse(AppContext * const app_context, "Invalid EDNS payload size: [%s]", optarg); exit(1); } - if (edns_payload_size <= DNS_MAX_PACKET_SIZE_UDP_SEND) { + if (edns_payload_size <= DNS_MAX_PACKET_SIZE_UDP_NO_EDNS_SEND) { proxy_context->edns_payload_size = (size_t) 0U; + proxy_context->udp_max_size = DNS_MAX_PACKET_SIZE_UDP_NO_EDNS_SEND; } else { proxy_context->edns_payload_size = (size_t) edns_payload_size; + assert(proxy_context->udp_max_size >= + DNS_MAX_PACKET_SIZE_UDP_NO_EDNS_SEND); + if (proxy_context->edns_payload_size > DNS_MAX_PACKET_SIZE_UDP_NO_EDNS_SEND) { + proxy_context->udp_max_size = + proxy_context->edns_payload_size; + } } break; } @@ -216,6 +444,24 @@ options_parse(AppContext * const app_context, case 'l': proxy_context->log_file = optarg; break; + case 'L': + proxy_context->resolvers_list = optarg; + break; + case 'R': + proxy_context->resolver_name = optarg; + break; + case 'm': { + char *endptr; + const long max_log_level = strtol(optarg, &endptr, 10); + + if (*optarg == 0 || *endptr != 0 || max_log_level < 0) { + logger(proxy_context, LOG_ERR, + "Invalid max log level: [%s]", optarg); + exit(1); + } + proxy_context->max_log_level = max_log_level; + break; + } case 'n': { char *endptr; const unsigned long connections_count_max = @@ -238,6 +484,21 @@ options_parse(AppContext * const app_context, case 'r': proxy_context->resolver_ip = optarg; break; + case 't': { + char *endptr; + const unsigned long margin = + strtoul(optarg, &endptr, 10); + + if (*optarg == 0 || *endptr != 0 || + margin > UINT32_MAX / 60U) { + logger(proxy_context, LOG_ERR, + "Invalid certificate grace period: [%s]", optarg); + exit(1); + } + proxy_context->test_cert_margin = (time_t) margin * (time_t) 60U; + proxy_context->test_only = 1; + break; + } #ifdef HAVE_GETPWNAM case 'u': { const struct passwd * const pw = getpwnam(optarg); @@ -276,11 +537,17 @@ options_parse(AppContext * const app_context, break; #ifdef _WIN32 case WIN_OPTION_INSTALL: + case WIN_OPTION_REINSTALL: + option_install = 1; + break; case WIN_OPTION_UNINSTALL: - if (windows_service_option(opt_flag, argc, - (const char **) argv) != 0) { - options_usage(); + if (windows_service_uninstall() != 0) { + logger_noformat(NULL, LOG_ERR, "Unable to uninstall the service"); exit(1); + } else { + logger_noformat(NULL, LOG_INFO, "The " WINDOWS_SERVICE_NAME + " service has been removed from this system"); + exit(0); } break; #endif @@ -292,6 +559,24 @@ options_parse(AppContext * const app_context, if (options_apply(proxy_context) != 0) { return -1; } +#ifdef _WIN32 + if (option_install != 0) { + if (windows_service_install(proxy_context) != 0) { + logger_noformat(NULL, LOG_ERR, "Unable to install the service"); + logger_noformat(NULL, LOG_ERR, + "Make sure that you are using an elevated command prompt " + "and that the service hasn't been already installed"); + exit(1); + } + logger_noformat(NULL, LOG_INFO, "The " WINDOWS_SERVICE_NAME + " service has been installed and started"); + logger_noformat(NULL, LOG_INFO, "The registry key used for this " + "service is " WINDOWS_SERVICE_REGISTRY_PARAMETERS_KEY); + logger(NULL, LOG_INFO, "Now, change your resolver settings to %s", + proxy_context->local_ip); + exit(0); + } +#endif return 0; } diff --git a/src/proxy/options.h b/src/proxy/options.h index 5479a241..22071ec3 100644 --- a/src/proxy/options.h +++ b/src/proxy/options.h @@ -7,4 +7,6 @@ int options_parse(AppContext * const app_context, void options_free(ProxyContext * const proxy_context); +#define OPTIONS_RESOLVERS_LIST_MAX_COLS 50 + #endif diff --git a/src/proxy/salsa20_random.c b/src/proxy/salsa20_random.c deleted file mode 100644 index ecca80c1..00000000 --- a/src/proxy/salsa20_random.c +++ /dev/null @@ -1,237 +0,0 @@ - -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include "crypto_core_salsa20.h" -#include "crypto_hash_sha256.h" -#include "crypto_stream_salsa20.h" -#include "salsa20_random.h" -#include "safe_rw.h" -#include "utils.h" - -#ifdef _WIN32 -# include -# include -#endif - -#define SALSA20_RANDOM_BLOCK_SIZE crypto_core_salsa20_OUTPUTBYTES -#define SHA256_BLOCK_SIZE 64U -#define SHA256_MIN_PAD_SIZE (1U + 8U) - -typedef struct Salsa20Random_ { - unsigned char key[crypto_stream_salsa20_KEYBYTES]; - unsigned char rnd32[SALSA20_RANDOM_BLOCK_SIZE]; - uint64_t nonce; - size_t rnd32_outleft; - pid_t pid; -#ifdef _WIN32 - HCRYPTPROV hcrypt_prov; -#endif - int random_data_source_fd; - _Bool initialized; -} Salsa20Random; - -static Salsa20Random stream = { - .random_data_source_fd = -1, - .rnd32_outleft = (size_t) 0U, - .initialized = 0 -}; - -#ifndef _WIN32 -static int -salsa20_random_random_dev_open(void) -{ - static const char * const devices[] = { -# ifndef USE_BLOCKING_RANDOM - "/dev/arandom", "/dev/urandom", -# endif - "/dev/random", NULL - }; - const char * const *device = devices; - - do { - if (access(*device, F_OK | R_OK) == 0) { - return open(*device, O_RDONLY); - } - device++; - } while (*device != NULL); - - return -1; -} - -static void -salsa20_random_init(void) -{ - stream.nonce = dnscrypt_hrtime(); - assert(stream.nonce != (uint64_t) 0U); - - if ((stream.random_data_source_fd = - salsa20_random_random_dev_open()) == -1) { - abort(); - } -} - -#else /* _WIN32 */ - -static void -salsa20_random_init(void) -{ - stream.nonce = dnscrypt_hrtime(); - assert(stream.nonce != (uint64_t) 0U); - - if (! CryptAcquireContext(&stream.hcrypt_prov, NULL, NULL, - PROV_RSA_FULL, CRYPT_VERIFYCONTEXT)) { - abort(); - } -} -#endif - -void -salsa20_random_stir(void) -{ - unsigned char m0[3U * SHA256_BLOCK_SIZE - SHA256_MIN_PAD_SIZE]; - unsigned char m1[SHA256_BLOCK_SIZE + crypto_hash_sha256_BYTES]; - unsigned char *k0 = m0 + SHA256_BLOCK_SIZE; - unsigned char *k1 = m1 + SHA256_BLOCK_SIZE; - size_t i; - size_t sizeof_k0 = sizeof m0 - SHA256_BLOCK_SIZE; - - memset(stream.rnd32, 0, sizeof stream.rnd32); - stream.rnd32_outleft = (size_t) 0U; - if (stream.initialized == 0) { - salsa20_random_init(); - stream.initialized = 1; - } - memset(m0, 0x69, SHA256_BLOCK_SIZE); - memset(m1, 0x42, SHA256_BLOCK_SIZE); -#ifndef _WIN32 - if (safe_read(stream.random_data_source_fd, k0, - sizeof_k0) != (ssize_t) sizeof_k0) { - abort(); - } -#else /* _WIN32 */ - if (! CryptGenRandom(stream.hcrypt_prov, sizeof_k0, k0)) { - abort(); - } -#endif - COMPILER_ASSERT(sizeof m0 >= 2U * SHA256_BLOCK_SIZE); - crypto_hash_sha256(k1, m0, sizeof m0); - COMPILER_ASSERT(sizeof m1 >= SHA256_BLOCK_SIZE + crypto_hash_sha256_BYTES); - crypto_hash_sha256(stream.key, m1, sizeof m1); - dnscrypt_memzero(m1, sizeof m1); - COMPILER_ASSERT(sizeof stream.key == crypto_hash_sha256_BYTES); - assert(sizeof stream.key <= sizeof_k0); - for (i = (size_t) 0U; i < sizeof stream.key; i++) { - stream.key[i] ^= k0[i]; - } - dnscrypt_memzero(m0, sizeof m0); -} - -static void -salsa20_random_stir_if_needed(void) -{ - const pid_t pid = getpid(); - - if (stream.initialized == 0 || stream.pid != pid) { - stream.pid = pid; - salsa20_random_stir(); - } -} - -static uint32_t -salsa20_random_getword(void) -{ - uint32_t val; - - COMPILER_ASSERT(sizeof stream.rnd32 >= sizeof val); - COMPILER_ASSERT(sizeof stream.rnd32 % sizeof val == (size_t) 0U); - if (stream.rnd32_outleft <= (size_t) 0U) { - COMPILER_ASSERT(sizeof stream.nonce == crypto_stream_salsa20_NONCEBYTES); - assert(crypto_stream_salsa20((unsigned char *) stream.rnd32, - (unsigned long long) sizeof stream.rnd32, - (unsigned char *) &stream.nonce, - stream.key) == 0); - stream.nonce++; - stream.rnd32_outleft = sizeof stream.rnd32; - } - stream.rnd32_outleft -= sizeof val; - memcpy(&val, &stream.rnd32[stream.rnd32_outleft], sizeof val); - - return val; -} - -int -salsa20_random_close(void) -{ - int ret = -1; - -#ifndef _WIN32 - if (stream.random_data_source_fd != -1 && - close(stream.random_data_source_fd) == 0) { - stream.random_data_source_fd = -1; - stream.initialized = 0; - ret = 0; - } -#else /* _WIN32 */ - if (stream.initialized != 0 && - CryptReleaseContext(stream.hcrypt_prov, 0)) { - stream.initialized = 0; - ret = 0; - } -#endif - return ret; -} - -uint32_t -salsa20_random(void) -{ - salsa20_random_stir_if_needed(); - - return salsa20_random_getword(); -} - -void -salsa20_random_buf(void * const buf, const size_t size) -{ - salsa20_random_stir_if_needed(); - COMPILER_ASSERT(sizeof stream.nonce == crypto_stream_salsa20_NONCEBYTES); -#ifdef ULONG_LONG_MAX - assert(size <= ULONG_LONG_MAX); -#endif - assert(crypto_stream_salsa20(buf, (unsigned long long) size, - (unsigned char *) &stream.nonce, - stream.key) == 0); - stream.nonce++; -} - -/* - * salsa20_random_uniform() derives from OpenBSD's arc4random_uniform() - * Copyright (c) 2008, Damien Miller - */ - -uint32_t -salsa20_random_uniform(const uint32_t upper_bound) -{ - uint32_t min; - uint32_t r; - - if (upper_bound < 2) { - return 0; - } - min = (uint32_t) (-upper_bound % upper_bound); - for (;;) { - r = salsa20_random(); - if (r >= min) { - break; - } - } - return r % upper_bound; -} diff --git a/src/proxy/salsa20_random.h b/src/proxy/salsa20_random.h deleted file mode 100644 index 2df9c2e9..00000000 --- a/src/proxy/salsa20_random.h +++ /dev/null @@ -1,14 +0,0 @@ - -#ifndef __SALSA20_RANDOM_H__ -#define __SALSA20_RANDOM_H__ 1 - -#include -#include - -uint32_t salsa20_random(void); -void salsa20_random_stir(void); -uint32_t salsa20_random_uniform(const uint32_t upper_bound); -void salsa20_random_buf(void * const buf, const size_t size); -int salsa20_random_close(void); - -#endif diff --git a/src/proxy/stack_trace.c b/src/proxy/stack_trace.c index dccd0d59..cbfc6f71 100644 --- a/src/proxy/stack_trace.c +++ b/src/proxy/stack_trace.c @@ -60,6 +60,7 @@ static void stack_trace_signal_handler(int sig, siginfo_t *info, void *f) { (void) info; (void) f; + fprintf(stderr, "\nSignal [%d] received.\n\n", sig); stack_trace(); kill(getpid(), sig); abort(); diff --git a/src/proxy/tcp_request.c b/src/proxy/tcp_request.c index 5c95e7b8..a946cac4 100644 --- a/src/proxy/tcp_request.c +++ b/src/proxy/tcp_request.c @@ -550,19 +550,33 @@ tcp_listener_bind(ProxyContext * const proxy_context) #ifndef LEV_OPT_DEFERRED_ACCEPT # define LEV_OPT_DEFERRED_ACCEPT 0 #endif - proxy_context->tcp_conn_listener = - evconnlistener_new_bind(proxy_context->event_loop, - tcp_connection_cb, proxy_context, - LEV_OPT_CLOSE_ON_FREE | - LEV_OPT_CLOSE_ON_EXEC | - LEV_OPT_REUSEABLE | - LEV_OPT_DEFERRED_ACCEPT, - TCP_REQUEST_BACKLOG, - (struct sockaddr *) - &proxy_context->local_sockaddr, - (int) proxy_context->local_sockaddr_len); + if (proxy_context->tcp_listener_handle == -1) { + proxy_context->tcp_conn_listener = + evconnlistener_new_bind(proxy_context->event_loop, + tcp_connection_cb, proxy_context, + LEV_OPT_CLOSE_ON_FREE | + LEV_OPT_CLOSE_ON_EXEC | + LEV_OPT_REUSEABLE | + LEV_OPT_DEFERRED_ACCEPT, + TCP_REQUEST_BACKLOG, + (struct sockaddr *) + &proxy_context->local_sockaddr, + (int) proxy_context->local_sockaddr_len); + } else { + evutil_make_socket_closeonexec(proxy_context->tcp_listener_handle); + evutil_make_socket_nonblocking(proxy_context->tcp_listener_handle); + proxy_context->tcp_conn_listener = + evconnlistener_new(proxy_context->event_loop, + tcp_connection_cb, proxy_context, + LEV_OPT_CLOSE_ON_FREE | + LEV_OPT_CLOSE_ON_EXEC | + LEV_OPT_REUSEABLE | + LEV_OPT_DEFERRED_ACCEPT, + TCP_REQUEST_BACKLOG, + proxy_context->tcp_listener_handle); + } if (proxy_context->tcp_conn_listener == NULL) { - logger(NULL, LOG_ERR, "Unable to bind (TCP)"); + logger_noformat(proxy_context, LOG_ERR, "Unable to bind (TCP)"); return -1; } if (evconnlistener_disable(proxy_context->tcp_conn_listener) != 0) { diff --git a/src/proxy/udp_request.c b/src/proxy/udp_request.c index 6ad15b8f..e99a42c4 100644 --- a/src/proxy/udp_request.c +++ b/src/proxy/udp_request.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include @@ -37,11 +38,6 @@ udp_request_free(UDPRequest * const udp_request) { ProxyContext *proxy_context; - if (udp_request->sendto_retry_timer != NULL) { - free(event_get_callback_arg(udp_request->sendto_retry_timer)); - event_free(udp_request->sendto_retry_timer); - udp_request->sendto_retry_timer = NULL; - } if (udp_request->timeout_timer != NULL) { event_free(udp_request->timeout_timer); udp_request->timeout_timer = NULL; @@ -70,99 +66,21 @@ udp_request_kill(UDPRequest * const udp_request) udp_request_free(udp_request); } -static int sendto_with_retry(SendtoWithRetryCtx * const ctx); - -static void -sendto_with_retry_timer_cb(evutil_socket_t retry_timer_handle, short ev_flags, - void * const ctx_) -{ - SendtoWithRetryCtx * const ctx = ctx_; - - (void) ev_flags; - assert(retry_timer_handle == - event_get_fd(ctx->udp_request->sendto_retry_timer)); - - DNSCRYPT_PROXY_REQUEST_UDP_RETRY(ctx->udp_request, - ctx->udp_request->retries); - sendto_with_retry(ctx); -} +static int udp_send(SendtoWithRetryCtx * const ctx); static int -sendto_with_retry(SendtoWithRetryCtx * const ctx) +udp_send(SendtoWithRetryCtx * const ctx) { void (*cb)(UDPRequest *udp_request); - SendtoWithRetryCtx *ctx_cb; UDPRequest *udp_request = ctx->udp_request; - int err; - _Bool retriable; - - if (sendto(ctx->handle, ctx->buffer, ctx->length, ctx->flags, - ctx->dest_addr, ctx->dest_len) == (ssize_t) ctx->length) { - cb = ctx->cb; - if (udp_request->sendto_retry_timer != NULL) { - assert(event_get_callback_arg(udp_request->sendto_retry_timer) - == ctx); - free(ctx); - event_free(udp_request->sendto_retry_timer); - udp_request->sendto_retry_timer = NULL; - } - if (cb) { - cb(udp_request); - } - return 0; - } - err = evutil_socket_geterror(udp_request->client_proxy_handle); - logger(udp_request->proxy_context, LOG_WARNING, - "sendto: [%s]", evutil_socket_error_to_string(err)); - DNSCRYPT_PROXY_REQUEST_UDP_NETWORK_ERROR(udp_request); - -#ifdef _WIN32 - retriable = (err == WSAENOBUFS || - err == WSAEWOULDBLOCK || err == WSAEINTR); -#else - retriable = (err == ENOBUFS || err == ENOMEM || - err == EAGAIN || err == EINTR); -#endif - if (retriable == 0) { - udp_request_kill(udp_request); - return -1; + (void) sendto(ctx->handle, ctx->buffer, ctx->length, ctx->flags, + ctx->dest_addr, ctx->dest_len); + cb = ctx->cb; + if (cb) { + cb(udp_request); } - COMPILER_ASSERT(DNS_QUERY_TIMEOUT < UCHAR_MAX); - if (++(udp_request->retries) > DNS_QUERY_TIMEOUT) { - udp_request_kill(udp_request); - return -1; - } - if (udp_request->sendto_retry_timer != NULL) { - ctx_cb = event_get_callback_arg(udp_request->sendto_retry_timer); - assert(ctx_cb != NULL); - assert(ctx_cb->udp_request == ctx->udp_request); - assert(ctx_cb->buffer == ctx->buffer); - assert(ctx_cb->cb == ctx->cb); - } else { - if ((ctx_cb = malloc(sizeof *ctx_cb)) == NULL) { - logger_error(udp_request->proxy_context, "malloc"); - udp_request_kill(udp_request); - return -1; - } - if ((udp_request->sendto_retry_timer = - evtimer_new(udp_request->proxy_context->event_loop, - sendto_with_retry_timer_cb, ctx_cb)) == NULL) { - free(ctx_cb); - udp_request_kill(udp_request); - return -1; - } - assert(ctx_cb == - event_get_callback_arg(udp_request->sendto_retry_timer)); - *ctx_cb = *ctx; - } - const struct timeval tv = { - .tv_sec = (time_t) UDP_DELAY_BETWEEN_RETRIES, .tv_usec = 0 - }; - evtimer_add(udp_request->sendto_retry_timer, &tv); - DNSCRYPT_PROXY_REQUEST_UDP_RETRY_SCHEDULED(udp_request, - udp_request->retries); - return -1; + return 0; } static void @@ -194,7 +112,7 @@ resolver_to_proxy_cb(evutil_socket_t proxy_resolver_handle, short ev_flags, if (evutil_sockaddr_cmp((const struct sockaddr *) &resolver_sockaddr, (const struct sockaddr *) &proxy_context->resolver_sockaddr, 1) != 0) { - logger_noformat(proxy_context, LOG_WARNING, + logger_noformat(proxy_context, LOG_DEBUG, "Received a resolver reply from a different resolver"); return; } @@ -237,6 +155,24 @@ resolver_to_proxy_cb(evutil_socket_t proxy_resolver_handle, short ev_flags, memset(udp_request->client_nonce, 0, sizeof udp_request->client_nonce); assert(uncurved_len <= dns_reply_len); dns_reply_len = uncurved_len; + + assert(dns_reply_len >= DNS_HEADER_SIZE); + COMPILER_ASSERT(DNS_OFFSET_FLAGS < DNS_HEADER_SIZE); + if ((dns_reply[DNS_OFFSET_FLAGS] & DNS_FLAGS_TC) != 0) { + if (proxy_context->udp_current_max_size < + proxy_context->udp_max_size) { + COMPILER_ASSERT(DNS_MAX_PACKET_SIZE_UDP_NO_EDNS_SEND >= + DNSCRYPT_BLOCK_SIZE); + if (proxy_context->udp_max_size - + proxy_context->udp_current_max_size > DNSCRYPT_BLOCK_SIZE) { + proxy_context->udp_current_max_size += DNSCRYPT_BLOCK_SIZE; + } else { + proxy_context->udp_current_max_size = + proxy_context->udp_max_size; + } + } + } + #ifdef PLUGINS const size_t max_reply_size_for_filter = sizeof dns_reply; DCPluginDNSPacket dcp_packet = { @@ -263,7 +199,7 @@ resolver_to_proxy_cb(evutil_socket_t proxy_resolver_handle, short ev_flags, DNSCRYPT_PROXY_REQUEST_PLUGINS_POST_DONE(udp_request, dns_reply_len, max_reply_size_for_filter); #endif - sendto_with_retry(& (SendtoWithRetryCtx) { + udp_send(& (SendtoWithRetryCtx) { .udp_request = udp_request, .handle = udp_request->client_proxy_handle, .buffer = dns_reply, @@ -285,7 +221,7 @@ proxy_client_send_truncated(UDPRequest * const udp_request, assert(dns_reply_len > DNS_OFFSET_FLAGS2); dns_reply[DNS_OFFSET_FLAGS] |= DNS_FLAGS_TC | DNS_FLAGS_QR; dns_reply[DNS_OFFSET_FLAGS2] |= DNS_FLAGS2_RA; - sendto_with_retry(& (SendtoWithRetryCtx) { + udp_send(& (SendtoWithRetryCtx) { .udp_request = udp_request, .handle = udp_request->client_proxy_handle, .buffer = dns_reply, @@ -328,7 +264,10 @@ udp_tune(evutil_socket_t const handle) (void *) (int []) { UDP_BUFFER_SIZE }, sizeof (int)); setsockopt(handle, SOL_SOCKET, SO_SNDBUFFORCE, (void *) (int []) { UDP_BUFFER_SIZE }, sizeof (int)); -#if defined(IP_MTU_DISCOVER) && defined(IP_PMTUDISC_DONT) +#if defined(IP_PMTUDISC_OMIT) + setsockopt(handle, IPPROTO_IP, IP_MTU_DISCOVER, + (void *) (int []) { IP_PMTUDISC_OMIT }, sizeof (int)); +#elif defined(IP_MTU_DISCOVER) && defined(IP_PMTUDISC_DONT) setsockopt(handle, IPPROTO_IP, IP_MTU_DISCOVER, (void *) (int []) { IP_PMTUDISC_DONT }, sizeof (int)); #elif defined(IP_DONTFRAG) @@ -350,7 +289,7 @@ proxy_to_client_direct(UDPRequest * const udp_request, const uint8_t * const dns_reply, const size_t dns_reply_len) { - sendto_with_retry(& (SendtoWithRetryCtx) { + udp_send(& (SendtoWithRetryCtx) { .udp_request = udp_request, .handle = udp_request->client_proxy_handle, .buffer = dns_reply, @@ -382,7 +321,6 @@ client_to_proxy_cb(evutil_socket_t client_proxy_handle, short ev_flags, return; } udp_request->proxy_context = proxy_context; - udp_request->sendto_retry_timer = NULL; udp_request->timeout_timer = NULL; udp_request->client_proxy_handle = client_proxy_handle; udp_request->client_sockaddr_len = sizeof udp_request->client_sockaddr; @@ -428,8 +366,8 @@ client_to_proxy_cb(evutil_socket_t client_proxy_handle, short ev_flags, edns_add_section(proxy_context, dns_query, &dns_query_len, sizeof dns_query, &request_edns_payload_size); - if (request_edns_payload_size < DNS_MAX_PACKET_SIZE_UDP_SEND) { - max_query_size = DNS_MAX_PACKET_SIZE_UDP_SEND; + if (request_edns_payload_size < DNS_MAX_PACKET_SIZE_UDP_NO_EDNS_SEND) { + max_query_size = DNS_MAX_PACKET_SIZE_UDP_NO_EDNS_SEND; } else { max_query_size = request_edns_payload_size; } @@ -480,8 +418,9 @@ client_to_proxy_cb(evutil_socket_t client_proxy_handle, short ev_flags, #endif assert(SIZE_MAX - DNSCRYPT_MAX_PADDING - dnscrypt_query_header_size() > dns_query_len); - size_t max_len = dns_query_len + DNSCRYPT_MAX_PADDING + - dnscrypt_query_header_size(); + + size_t max_len; + max_len = proxy_context->udp_current_max_size; if (max_len > max_query_size) { max_len = max_query_size; } @@ -512,7 +451,7 @@ client_to_proxy_cb(evutil_socket_t client_proxy_handle, short ev_flags, }; evtimer_add(udp_request->timeout_timer, &tv); } - sendto_with_retry(& (SendtoWithRetryCtx) { + udp_send(& (SendtoWithRetryCtx) { .udp_request = udp_request, .handle = proxy_context->udp_proxy_resolver_handle, .buffer = dns_query, @@ -538,25 +477,27 @@ udp_listener_kill_oldest_request(ProxyContext * const proxy_context) int udp_listener_bind(ProxyContext * const proxy_context) { - assert(proxy_context->udp_listener_handle == -1); - if ((proxy_context->udp_listener_handle = socket - (proxy_context->local_sockaddr.ss_family, - SOCK_DGRAM, IPPROTO_UDP)) == -1) { - logger(NULL, LOG_ERR, "Unable to create a socket (UDP)"); - return -1; + if (proxy_context->udp_listener_handle == -1) { + if ((proxy_context->udp_listener_handle = socket + (proxy_context->local_sockaddr.ss_family, + SOCK_DGRAM, IPPROTO_UDP)) == -1) { + logger_noformat(proxy_context, LOG_ERR, + "Unable to create a socket (UDP)"); + return -1; + } + if (bind(proxy_context->udp_listener_handle, + (struct sockaddr *) &proxy_context->local_sockaddr, + proxy_context->local_sockaddr_len) != 0) { + logger(NULL, LOG_ERR, "Unable to bind (UDP) [%s]", + evutil_socket_error_to_string(evutil_socket_geterror( + proxy_context->udp_listener_handle))); + evutil_closesocket(proxy_context->udp_listener_handle); + proxy_context->udp_listener_handle = -1; + return -1; + } } evutil_make_socket_closeonexec(proxy_context->udp_listener_handle); evutil_make_socket_nonblocking(proxy_context->udp_listener_handle); - if (bind(proxy_context->udp_listener_handle, - (struct sockaddr *) &proxy_context->local_sockaddr, - proxy_context->local_sockaddr_len) != 0) { - logger(NULL, LOG_ERR, "Unable to bind (UDP) [%s]", - evutil_socket_error_to_string - (evutil_socket_geterror(proxy_context->udp_listener_handle))); - evutil_closesocket(proxy_context->udp_listener_handle); - proxy_context->udp_listener_handle = -1; - return -1; - } udp_tune(proxy_context->udp_listener_handle); if ((proxy_context->udp_proxy_resolver_handle = socket diff --git a/src/proxy/udp_request_p.h b/src/proxy/udp_request_p.h index b3125da4..3625fec8 100644 --- a/src/proxy/udp_request_p.h +++ b/src/proxy/udp_request_p.h @@ -21,7 +21,6 @@ typedef struct UDPRequest_ { TAILQ_ENTRY(UDPRequest_) queue; struct sockaddr_storage client_sockaddr; ProxyContext *proxy_context; - struct event *sendto_retry_timer; struct event *timeout_timer; evutil_socket_t client_proxy_handle; ev_socklen_t client_sockaddr_len; diff --git a/src/proxy/utils.c b/src/proxy/utils.c index af057149..27724930 100644 --- a/src/proxy/utils.c +++ b/src/proxy/utils.c @@ -13,21 +13,6 @@ #include "pathnames.h" #include "utils.h" -void -dnscrypt_memzero(void * const pnt, const size_t size) -{ -#ifdef HAVE_SECUREZEROMEMORY - SecureZeroMemory(pnt, size); -#else - volatile unsigned char *pnt_ = (volatile unsigned char *) pnt; - size_t i = (size_t) 0U; - - while (i < size) { - pnt_[i++] = 0U; - } -#endif -} - uint64_t dnscrypt_hrtime(void) { diff --git a/src/proxy/utils.h b/src/proxy/utils.h index 0ecf5889..09c0747d 100644 --- a/src/proxy/utils.h +++ b/src/proxy/utils.h @@ -7,7 +7,6 @@ #define COMPILER_ASSERT(X) (void) sizeof(char[(X) ? 1 : -1]) -void dnscrypt_memzero(void * const pnt, const size_t size); uint64_t dnscrypt_hrtime(void); int closedesc_all(const int closestdin); int do_daemonize(void); diff --git a/src/proxy/windows_service.c b/src/proxy/windows_service.c index 385aeaa8..4ec3f13b 100644 --- a/src/proxy/windows_service.c +++ b/src/proxy/windows_service.c @@ -2,6 +2,8 @@ #include #include "app.h" +#include "dnscrypt_proxy.h" +#include "logger.h" #include "windows_service.h" #ifndef _WIN32 @@ -26,15 +28,6 @@ main(int argc, char *argv[]) #include "logger.h" #include "utils.h" -#ifndef WINDOWS_SERVICE_NAME -# define WINDOWS_SERVICE_NAME "dnscrypt-proxy" -#endif -#ifndef WINDOWS_SERVICE_REGISTRY_PARAMETERS_KEY -# define WINDOWS_SERVICE_REGISTRY_PARAMETERS_KEY \ - "SYSTEM\\CurrentControlSet\\Services\\" \ - WINDOWS_SERVICE_NAME "\\Parameters" -#endif - static SERVICE_STATUS service_status; static SERVICE_STATUS_HANDLE service_status_handle; static _Bool app_is_running_as_a_service; @@ -231,6 +224,33 @@ windows_service_registry_read_dword(const char * const key, return ret; } +static int +windows_service_registry_write_string(const char * const key, + const char * const value) +{ + HKEY hk = NULL; + size_t value_len; + int ret = 0; + + value_len = strlen(value); + if (value_len > 0x7fffffff) { + return -1; + } + if (RegCreateKeyEx(HKEY_LOCAL_MACHINE, + WINDOWS_SERVICE_REGISTRY_PARAMETERS_KEY, + (DWORD) 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, + NULL, &hk, NULL) != ERROR_SUCCESS) { + return -1; + } + if (RegSetValueEx(hk, key, NULL, REG_SZ, (const BYTE *) value, + (DWORD) value_len) != ERROR_SUCCESS) { + ret = -1; + } + RegCloseKey(hk); + + return ret; +} + static int windows_build_command_line_from_registry(int * const argc_p, char *** const argv_p) @@ -243,6 +263,18 @@ windows_build_command_line_from_registry(int * const argc_p, if ((*argv_p = cmdline_clone_options(*argc_p, *argv_p)) == NULL) { exit(1); } + if (windows_service_registry_read_string + ("ResolversList", &string_value) == 0) { + err += cmdline_add_option(argc_p, argv_p, "--resolvers-list"); + err += cmdline_add_option(argc_p, argv_p, string_value); + free(string_value); + } + if (windows_service_registry_read_string + ("ResolverName", &string_value) == 0) { + err += cmdline_add_option(argc_p, argv_p, "--resolver-name"); + err += cmdline_add_option(argc_p, argv_p, string_value); + free(string_value); + } if (windows_service_registry_read_string ("LocalAddress", &string_value) == 0) { err += cmdline_add_option(argc_p, argv_p, "--local-address"); @@ -346,22 +378,25 @@ windows_main(int argc, char *argv[]) return 0; } -static int +int windows_service_uninstall(void) { - SC_HANDLE scm_handle; - SC_HANDLE service_handle; - int ret = 0; + SC_HANDLE scm_handle; + SC_HANDLE service_handle; + SERVICE_STATUS service_status; + int ret = 0; scm_handle = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS); if (scm_handle == NULL) { return -1; } - service_handle = OpenService(scm_handle, WINDOWS_SERVICE_NAME, DELETE); + service_handle = OpenService(scm_handle, WINDOWS_SERVICE_NAME, + DELETE | SERVICE_STOP); if (service_handle == NULL) { CloseServiceHandle(scm_handle); return 0; } + ControlService(service_handle, SERVICE_CONTROL_STOP, &service_status); if (DeleteService(service_handle) == 0) { ret = -1; } @@ -372,14 +407,35 @@ windows_service_uninstall(void) } static int -windows_service_install(const int argc, const char * const argv[]) +windows_registry_install(ProxyContext * const proxy_context) +{ + if (proxy_context->resolvers_list != NULL) { + windows_service_registry_write_string("ResolversList", + proxy_context->resolvers_list); + } + if (proxy_context->resolver_name != NULL) { + windows_service_registry_write_string("ResolverName", + proxy_context->resolver_name); + } + if (proxy_context->local_ip != NULL) { + windows_service_registry_write_string("LocalAddress", + proxy_context->local_ip); + } + return 0; +} + +int +windows_service_install(ProxyContext * const proxy_context) { char self_path[MAX_PATH]; SC_HANDLE scm_handle; SC_HANDLE service_handle; - (void) argc; - (void) argv; + if (windows_registry_install(proxy_context) != 0) { + logger_noformat(proxy_context, LOG_ERR, + "Unable to set up registry keys"); + return -1; + } if (GetModuleFileName(NULL, self_path, MAX_PATH) <= (DWORD) 0) { return -1; } @@ -403,42 +459,6 @@ windows_service_install(const int argc, const char * const argv[]) return 0; } -int -windows_service_option(const int opt_flag, const int argc, - const char *argv[]) -{ - if (app_is_running_as_a_service != 0) { - return 0; - } - switch (opt_flag) { - case WIN_OPTION_INSTALL: - case WIN_OPTION_REINSTALL: - windows_service_uninstall(); - if (windows_service_install(argc, argv) != 0) { - logger_noformat(NULL, LOG_ERR, "Unable to install the service"); - exit(1); - } else { - logger_noformat(NULL, LOG_INFO, "The " WINDOWS_SERVICE_NAME - " service has been installed and started"); - exit(0); - } - break; - case WIN_OPTION_UNINSTALL: - if (windows_service_uninstall() != 0) { - logger_noformat(NULL, LOG_ERR, "Unable to uninstall the service"); - exit(1); - } else { - logger_noformat(NULL, LOG_INFO, "The " WINDOWS_SERVICE_NAME - " service has been removed from this system"); - exit(0); - } - break; - default: - return -1; - } - return 0; -} - int main(int argc, char *argv[]) { diff --git a/src/proxy/windows_service.h b/src/proxy/windows_service.h index 4ded9501..958b971d 100644 --- a/src/proxy/windows_service.h +++ b/src/proxy/windows_service.h @@ -2,13 +2,23 @@ #ifndef __WINDOWS_SERVICE_H__ #define __WINDOWS_SERVICE_H__ 1 +#ifndef WINDOWS_SERVICE_NAME +# define WINDOWS_SERVICE_NAME "dnscrypt-proxy" +#endif + +#ifndef WINDOWS_SERVICE_REGISTRY_PARAMETERS_KEY +# define WINDOWS_SERVICE_REGISTRY_PARAMETERS_KEY \ + "SYSTEM\\CurrentControlSet\\Services\\" \ + WINDOWS_SERVICE_NAME "\\Parameters" +#endif + typedef enum WinOption_ { WIN_OPTION_INSTALL = 256, WIN_OPTION_REINSTALL, WIN_OPTION_UNINSTALL } WinOption; -int windows_service_option(const int opt_flag, - const int argc, const char *argv[]); +int windows_service_install(ProxyContext * const proxy_context); +int windows_service_uninstall(void); #endif diff --git a/test/Gemfile.lock b/test/Gemfile.lock index b8df1985..2e56971a 100644 --- a/test/Gemfile.lock +++ b/test/Gemfile.lock @@ -1,33 +1,30 @@ GEM remote: http://rubygems.org/ specs: - aruba (0.4.11) - childprocess (>= 0.2.3) + aruba (0.6.1) + childprocess (>= 0.3.6) cucumber (>= 1.1.1) - ffi (>= 1.0.11) - rspec (>= 2.7.0) - builder (3.0.0) - childprocess (0.3.3) - ffi (~> 1.0.6) - cucumber (1.2.1) + rspec-expectations (>= 2.7.0) + builder (3.2.2) + childprocess (0.5.3) + ffi (~> 1.0, >= 1.0.11) + cucumber (1.3.17) builder (>= 2.1.2) diff-lcs (>= 1.1.3) - gherkin (~> 2.11.0) - json (>= 1.4.6) - diff-lcs (1.1.3) - ffi (1.0.11) - gherkin (2.11.1) - json (>= 1.4.6) - json (1.7.3) - net-dns (0.7.1) - rspec (2.11.0) - rspec-core (~> 2.11.0) - rspec-expectations (~> 2.11.0) - rspec-mocks (~> 2.11.0) - rspec-core (2.11.0) - rspec-expectations (2.11.1) - diff-lcs (~> 1.1.3) - rspec-mocks (2.11.1) + gherkin (~> 2.12) + multi_json (>= 1.7.5, < 2.0) + multi_test (>= 0.1.1) + diff-lcs (1.2.5) + ffi (1.9.5) + gherkin (2.12.2) + multi_json (~> 1.3) + multi_json (1.10.1) + multi_test (0.1.1) + net-dns (0.8.0) + rspec-expectations (3.1.2) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.1.0) + rspec-support (3.1.1) PLATFORMS ruby diff --git a/test/features/test-dnscrypt-proxy/forced_tcp.feature b/test/features/test-dnscrypt-proxy/forced_tcp.feature index 0950838d..69256aac 100644 --- a/test/features/test-dnscrypt-proxy/forced_tcp.feature +++ b/test/features/test-dnscrypt-proxy/forced_tcp.feature @@ -8,6 +8,6 @@ TCP. would fit in a 512-bytes UDP packet, expect a forced fallback to TCP. Given a working opendnscache on 208.67.220.220 - And a running dnscrypt proxy with options "--edns-payload-size=4096 --tcp-only" + And a running dnscrypt proxy with options "--edns-payload-size=4096 --tcp-only -R opendns" When a client asks dnscrypt-proxy for "resolver1.opendns.com" Then dnscrypt-proxy returns "208.67.222.222" diff --git a/test/features/test-dnscrypt-proxy/small_udp_query.feature b/test/features/test-dnscrypt-proxy/small_udp_query.feature index 367acf23..95ee7c31 100644 --- a/test/features/test-dnscrypt-proxy/small_udp_query.feature +++ b/test/features/test-dnscrypt-proxy/small_udp_query.feature @@ -5,13 +5,13 @@ Feature: Small UDP query Scenario: query an existing name. Given a working opendnscache on 208.67.220.220 - And a running dnscrypt proxy with options "--edns-payload-size=0" + And a running dnscrypt proxy with options "--edns-payload-size=0 -R opendns" When a client asks dnscrypt-proxy for "resolver1.opendns.com" Then dnscrypt-proxy returns "208.67.222.222" Scenario: query a nonexistent name. Given a working opendnscache on 208.67.220.220 - And a running dnscrypt proxy with options "--edns-payload-size=0" + And a running dnscrypt proxy with options "--edns-payload-size=0 -R opendns" When a client asks dnscrypt-proxy for "nonexistent.opendns.com" Then dnscrypt-proxy returns a NXDOMAIN answer diff --git a/test/features/test-dnscrypt-proxy/tcp_fallback.feature b/test/features/test-dnscrypt-proxy/tcp_fallback.feature index 9b565a99..e2a54e21 100644 --- a/test/features/test-dnscrypt-proxy/tcp_fallback.feature +++ b/test/features/test-dnscrypt-proxy/tcp_fallback.feature @@ -7,6 +7,6 @@ and the proxy should handle TCP just fine. Scenario: query an existing name over UDP, expect fallback to TCP. Given a working opendnscache on 208.67.220.220 - And a running dnscrypt proxy with options "--edns-payload-size=0" + And a running dnscrypt proxy with options "--edns-payload-size=0 -R opendns" When a client asks dnscrypt-proxy for "test-tcp.stdc.org" Then dnscrypt-proxy returns "127.0.0.1" diff --git a/test/features/test-hostip/resolve-specific.feature b/test/features/test-hostip/resolve-specific.feature index 43e4e84c..f6d48231 100644 --- a/test/features/test-hostip/resolve-specific.feature +++ b/test/features/test-hostip/resolve-specific.feature @@ -17,7 +17,7 @@ Feature: See if hostip can resolve names given a specific resolver When I run `hostip -r 8.8.8.8 -6 www.opendns.com` Then the output should contain exactly: """ - 2620:0:cc1:115::210 + 2620:0:cc1:115::219 """ And the exit status should be 0 diff --git a/test/features/test-hostip/resolve.feature b/test/features/test-hostip/resolve.feature index c74f7342..50c35292 100644 --- a/test/features/test-hostip/resolve.feature +++ b/test/features/test-hostip/resolve.feature @@ -17,7 +17,7 @@ Feature: See if hostip can resolve names When I run `hostip -6 www.opendns.com` Then the output should contain exactly: """ - 2620:0:cc1:115::210 + 2620:0:cc1:115::219 """ And the exit status should be 0