Disable SUBNODE code when not used. Use libsodium by default.

This commit is contained in:
Stuart D. Gathman 2016-10-14 21:07:40 -04:00
parent dcdbe474e7
commit f95a3a159f
1 changed files with 36 additions and 0 deletions

36
cjdns.sign.patch Normal file
View File

@ -0,0 +1,36 @@
diff -up ./crypto/Sign.c.sign ./crypto/Sign.c
--- ./crypto/Sign.c.sign 2016-10-13 21:41:54.994262245 -0400
+++ ./crypto/Sign.c 2016-10-14 20:51:33.395789629 -0400
@@ -13,6 +13,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#ifdef SUBNODE
#include "crypto/Sign.h"
//#include "node_build/dependencies/cnacl/crypto_sign/ed25519/ref10/ge.h"
@@ -110,3 +111,6 @@ int Sign_publicSigningKeyToCurve25519(ui
return 0;
}
+#else
+#pragma GCC diagnostic ignored "-Wpedantic"
+#endif // SUBNODE
diff -up ./crypto/test/Sign_test.c.sign ./crypto/test/Sign_test.c
--- ./crypto/test/Sign_test.c.sign 2016-10-14 20:29:19.334704236 -0400
+++ ./crypto/test/Sign_test.c 2016-10-14 20:52:31.415488510 -0400
@@ -23,6 +23,7 @@
int main()
{
+#ifdef SUBNODE
struct Allocator* alloc = MallocAllocator_new(1048576);
struct Log* logger = FileWriterLog_new(stdout, alloc);
struct Random* rand = Random_new(alloc, logger, NULL);
@@ -42,5 +43,6 @@ int main()
Assert_true(!Sign_verifyMsg(&signingKeyPair[32], msg));
Assert_true(!Sign_publicSigningKeyToCurve25519(curve25519publicB, &signingKeyPair[32]));
Assert_true(!Bits_memcmp(curve25519publicB, curve25519public, 32));
+#endif // SUBNODE
return 0;
}