diff --git a/src/main/java/com/frostwire/jlibtorrent/Ed25519.java b/src/main/java/com/frostwire/jlibtorrent/Ed25519.java index 1a06e24c7..86c4e0dc0 100644 --- a/src/main/java/com/frostwire/jlibtorrent/Ed25519.java +++ b/src/main/java/com/frostwire/jlibtorrent/Ed25519.java @@ -1,7 +1,8 @@ package com.frostwire.jlibtorrent; -import com.frostwire.jlibtorrent.swig.char_vector; -import com.frostwire.jlibtorrent.swig.ed25519; +import com.frostwire.jlibtorrent.swig.byte_vector; + +import static com.frostwire.jlibtorrent.swig.libtorrent.*; /** * @author gubatron @@ -9,12 +10,12 @@ */ public final class Ed25519 { - public final static int SEED_SIZE = ed25519.seed_size; - public final static int PRIVATE_KEY_SIZE = ed25519.private_key_size; - public final static int PUBLIC_KEY_SIZE = ed25519.public_key_size; - public final static int SIGNATURE_SIZE = ed25519.signature_size; - public final static int SCALAR_SIZE = ed25519.scalar_size; - public final static int SHARED_SECRET_SIZE = ed25519.shared_secret_size; + public final static int SEED_SIZE = ed25519_seed_size; + public final static int PRIVATE_KEY_SIZE = ed25519_private_key_size; + public final static int PUBLIC_KEY_SIZE = ed25519_public_key_size; + public final static int SIGNATURE_SIZE = ed25519_signature_size; + public final static int SCALAR_SIZE = ed25519_scalar_size; + public final static int SHARED_SECRET_SIZE = ed25519_shared_secret_size; private Ed25519() { } @@ -23,10 +24,10 @@ public static void createSeed(byte[] seed) { if (seed == null || seed.length != SEED_SIZE) { throw new IllegalArgumentException("seed buffer must be not null and of size " + SEED_SIZE); } - char_vector v = Vectors.new_char_vector(SEED_SIZE); - ed25519.create_seed(v); + byte_vector v = Vectors.new_byte_vector(SEED_SIZE); + ed25519_create_seed(v); - Vectors.char_vector2bytes(v, seed); + Vectors.byte_vector2bytes(v, seed); } public static void createKeypair(byte[] publicKey, byte[] privateKey, byte[] seed) { @@ -37,13 +38,13 @@ public static void createKeypair(byte[] publicKey, byte[] privateKey, byte[] see throw new IllegalArgumentException("private key buffer must be not null and of size " + PRIVATE_KEY_SIZE); } - char_vector v1 = Vectors.new_char_vector(PUBLIC_KEY_SIZE); - char_vector v2 = Vectors.new_char_vector(PRIVATE_KEY_SIZE); + byte_vector v1 = Vectors.new_byte_vector(PUBLIC_KEY_SIZE); + byte_vector v2 = Vectors.new_byte_vector(PRIVATE_KEY_SIZE); - ed25519.create_keypair(v1, v2, Vectors.bytes2char_vector(seed)); + ed25519_create_keypair(v1, v2, Vectors.bytes2byte_vector(seed)); - Vectors.char_vector2bytes(v1, publicKey); - Vectors.char_vector2bytes(v2, privateKey); + Vectors.byte_vector2bytes(v1, publicKey); + Vectors.byte_vector2bytes(v2, privateKey); } public static void sign(byte[] signature, byte[] message, byte[] publicKey, byte[] privateKey) { @@ -51,15 +52,15 @@ public static void sign(byte[] signature, byte[] message, byte[] publicKey, byte throw new IllegalArgumentException("signature buffer must be not null and of size " + SIGNATURE_SIZE); } - char_vector v1 = Vectors.new_char_vector(SIGNATURE_SIZE); + byte_vector v1 = Vectors.new_byte_vector(SIGNATURE_SIZE); - ed25519.sign(v1, Vectors.bytes2char_vector(message), Vectors.bytes2char_vector(publicKey), Vectors.bytes2char_vector(privateKey)); + ed25519_sign(v1, Vectors.bytes2byte_vector(message), Vectors.bytes2byte_vector(publicKey), Vectors.bytes2byte_vector(privateKey)); - Vectors.char_vector2bytes(v1, signature); + Vectors.byte_vector2bytes(v1, signature); } public static int verify(byte[] signature, byte[] message, byte[] privateKey) { - return ed25519.verify(Vectors.bytes2char_vector(signature), Vectors.bytes2char_vector(message), Vectors.bytes2char_vector(privateKey)); + return ed25519_verify(Vectors.bytes2byte_vector(signature), Vectors.bytes2byte_vector(message), Vectors.bytes2byte_vector(privateKey)); } public static void addScalar(byte[] publicKey, byte[] privateKey, byte[] scalar) { @@ -73,14 +74,14 @@ public static void addScalar(byte[] publicKey, byte[] privateKey, byte[] scalar) throw new IllegalArgumentException("scalar must be not null and of size " + SCALAR_SIZE); } - char_vector v1 = Vectors.bytes2char_vector(publicKey); - char_vector v2 = Vectors.bytes2char_vector(privateKey); - char_vector v3 = Vectors.bytes2char_vector(scalar); + byte_vector v1 = Vectors.bytes2byte_vector(publicKey); + byte_vector v2 = Vectors.bytes2byte_vector(privateKey); + byte_vector v3 = Vectors.bytes2byte_vector(scalar); - ed25519.add_scalar(v1, v2, v3); + ed25519_add_scalar(v1, v2, v3); - Vectors.char_vector2bytes(v1, publicKey); - Vectors.char_vector2bytes(v2, privateKey); + Vectors.byte_vector2bytes(v1, publicKey); + Vectors.byte_vector2bytes(v2, privateKey); } public static void keyExchange(byte[] sharedSecret, byte[] publicKey, byte[] privateKey) { @@ -88,10 +89,10 @@ public static void keyExchange(byte[] sharedSecret, byte[] publicKey, byte[] pri throw new IllegalArgumentException("shared secret buffer must be not null and of size " + SHARED_SECRET_SIZE); } - char_vector v1 = Vectors.new_char_vector(SHARED_SECRET_SIZE); + byte_vector v1 = Vectors.new_byte_vector(SHARED_SECRET_SIZE); - ed25519.key_exchange(v1, Vectors.bytes2char_vector(publicKey), Vectors.bytes2char_vector(privateKey)); + ed25519_key_exchange(v1, Vectors.bytes2byte_vector(publicKey), Vectors.bytes2byte_vector(privateKey)); - Vectors.char_vector2bytes(v1, sharedSecret); + Vectors.byte_vector2bytes(v1, sharedSecret); } } diff --git a/src/main/java/com/frostwire/jlibtorrent/Vectors.java b/src/main/java/com/frostwire/jlibtorrent/Vectors.java index f7c8bddad..a839d79e2 100644 --- a/src/main/java/com/frostwire/jlibtorrent/Vectors.java +++ b/src/main/java/com/frostwire/jlibtorrent/Vectors.java @@ -1,9 +1,6 @@ package com.frostwire.jlibtorrent; -import com.frostwire.jlibtorrent.swig.char_vector; -import com.frostwire.jlibtorrent.swig.int64_vector; -import com.frostwire.jlibtorrent.swig.int_vector; -import com.frostwire.jlibtorrent.swig.unsigned_char_vector; +import com.frostwire.jlibtorrent.swig.*; /** * @author gubatron @@ -25,6 +22,14 @@ public static byte[] char_vector2bytes(char_vector v) { return arr; } + public static void byte_vector2bytes(byte_vector v, byte[] arr) { + int size = (int) v.size(); + + for (int i = 0; i < size; i++) { + arr[i] = v.get(i); + } + } + public static void char_vector2bytes(char_vector v, byte[] arr) { int size = (int) v.size(); @@ -63,18 +68,8 @@ public static char_vector bytes2char_vector(byte[] arr) { return v; } - public static unsigned_char_vector bytes2unsigned_char_vector(byte[] arr) { - unsigned_char_vector v = new unsigned_char_vector(); - - for (int i = 0; i < arr.length; i++) { - v.add((short) arr[i]); - } - - return v; - } - - public static int_vector bytes2int_vector(byte[] arr) { - int_vector v = new int_vector(); + public static byte_vector bytes2byte_vector(byte[] arr) { + byte_vector v = new byte_vector(); for (int i = 0; i < arr.length; i++) { v.add(arr[i]); @@ -133,6 +128,16 @@ public static char_vector new_char_vector(int size) { return v; } + public static byte_vector new_byte_vector(int size) { + byte_vector v = new byte_vector(); + byte z = (byte) 0; + for (int i = 0; i < size; i++) { + v.add(z); + } + + return v; + } + public static unsigned_char_vector priorities2unsigned_char_vector(Priority[] arr) { unsigned_char_vector v = new unsigned_char_vector(); diff --git a/src/main/java/com/frostwire/jlibtorrent/swig/ed25519.java b/src/main/java/com/frostwire/jlibtorrent/swig/ed25519.java deleted file mode 100644 index a1eb75e80..000000000 --- a/src/main/java/com/frostwire/jlibtorrent/swig/ed25519.java +++ /dev/null @@ -1,72 +0,0 @@ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (http://www.swig.org). - * Version 3.0.8 - * - * Do not make changes to this file unless you know what you are doing--modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package com.frostwire.jlibtorrent.swig; - -public class ed25519 { - private transient long swigCPtr; - protected transient boolean swigCMemOwn; - - protected ed25519(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - protected static long getCPtr(ed25519 obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - libtorrent_jni.delete_ed25519(swigCPtr); - } - swigCPtr = 0; - } - } - - public static void create_seed(char_vector seed) { - libtorrent_jni.ed25519_create_seed(char_vector.getCPtr(seed), seed); - } - - public static void create_keypair(char_vector public_key, char_vector private_key, char_vector seed) { - libtorrent_jni.ed25519_create_keypair(char_vector.getCPtr(public_key), public_key, char_vector.getCPtr(private_key), private_key, char_vector.getCPtr(seed), seed); - } - - public static void sign(char_vector signature, char_vector message, char_vector public_key, char_vector private_key) { - libtorrent_jni.ed25519_sign(char_vector.getCPtr(signature), signature, char_vector.getCPtr(message), message, char_vector.getCPtr(public_key), public_key, char_vector.getCPtr(private_key), private_key); - } - - public static int verify(char_vector signature, char_vector message, char_vector private_key) { - return libtorrent_jni.ed25519_verify(char_vector.getCPtr(signature), signature, char_vector.getCPtr(message), message, char_vector.getCPtr(private_key), private_key); - } - - public static void add_scalar(char_vector public_key, char_vector private_key, char_vector scalar) { - libtorrent_jni.ed25519_add_scalar(char_vector.getCPtr(public_key), public_key, char_vector.getCPtr(private_key), private_key, char_vector.getCPtr(scalar), scalar); - } - - public static void key_exchange(char_vector shared_secret, char_vector public_key, char_vector private_key) { - libtorrent_jni.ed25519_key_exchange(char_vector.getCPtr(shared_secret), shared_secret, char_vector.getCPtr(public_key), public_key, char_vector.getCPtr(private_key), private_key); - } - - public ed25519() { - this(libtorrent_jni.new_ed25519(), true); - } - - public final static int seed_size = libtorrent_jni.ed25519_seed_size_get(); - public final static int private_key_size = libtorrent_jni.ed25519_private_key_size_get(); - public final static int public_key_size = libtorrent_jni.ed25519_public_key_size_get(); - public final static int signature_size = libtorrent_jni.ed25519_signature_size_get(); - public final static int scalar_size = libtorrent_jni.ed25519_scalar_size_get(); - public final static int shared_secret_size = libtorrent_jni.ed25519_shared_secret_size_get(); -} diff --git a/src/main/java/com/frostwire/jlibtorrent/swig/libtorrent.java b/src/main/java/com/frostwire/jlibtorrent/swig/libtorrent.java index 10b03671c..b9c731873 100644 --- a/src/main/java/com/frostwire/jlibtorrent/swig/libtorrent.java +++ b/src/main/java/com/frostwire/jlibtorrent/swig/libtorrent.java @@ -193,6 +193,30 @@ public static high_resolution_clock.duration to_hours(long n) { return new high_resolution_clock.duration(libtorrent_jni.to_hours(n), true); } + public static void ed25519_create_seed(byte_vector seed) { + libtorrent_jni.ed25519_create_seed(byte_vector.getCPtr(seed), seed); + } + + public static void ed25519_create_keypair(byte_vector public_key, byte_vector private_key, byte_vector seed) { + libtorrent_jni.ed25519_create_keypair(byte_vector.getCPtr(public_key), public_key, byte_vector.getCPtr(private_key), private_key, byte_vector.getCPtr(seed), seed); + } + + public static void ed25519_sign(byte_vector signature, byte_vector message, byte_vector public_key, byte_vector private_key) { + libtorrent_jni.ed25519_sign(byte_vector.getCPtr(signature), signature, byte_vector.getCPtr(message), message, byte_vector.getCPtr(public_key), public_key, byte_vector.getCPtr(private_key), private_key); + } + + public static int ed25519_verify(byte_vector signature, byte_vector message, byte_vector private_key) { + return libtorrent_jni.ed25519_verify(byte_vector.getCPtr(signature), signature, byte_vector.getCPtr(message), message, byte_vector.getCPtr(private_key), private_key); + } + + public static void ed25519_add_scalar(byte_vector public_key, byte_vector private_key, byte_vector scalar) { + libtorrent_jni.ed25519_add_scalar(byte_vector.getCPtr(public_key), public_key, byte_vector.getCPtr(private_key), private_key, byte_vector.getCPtr(scalar), scalar); + } + + public static void ed25519_key_exchange(byte_vector shared_secret, byte_vector public_key, byte_vector private_key) { + libtorrent_jni.ed25519_key_exchange(byte_vector.getCPtr(shared_secret), shared_secret, byte_vector.getCPtr(public_key), public_key, byte_vector.getCPtr(private_key), private_key); + } + public static boolean add_files_cb(String p, add_files_listener listener) { return libtorrent_jni.add_files_cb(p, add_files_listener.getCPtr(listener), listener); } diff --git a/src/main/java/com/frostwire/jlibtorrent/swig/libtorrentConstants.java b/src/main/java/com/frostwire/jlibtorrent/swig/libtorrentConstants.java index b1eac5807..161ceb424 100644 --- a/src/main/java/com/frostwire/jlibtorrent/swig/libtorrentConstants.java +++ b/src/main/java/com/frostwire/jlibtorrent/swig/libtorrentConstants.java @@ -19,6 +19,13 @@ public interface libtorrentConstants { public final static int num_alert_types = libtorrent_jni.num_alert_types_get(); public final static int TORRENT_ALERT_MANAGER_MAX_ARITY = libtorrent_jni.TORRENT_ALERT_MANAGER_MAX_ARITY_get(); + public final static int ed25519_seed_size = libtorrent_jni.ed25519_seed_size_get(); + public final static int ed25519_private_key_size = libtorrent_jni.ed25519_private_key_size_get(); + public final static int ed25519_public_key_size = libtorrent_jni.ed25519_public_key_size_get(); + public final static int ed25519_signature_size = libtorrent_jni.ed25519_signature_size_get(); + public final static int ed25519_scalar_size = libtorrent_jni.ed25519_scalar_size_get(); + public final static int ed25519_shared_secret_size = libtorrent_jni.ed25519_shared_secret_size_get(); + public final static String LIBTORRENT_REVISION_SHA1 = libtorrent_jni.LIBTORRENT_REVISION_SHA1_get(); public final static String JLIBTORRENT_REVISION_SHA1 = libtorrent_jni.JLIBTORRENT_REVISION_SHA1_get(); } diff --git a/src/main/java/com/frostwire/jlibtorrent/swig/libtorrent_jni.java b/src/main/java/com/frostwire/jlibtorrent/swig/libtorrent_jni.java index 1f8ff7ea6..2121cab35 100644 --- a/src/main/java/com/frostwire/jlibtorrent/swig/libtorrent_jni.java +++ b/src/main/java/com/frostwire/jlibtorrent/swig/libtorrent_jni.java @@ -2972,6 +2972,12 @@ public class libtorrent_jni { public final static native boolean torrent_status_stop_when_ready_get(long jarg1, torrent_status jarg1_); public final static native void torrent_status_info_hash_set(long jarg1, torrent_status jarg1_, long jarg2, sha1_hash jarg2_); public final static native long torrent_status_info_hash_get(long jarg1, torrent_status jarg1_); + public final static native int ed25519_seed_size_get(); + public final static native int ed25519_private_key_size_get(); + public final static native int ed25519_public_key_size_get(); + public final static native int ed25519_signature_size_get(); + public final static native int ed25519_scalar_size_get(); + public final static native int ed25519_shared_secret_size_get(); public final static native long new_address__SWIG_0(); public final static native long new_address__SWIG_1(long jarg1, address_v4 jarg1_); public final static native long new_address__SWIG_2(long jarg1, address_v6 jarg1_); @@ -3050,20 +3056,6 @@ public class libtorrent_jni { public final static native void delete_udp_endpoint(long jarg1); public final static native boolean is_utp_stream_logging(); public final static native void set_utp_stream_logging(boolean jarg1); - public final static native int ed25519_seed_size_get(); - public final static native int ed25519_private_key_size_get(); - public final static native int ed25519_public_key_size_get(); - public final static native int ed25519_signature_size_get(); - public final static native int ed25519_scalar_size_get(); - public final static native int ed25519_shared_secret_size_get(); - public final static native void ed25519_create_seed(long jarg1, char_vector jarg1_); - public final static native void ed25519_create_keypair(long jarg1, char_vector jarg1_, long jarg2, char_vector jarg2_, long jarg3, char_vector jarg3_); - public final static native void ed25519_sign(long jarg1, char_vector jarg1_, long jarg2, char_vector jarg2_, long jarg3, char_vector jarg3_, long jarg4, char_vector jarg4_); - public final static native int ed25519_verify(long jarg1, char_vector jarg1_, long jarg2, char_vector jarg2_, long jarg3, char_vector jarg3_); - public final static native void ed25519_add_scalar(long jarg1, char_vector jarg1_, long jarg2, char_vector jarg2_, long jarg3, char_vector jarg3_); - public final static native void ed25519_key_exchange(long jarg1, char_vector jarg1_, long jarg2, char_vector jarg2_, long jarg3, char_vector jarg3_); - public final static native long new_ed25519(); - public final static native void delete_ed25519(long jarg1); public final static native int dht_item_canonical_string(long jarg1, char_vector jarg1_, int jarg2, String jarg3, long jarg4, char_vector jarg4_); public final static native long dht_item_item_target_id__SWIG_0(long jarg1, char_vector jarg1_); public final static native long dht_item_item_target_id__SWIG_1(long jarg1, char_vector jarg1_, long jarg2, char_vector jarg2_); @@ -3078,6 +3070,12 @@ public class libtorrent_jni { public final static native long to_microseconds(long jarg1); public final static native long to_minutes(long jarg1); public final static native long to_hours(long jarg1); + public final static native void ed25519_create_seed(long jarg1, byte_vector jarg1_); + public final static native void ed25519_create_keypair(long jarg1, byte_vector jarg1_, long jarg2, byte_vector jarg2_, long jarg3, byte_vector jarg3_); + public final static native void ed25519_sign(long jarg1, byte_vector jarg1_, long jarg2, byte_vector jarg2_, long jarg3, byte_vector jarg3_, long jarg4, byte_vector jarg4_); + public final static native int ed25519_verify(long jarg1, byte_vector jarg1_, long jarg2, byte_vector jarg2_, long jarg3, byte_vector jarg3_); + public final static native void ed25519_add_scalar(long jarg1, byte_vector jarg1_, long jarg2, byte_vector jarg2_, long jarg3, byte_vector jarg3_); + public final static native void ed25519_key_exchange(long jarg1, byte_vector jarg1_, long jarg2, byte_vector jarg2_, long jarg3, byte_vector jarg3_); public final static native void delete_add_files_listener(long jarg1); public final static native boolean add_files_listener_pred(long jarg1, add_files_listener jarg1_, String jarg2); public final static native boolean add_files_listener_predSwigExplicitadd_files_listener(long jarg1, add_files_listener jarg1_, String jarg2); diff --git a/swig/libtorrent.h b/swig/libtorrent.h index 068cfcc93..547e73696 100644 --- a/swig/libtorrent.h +++ b/swig/libtorrent.h @@ -43,6 +43,54 @@ boost::chrono::high_resolution_clock::duration to_hours(long long n) { return boost::chrono::hours(n); } +void ed25519_create_seed(std::vector& seed) { + ed25519_create_seed((unsigned char*)seed.data()); +} + +void ed25519_create_keypair(std::vector& public_key, + std::vector& private_key, + std::vector& seed) { + ed25519_create_keypair((unsigned char*)public_key.data(), + (unsigned char*)private_key.data(), + (unsigned char*)seed.data()); +} + +void ed25519_sign(std::vector& signature, + std::vector& message, + std::vector& public_key, + std::vector& private_key) { + ed25519_sign((unsigned char*)signature.data(), + (unsigned char*)message.data(), + message.size(), + (unsigned char*)public_key.data(), + (unsigned char*)private_key.data()); +} + +int ed25519_verify(std::vector& signature, + std::vector& message, + std::vector& private_key) { + return ed25519_verify((unsigned char*)signature.data(), + (unsigned char*)message.data(), + message.size(), + (unsigned char*)private_key.data()); +} + +void ed25519_add_scalar(std::vector& public_key, + std::vector& private_key, + std::vector& scalar) { + ed25519_add_scalar((unsigned char*)public_key.data(), + (unsigned char*)private_key.data(), + (unsigned char*)scalar.data()); +} + +void ed25519_key_exchange(std::vector& shared_secret, + std::vector& public_key, + std::vector& private_key) { + ed25519_key_exchange((unsigned char*)shared_secret.data(), + (unsigned char*)public_key.data(), + (unsigned char*)private_key.data()); +} + class add_files_listener { public: virtual ~add_files_listener() { diff --git a/swig/libtorrent.i b/swig/libtorrent.i index 131e2ba6b..b55213886 100644 --- a/swig/libtorrent.i +++ b/swig/libtorrent.i @@ -74,6 +74,7 @@ #include "libtorrent/create_torrent.hpp" #include "libtorrent/announce_entry.hpp" #include "libtorrent/torrent_status.hpp" +#include "libtorrent/ed25519.hpp" #include "libtorrent/extensions/ut_pex.hpp" #include "libtorrent/extensions/ut_metadata.hpp" @@ -81,8 +82,7 @@ #include "libtorrent/extensions/smart_ban.hpp" #include "libtorrent/kademlia/item.hpp" -#include "libtorrent/ed25519.hpp" - + // additional includes using namespace boost; @@ -90,65 +90,6 @@ using namespace boost::system; using namespace libtorrent; -class ed25519 { -public: - - static const int seed_size = ed25519_seed_size; - static const int private_key_size = ed25519_private_key_size; - static const int public_key_size = ed25519_public_key_size; - static const int signature_size = ed25519_signature_size; - static const int scalar_size = ed25519_scalar_size; - static const int shared_secret_size = ed25519_shared_secret_size; - - static void create_seed(std::vector& seed) { - ed25519_create_seed((unsigned char*)seed.data()); - } - - static void create_keypair(std::vector& public_key, - std::vector& private_key, - std::vector& seed) { - ed25519_create_keypair((unsigned char*)public_key.data(), - (unsigned char*)private_key.data(), - (unsigned char*)seed.data()); - } - - static void sign(std::vector& signature, - std::vector& message, - std::vector& public_key, - std::vector& private_key) { - ed25519_sign((unsigned char*)signature.data(), - (unsigned char*)message.data(), - message.size(), - (unsigned char*)public_key.data(), - (unsigned char*)private_key.data()); - } - - static int verify(std::vector& signature, - std::vector& message, - std::vector& private_key) { - return ed25519_verify((unsigned char*)signature.data(), - (unsigned char*)message.data(), - message.size(), - (unsigned char*)private_key.data()); - } - - static void add_scalar(std::vector& public_key, - std::vector& private_key, - std::vector& scalar) { - ed25519_add_scalar((unsigned char*)public_key.data(), - (unsigned char*)private_key.data(), - (unsigned char*)scalar.data()); - } - - static void key_exchange(std::vector& shared_secret, - std::vector& public_key, - std::vector& private_key) { - ed25519_key_exchange((unsigned char*)shared_secret.data(), - (unsigned char*)public_key.data(), - (unsigned char*)private_key.data()); - } -}; - namespace libtorrent { namespace dht { // code copied from item.cpp @@ -640,6 +581,14 @@ namespace std { %ignore boost::asio::error::get_misc_category; %ignore boost::asio::detail::posix_tss_ptr_create; +%ignore ed25519_create_seed(unsigned char *); +%ignore ed25519_create_keypair(unsigned char *, unsigned char *, const unsigned char *); +%ignore ed25519_sign(unsigned char *, const unsigned char *, size_t , const unsigned char *, const unsigned char *); +%ignore ed25519_verify(const unsigned char *, const unsigned char *, size_t , const unsigned char *); +%ignore ed25519_add_scalar(unsigned char *, unsigned char *, const unsigned char *); +%ignore ed25519_key_exchange(unsigned char *, const unsigned char *, const unsigned char *); + + %ignore operator=; %ignore operator!; %ignore operator<=; @@ -725,6 +674,7 @@ namespace std { %include "libtorrent/create_torrent.hpp" %include "libtorrent/announce_entry.hpp" %include "libtorrent/torrent_status.hpp" +%include "libtorrent/ed25519.hpp" namespace boost { @@ -1148,40 +1098,6 @@ void set_utp_stream_logging(bool enable); } -class ed25519 { -public: - - static const int seed_size = ed25519_seed_size; - static const int private_key_size = ed25519_private_key_size; - static const int public_key_size = ed25519_public_key_size; - static const int signature_size = ed25519_signature_size; - static const int scalar_size = ed25519_scalar_size; - static const int shared_secret_size = ed25519_shared_secret_size; - - static void create_seed(std::vector& seed); - - static void create_keypair(std::vector& public_key, - std::vector& private_key, - std::vector& seed); - - static void sign(std::vector& signature, - std::vector& message, - std::vector& public_key, - std::vector& private_key); - - static int verify(std::vector& signature, - std::vector& message, - std::vector& private_key); - - static void add_scalar(std::vector& public_key, - std::vector& private_key, - std::vector& scalar); - - static void key_exchange(std::vector& shared_secret, - std::vector& public_key, - std::vector& private_key); -}; - class dht_item { public: diff --git a/swig/libtorrent_jni.cpp b/swig/libtorrent_jni.cpp index 21f810925..4389801fa 100644 --- a/swig/libtorrent_jni.cpp +++ b/swig/libtorrent_jni.cpp @@ -736,6 +736,7 @@ namespace Swig { #include "libtorrent/create_torrent.hpp" #include "libtorrent/announce_entry.hpp" #include "libtorrent/torrent_status.hpp" +#include "libtorrent/ed25519.hpp" #include "libtorrent/extensions/ut_pex.hpp" #include "libtorrent/extensions/ut_metadata.hpp" @@ -743,8 +744,7 @@ namespace Swig { #include "libtorrent/extensions/smart_ban.hpp" #include "libtorrent/kademlia/item.hpp" -#include "libtorrent/ed25519.hpp" - + // additional includes using namespace boost; @@ -752,65 +752,6 @@ using namespace boost::system; using namespace libtorrent; -class ed25519 { -public: - - static const int seed_size = ed25519_seed_size; - static const int private_key_size = ed25519_private_key_size; - static const int public_key_size = ed25519_public_key_size; - static const int signature_size = ed25519_signature_size; - static const int scalar_size = ed25519_scalar_size; - static const int shared_secret_size = ed25519_shared_secret_size; - - static void create_seed(std::vector& seed) { - ed25519_create_seed((unsigned char*)seed.data()); - } - - static void create_keypair(std::vector& public_key, - std::vector& private_key, - std::vector& seed) { - ed25519_create_keypair((unsigned char*)public_key.data(), - (unsigned char*)private_key.data(), - (unsigned char*)seed.data()); - } - - static void sign(std::vector& signature, - std::vector& message, - std::vector& public_key, - std::vector& private_key) { - ed25519_sign((unsigned char*)signature.data(), - (unsigned char*)message.data(), - message.size(), - (unsigned char*)public_key.data(), - (unsigned char*)private_key.data()); - } - - static int verify(std::vector& signature, - std::vector& message, - std::vector& private_key) { - return ed25519_verify((unsigned char*)signature.data(), - (unsigned char*)message.data(), - message.size(), - (unsigned char*)private_key.data()); - } - - static void add_scalar(std::vector& public_key, - std::vector& private_key, - std::vector& scalar) { - ed25519_add_scalar((unsigned char*)public_key.data(), - (unsigned char*)private_key.data(), - (unsigned char*)scalar.data()); - } - - static void key_exchange(std::vector& shared_secret, - std::vector& public_key, - std::vector& private_key) { - ed25519_key_exchange((unsigned char*)shared_secret.data(), - (unsigned char*)public_key.data(), - (unsigned char*)private_key.data()); - } -}; - namespace libtorrent { namespace dht { // code copied from item.cpp @@ -61726,6 +61667,126 @@ SWIGEXPORT jlong JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_tor } +SWIGEXPORT jint JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_ed25519_1seed_1size_1get(JNIEnv *jenv, jclass jcls) { + jint jresult = 0 ; + int result; + + (void)jenv; + (void)jcls; + { + try { + result = (int)ed25519_seed_size; + } catch (std::exception& e) { + SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, e.what()); + } catch (...) { + SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "Unknown exception type"); + } + } + jresult = (jint)result; + return jresult; +} + + +SWIGEXPORT jint JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_ed25519_1private_1key_1size_1get(JNIEnv *jenv, jclass jcls) { + jint jresult = 0 ; + int result; + + (void)jenv; + (void)jcls; + { + try { + result = (int)ed25519_private_key_size; + } catch (std::exception& e) { + SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, e.what()); + } catch (...) { + SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "Unknown exception type"); + } + } + jresult = (jint)result; + return jresult; +} + + +SWIGEXPORT jint JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_ed25519_1public_1key_1size_1get(JNIEnv *jenv, jclass jcls) { + jint jresult = 0 ; + int result; + + (void)jenv; + (void)jcls; + { + try { + result = (int)ed25519_public_key_size; + } catch (std::exception& e) { + SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, e.what()); + } catch (...) { + SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "Unknown exception type"); + } + } + jresult = (jint)result; + return jresult; +} + + +SWIGEXPORT jint JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_ed25519_1signature_1size_1get(JNIEnv *jenv, jclass jcls) { + jint jresult = 0 ; + int result; + + (void)jenv; + (void)jcls; + { + try { + result = (int)ed25519_signature_size; + } catch (std::exception& e) { + SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, e.what()); + } catch (...) { + SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "Unknown exception type"); + } + } + jresult = (jint)result; + return jresult; +} + + +SWIGEXPORT jint JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_ed25519_1scalar_1size_1get(JNIEnv *jenv, jclass jcls) { + jint jresult = 0 ; + int result; + + (void)jenv; + (void)jcls; + { + try { + result = (int)ed25519_scalar_size; + } catch (std::exception& e) { + SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, e.what()); + } catch (...) { + SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "Unknown exception type"); + } + } + jresult = (jint)result; + return jresult; +} + + +SWIGEXPORT jint JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_ed25519_1shared_1secret_1size_1get(JNIEnv *jenv, jclass jcls) { + jint jresult = 0 ; + int result; + + (void)jenv; + (void)jcls; + { + try { + result = (int)ed25519_shared_secret_size; + } catch (std::exception& e) { + SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, e.what()); + } catch (...) { + SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "Unknown exception type"); + } + } + jresult = (jint)result; + return jresult; +} + + SWIGEXPORT jlong JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_new_1address_1_1SWIG_10(JNIEnv *jenv, jclass jcls) { jlong jresult = 0 ; boost::asio::ip::address *result = 0 ; @@ -63583,335 +63644,6 @@ SWIGEXPORT void JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_set_ } -SWIGEXPORT jint JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_ed25519_1seed_1size_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - int result; - - (void)jenv; - (void)jcls; - result = (int)ed25519::seed_size; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_ed25519_1private_1key_1size_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - int result; - - (void)jenv; - (void)jcls; - result = (int)ed25519::private_key_size; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_ed25519_1public_1key_1size_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - int result; - - (void)jenv; - (void)jcls; - result = (int)ed25519::public_key_size; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_ed25519_1signature_1size_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - int result; - - (void)jenv; - (void)jcls; - result = (int)ed25519::signature_size; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_ed25519_1scalar_1size_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - int result; - - (void)jenv; - (void)jcls; - result = (int)ed25519::scalar_size; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_ed25519_1shared_1secret_1size_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - int result; - - (void)jenv; - (void)jcls; - result = (int)ed25519::shared_secret_size; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_ed25519_1create_1seed(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - std::vector< char > *arg1 = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(std::vector< char > **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "std::vector< char > & reference is null"); - return ; - } - { - try { - ed25519::create_seed(*arg1); - } catch (std::exception& e) { - SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, e.what()); - } catch (...) { - SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "Unknown exception type"); - } - } -} - - -SWIGEXPORT void JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_ed25519_1create_1keypair(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3, jobject jarg3_) { - std::vector< char > *arg1 = 0 ; - std::vector< char > *arg2 = 0 ; - std::vector< char > *arg3 = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - (void)jarg3_; - arg1 = *(std::vector< char > **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "std::vector< char > & reference is null"); - return ; - } - arg2 = *(std::vector< char > **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "std::vector< char > & reference is null"); - return ; - } - arg3 = *(std::vector< char > **)&jarg3; - if (!arg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "std::vector< char > & reference is null"); - return ; - } - { - try { - ed25519::create_keypair(*arg1,*arg2,*arg3); - } catch (std::exception& e) { - SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, e.what()); - } catch (...) { - SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "Unknown exception type"); - } - } -} - - -SWIGEXPORT void JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_ed25519_1sign(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3, jobject jarg3_, jlong jarg4, jobject jarg4_) { - std::vector< char > *arg1 = 0 ; - std::vector< char > *arg2 = 0 ; - std::vector< char > *arg3 = 0 ; - std::vector< char > *arg4 = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - (void)jarg3_; - (void)jarg4_; - arg1 = *(std::vector< char > **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "std::vector< char > & reference is null"); - return ; - } - arg2 = *(std::vector< char > **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "std::vector< char > & reference is null"); - return ; - } - arg3 = *(std::vector< char > **)&jarg3; - if (!arg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "std::vector< char > & reference is null"); - return ; - } - arg4 = *(std::vector< char > **)&jarg4; - if (!arg4) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "std::vector< char > & reference is null"); - return ; - } - { - try { - ed25519::sign(*arg1,*arg2,*arg3,*arg4); - } catch (std::exception& e) { - SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, e.what()); - } catch (...) { - SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "Unknown exception type"); - } - } -} - - -SWIGEXPORT jint JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_ed25519_1verify(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3, jobject jarg3_) { - jint jresult = 0 ; - std::vector< char > *arg1 = 0 ; - std::vector< char > *arg2 = 0 ; - std::vector< char > *arg3 = 0 ; - int result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - (void)jarg3_; - arg1 = *(std::vector< char > **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "std::vector< char > & reference is null"); - return 0; - } - arg2 = *(std::vector< char > **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "std::vector< char > & reference is null"); - return 0; - } - arg3 = *(std::vector< char > **)&jarg3; - if (!arg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "std::vector< char > & reference is null"); - return 0; - } - { - try { - result = (int)ed25519::verify(*arg1,*arg2,*arg3); - } catch (std::exception& e) { - SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, e.what()); - } catch (...) { - SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "Unknown exception type"); - } - } - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_ed25519_1add_1scalar(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3, jobject jarg3_) { - std::vector< char > *arg1 = 0 ; - std::vector< char > *arg2 = 0 ; - std::vector< char > *arg3 = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - (void)jarg3_; - arg1 = *(std::vector< char > **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "std::vector< char > & reference is null"); - return ; - } - arg2 = *(std::vector< char > **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "std::vector< char > & reference is null"); - return ; - } - arg3 = *(std::vector< char > **)&jarg3; - if (!arg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "std::vector< char > & reference is null"); - return ; - } - { - try { - ed25519::add_scalar(*arg1,*arg2,*arg3); - } catch (std::exception& e) { - SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, e.what()); - } catch (...) { - SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "Unknown exception type"); - } - } -} - - -SWIGEXPORT void JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_ed25519_1key_1exchange(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3, jobject jarg3_) { - std::vector< char > *arg1 = 0 ; - std::vector< char > *arg2 = 0 ; - std::vector< char > *arg3 = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - (void)jarg3_; - arg1 = *(std::vector< char > **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "std::vector< char > & reference is null"); - return ; - } - arg2 = *(std::vector< char > **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "std::vector< char > & reference is null"); - return ; - } - arg3 = *(std::vector< char > **)&jarg3; - if (!arg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "std::vector< char > & reference is null"); - return ; - } - { - try { - ed25519::key_exchange(*arg1,*arg2,*arg3); - } catch (std::exception& e) { - SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, e.what()); - } catch (...) { - SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "Unknown exception type"); - } - } -} - - -SWIGEXPORT jlong JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_new_1ed25519(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - ed25519 *result = 0 ; - - (void)jenv; - (void)jcls; - { - try { - result = (ed25519 *)new ed25519(); - } catch (std::exception& e) { - SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, e.what()); - } catch (...) { - SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "Unknown exception type"); - } - } - *(ed25519 **)&jresult = result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_delete_1ed25519(JNIEnv *jenv, jclass jcls, jlong jarg1) { - ed25519 *arg1 = (ed25519 *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(ed25519 **)&jarg1; - { - try { - delete arg1; - } catch (std::exception& e) { - SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, e.what()); - } catch (...) { - SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "Unknown exception type"); - } - } -} - - SWIGEXPORT jint JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_dht_1item_1canonical_1string(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2, jstring jarg3, jlong jarg4, jobject jarg4_) { jint jresult = 0 ; std::vector< char > *arg1 = 0 ; @@ -64184,7 +63916,7 @@ SWIGEXPORT jstring JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_J (void)jenv; (void)jcls; - result = (char *)("229199f40e691a532435d2ae7936da4fd6b4bb69"); + result = (char *)("21fdcd5374f98fec45e5697fc70af14fa57dec4e"); if (result) jresult = jenv->NewStringUTF((const char *)result); return jresult; } @@ -64300,6 +64032,225 @@ SWIGEXPORT jlong JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_to_ } +SWIGEXPORT void JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_ed25519_1create_1seed(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { + std::vector< int8_t > *arg1 = 0 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(std::vector< int8_t > **)&jarg1; + if (!arg1) { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "std::vector< int8_t > & reference is null"); + return ; + } + { + try { + ed25519_create_seed(*arg1); + } catch (std::exception& e) { + SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, e.what()); + } catch (...) { + SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "Unknown exception type"); + } + } +} + + +SWIGEXPORT void JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_ed25519_1create_1keypair(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3, jobject jarg3_) { + std::vector< int8_t > *arg1 = 0 ; + std::vector< int8_t > *arg2 = 0 ; + std::vector< int8_t > *arg3 = 0 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + (void)jarg2_; + (void)jarg3_; + arg1 = *(std::vector< int8_t > **)&jarg1; + if (!arg1) { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "std::vector< int8_t > & reference is null"); + return ; + } + arg2 = *(std::vector< int8_t > **)&jarg2; + if (!arg2) { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "std::vector< int8_t > & reference is null"); + return ; + } + arg3 = *(std::vector< int8_t > **)&jarg3; + if (!arg3) { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "std::vector< int8_t > & reference is null"); + return ; + } + { + try { + ed25519_create_keypair(*arg1,*arg2,*arg3); + } catch (std::exception& e) { + SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, e.what()); + } catch (...) { + SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "Unknown exception type"); + } + } +} + + +SWIGEXPORT void JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_ed25519_1sign(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3, jobject jarg3_, jlong jarg4, jobject jarg4_) { + std::vector< int8_t > *arg1 = 0 ; + std::vector< int8_t > *arg2 = 0 ; + std::vector< int8_t > *arg3 = 0 ; + std::vector< int8_t > *arg4 = 0 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + (void)jarg2_; + (void)jarg3_; + (void)jarg4_; + arg1 = *(std::vector< int8_t > **)&jarg1; + if (!arg1) { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "std::vector< int8_t > & reference is null"); + return ; + } + arg2 = *(std::vector< int8_t > **)&jarg2; + if (!arg2) { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "std::vector< int8_t > & reference is null"); + return ; + } + arg3 = *(std::vector< int8_t > **)&jarg3; + if (!arg3) { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "std::vector< int8_t > & reference is null"); + return ; + } + arg4 = *(std::vector< int8_t > **)&jarg4; + if (!arg4) { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "std::vector< int8_t > & reference is null"); + return ; + } + { + try { + ed25519_sign(*arg1,*arg2,*arg3,*arg4); + } catch (std::exception& e) { + SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, e.what()); + } catch (...) { + SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "Unknown exception type"); + } + } +} + + +SWIGEXPORT jint JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_ed25519_1verify(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3, jobject jarg3_) { + jint jresult = 0 ; + std::vector< int8_t > *arg1 = 0 ; + std::vector< int8_t > *arg2 = 0 ; + std::vector< int8_t > *arg3 = 0 ; + int result; + + (void)jenv; + (void)jcls; + (void)jarg1_; + (void)jarg2_; + (void)jarg3_; + arg1 = *(std::vector< int8_t > **)&jarg1; + if (!arg1) { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "std::vector< int8_t > & reference is null"); + return 0; + } + arg2 = *(std::vector< int8_t > **)&jarg2; + if (!arg2) { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "std::vector< int8_t > & reference is null"); + return 0; + } + arg3 = *(std::vector< int8_t > **)&jarg3; + if (!arg3) { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "std::vector< int8_t > & reference is null"); + return 0; + } + { + try { + result = (int)ed25519_verify(*arg1,*arg2,*arg3); + } catch (std::exception& e) { + SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, e.what()); + } catch (...) { + SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "Unknown exception type"); + } + } + jresult = (jint)result; + return jresult; +} + + +SWIGEXPORT void JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_ed25519_1add_1scalar(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3, jobject jarg3_) { + std::vector< int8_t > *arg1 = 0 ; + std::vector< int8_t > *arg2 = 0 ; + std::vector< int8_t > *arg3 = 0 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + (void)jarg2_; + (void)jarg3_; + arg1 = *(std::vector< int8_t > **)&jarg1; + if (!arg1) { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "std::vector< int8_t > & reference is null"); + return ; + } + arg2 = *(std::vector< int8_t > **)&jarg2; + if (!arg2) { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "std::vector< int8_t > & reference is null"); + return ; + } + arg3 = *(std::vector< int8_t > **)&jarg3; + if (!arg3) { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "std::vector< int8_t > & reference is null"); + return ; + } + { + try { + ed25519_add_scalar(*arg1,*arg2,*arg3); + } catch (std::exception& e) { + SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, e.what()); + } catch (...) { + SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "Unknown exception type"); + } + } +} + + +SWIGEXPORT void JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_ed25519_1key_1exchange(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3, jobject jarg3_) { + std::vector< int8_t > *arg1 = 0 ; + std::vector< int8_t > *arg2 = 0 ; + std::vector< int8_t > *arg3 = 0 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + (void)jarg2_; + (void)jarg3_; + arg1 = *(std::vector< int8_t > **)&jarg1; + if (!arg1) { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "std::vector< int8_t > & reference is null"); + return ; + } + arg2 = *(std::vector< int8_t > **)&jarg2; + if (!arg2) { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "std::vector< int8_t > & reference is null"); + return ; + } + arg3 = *(std::vector< int8_t > **)&jarg3; + if (!arg3) { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "std::vector< int8_t > & reference is null"); + return ; + } + { + try { + ed25519_key_exchange(*arg1,*arg2,*arg3); + } catch (std::exception& e) { + SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, e.what()); + } catch (...) { + SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "Unknown exception type"); + } + } +} + + SWIGEXPORT void JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_delete_1add_1files_1listener(JNIEnv *jenv, jclass jcls, jlong jarg1) { add_files_listener *arg1 = (add_files_listener *) 0 ; diff --git a/swig/libtorrent_node.cpp b/swig/libtorrent_node.cpp index bec285d58..b128287a5 100644 --- a/swig/libtorrent_node.cpp +++ b/swig/libtorrent_node.cpp @@ -1496,221 +1496,220 @@ SWIGRUNTIME void JS_veto_set_variable(v8::Local property, v8::Local< #define SWIGTYPE_p_dht_item swig_types[15] #define SWIGTYPE_p_dictionary_type swig_types[16] #define SWIGTYPE_p_difference_type swig_types[17] -#define SWIGTYPE_p_ed25519 swig_types[18] -#define SWIGTYPE_p_filter_tuple_t swig_types[19] -#define SWIGTYPE_p_headers_t swig_types[20] -#define SWIGTYPE_p_int swig_types[21] -#define SWIGTYPE_p_integer_type swig_types[22] -#define SWIGTYPE_p_key_type swig_types[23] -#define SWIGTYPE_p_libtorrent__add_torrent_alert swig_types[24] -#define SWIGTYPE_p_libtorrent__add_torrent_params swig_types[25] -#define SWIGTYPE_p_libtorrent__alert swig_types[26] -#define SWIGTYPE_p_libtorrent__announce_entry swig_types[27] -#define SWIGTYPE_p_libtorrent__anonymous_mode_alert swig_types[28] -#define SWIGTYPE_p_libtorrent__aux__session_settings swig_types[29] -#define SWIGTYPE_p_libtorrent__bdecode_node swig_types[30] -#define SWIGTYPE_p_libtorrent__bitfield swig_types[31] -#define SWIGTYPE_p_libtorrent__block_downloading_alert swig_types[32] -#define SWIGTYPE_p_libtorrent__block_finished_alert swig_types[33] -#define SWIGTYPE_p_libtorrent__block_info swig_types[34] -#define SWIGTYPE_p_libtorrent__block_timeout_alert swig_types[35] -#define SWIGTYPE_p_libtorrent__bt_peer_connection_handle swig_types[36] -#define SWIGTYPE_p_libtorrent__cache_flushed_alert swig_types[37] -#define SWIGTYPE_p_libtorrent__counters swig_types[38] -#define SWIGTYPE_p_libtorrent__create_torrent swig_types[39] -#define SWIGTYPE_p_libtorrent__default_storage swig_types[40] -#define SWIGTYPE_p_libtorrent__detail__bdecode_token swig_types[41] -#define SWIGTYPE_p_libtorrent__dht_announce_alert swig_types[42] -#define SWIGTYPE_p_libtorrent__dht_bootstrap_alert swig_types[43] -#define SWIGTYPE_p_libtorrent__dht_direct_response_alert swig_types[44] -#define SWIGTYPE_p_libtorrent__dht_error_alert swig_types[45] -#define SWIGTYPE_p_libtorrent__dht_get_peers_alert swig_types[46] -#define SWIGTYPE_p_libtorrent__dht_get_peers_reply_alert swig_types[47] -#define SWIGTYPE_p_libtorrent__dht_immutable_item_alert swig_types[48] -#define SWIGTYPE_p_libtorrent__dht_log_alert swig_types[49] -#define SWIGTYPE_p_libtorrent__dht_lookup swig_types[50] -#define SWIGTYPE_p_libtorrent__dht_mutable_item_alert swig_types[51] -#define SWIGTYPE_p_libtorrent__dht_outgoing_get_peers_alert swig_types[52] -#define SWIGTYPE_p_libtorrent__dht_pkt_alert swig_types[53] -#define SWIGTYPE_p_libtorrent__dht_put_alert swig_types[54] -#define SWIGTYPE_p_libtorrent__dht_reply_alert swig_types[55] -#define SWIGTYPE_p_libtorrent__dht_routing_bucket swig_types[56] -#define SWIGTYPE_p_libtorrent__dht_settings swig_types[57] -#define SWIGTYPE_p_libtorrent__dht_stats_alert swig_types[58] -#define SWIGTYPE_p_libtorrent__disabled_storage swig_types[59] -#define SWIGTYPE_p_libtorrent__disk_buffer_holder swig_types[60] -#define SWIGTYPE_p_libtorrent__disk_job_fence swig_types[61] -#define SWIGTYPE_p_libtorrent__entry swig_types[62] -#define SWIGTYPE_p_libtorrent__external_ip_alert swig_types[63] -#define SWIGTYPE_p_libtorrent__fastresume_rejected_alert swig_types[64] -#define SWIGTYPE_p_libtorrent__file_completed_alert swig_types[65] -#define SWIGTYPE_p_libtorrent__file_error_alert swig_types[66] -#define SWIGTYPE_p_libtorrent__file_rename_failed_alert swig_types[67] -#define SWIGTYPE_p_libtorrent__file_renamed_alert swig_types[68] -#define SWIGTYPE_p_libtorrent__file_slice swig_types[69] -#define SWIGTYPE_p_libtorrent__file_storage swig_types[70] -#define SWIGTYPE_p_libtorrent__fingerprint swig_types[71] -#define SWIGTYPE_p_libtorrent__hash_failed_alert swig_types[72] -#define SWIGTYPE_p_libtorrent__i2p_alert swig_types[73] -#define SWIGTYPE_p_libtorrent__incoming_connection_alert swig_types[74] -#define SWIGTYPE_p_libtorrent__incoming_request_alert swig_types[75] -#define SWIGTYPE_p_libtorrent__invalid_request_alert swig_types[76] -#define SWIGTYPE_p_libtorrent__ip_filter swig_types[77] -#define SWIGTYPE_p_libtorrent__listen_failed_alert swig_types[78] -#define SWIGTYPE_p_libtorrent__listen_succeeded_alert swig_types[79] -#define SWIGTYPE_p_libtorrent__log_alert swig_types[80] -#define SWIGTYPE_p_libtorrent__lsd_error_alert swig_types[81] -#define SWIGTYPE_p_libtorrent__lsd_peer_alert swig_types[82] -#define SWIGTYPE_p_libtorrent__metadata_failed_alert swig_types[83] -#define SWIGTYPE_p_libtorrent__metadata_received_alert swig_types[84] -#define SWIGTYPE_p_libtorrent__mmap_cache_alert swig_types[85] -#define SWIGTYPE_p_libtorrent__partial_piece_info swig_types[86] -#define SWIGTYPE_p_libtorrent__peer_alert swig_types[87] -#define SWIGTYPE_p_libtorrent__peer_ban_alert swig_types[88] -#define SWIGTYPE_p_libtorrent__peer_blocked_alert swig_types[89] -#define SWIGTYPE_p_libtorrent__peer_class swig_types[90] -#define SWIGTYPE_p_libtorrent__peer_class_info swig_types[91] -#define SWIGTYPE_p_libtorrent__peer_class_pool swig_types[92] -#define SWIGTYPE_p_libtorrent__peer_class_type_filter swig_types[93] -#define SWIGTYPE_p_libtorrent__peer_connect_alert swig_types[94] -#define SWIGTYPE_p_libtorrent__peer_connection_handle swig_types[95] -#define SWIGTYPE_p_libtorrent__peer_disconnected_alert swig_types[96] -#define SWIGTYPE_p_libtorrent__peer_error_alert swig_types[97] -#define SWIGTYPE_p_libtorrent__peer_info swig_types[98] -#define SWIGTYPE_p_libtorrent__peer_list_entry swig_types[99] -#define SWIGTYPE_p_libtorrent__peer_log_alert swig_types[100] -#define SWIGTYPE_p_libtorrent__peer_plugin swig_types[101] -#define SWIGTYPE_p_libtorrent__peer_request swig_types[102] -#define SWIGTYPE_p_libtorrent__peer_snubbed_alert swig_types[103] -#define SWIGTYPE_p_libtorrent__peer_unsnubbed_alert swig_types[104] -#define SWIGTYPE_p_libtorrent__performance_alert swig_types[105] -#define SWIGTYPE_p_libtorrent__picker_log_alert swig_types[106] -#define SWIGTYPE_p_libtorrent__piece_finished_alert swig_types[107] -#define SWIGTYPE_p_libtorrent__piece_manager swig_types[108] -#define SWIGTYPE_p_libtorrent__pool_file_status swig_types[109] -#define SWIGTYPE_p_libtorrent__port_filter swig_types[110] -#define SWIGTYPE_p_libtorrent__portmap_alert swig_types[111] -#define SWIGTYPE_p_libtorrent__portmap_error_alert swig_types[112] -#define SWIGTYPE_p_libtorrent__portmap_log_alert swig_types[113] -#define SWIGTYPE_p_libtorrent__read_piece_alert swig_types[114] -#define SWIGTYPE_p_libtorrent__request_dropped_alert swig_types[115] -#define SWIGTYPE_p_libtorrent__save_resume_data_alert swig_types[116] -#define SWIGTYPE_p_libtorrent__save_resume_data_failed_alert swig_types[117] -#define SWIGTYPE_p_libtorrent__scrape_failed_alert swig_types[118] -#define SWIGTYPE_p_libtorrent__scrape_reply_alert swig_types[119] -#define SWIGTYPE_p_libtorrent__session swig_types[120] -#define SWIGTYPE_p_libtorrent__session_handle swig_types[121] -#define SWIGTYPE_p_libtorrent__session_proxy swig_types[122] -#define SWIGTYPE_p_libtorrent__session_stats_alert swig_types[123] -#define SWIGTYPE_p_libtorrent__settings_pack swig_types[124] -#define SWIGTYPE_p_libtorrent__sha1_hash swig_types[125] -#define SWIGTYPE_p_libtorrent__stat swig_types[126] -#define SWIGTYPE_p_libtorrent__stat_channel swig_types[127] -#define SWIGTYPE_p_libtorrent__state_changed_alert swig_types[128] -#define SWIGTYPE_p_libtorrent__state_update_alert swig_types[129] -#define SWIGTYPE_p_libtorrent__stats_alert swig_types[130] -#define SWIGTYPE_p_libtorrent__stats_metric swig_types[131] -#define SWIGTYPE_p_libtorrent__storage_error swig_types[132] -#define SWIGTYPE_p_libtorrent__storage_interface swig_types[133] -#define SWIGTYPE_p_libtorrent__storage_moved_alert swig_types[134] -#define SWIGTYPE_p_libtorrent__storage_moved_failed_alert swig_types[135] -#define SWIGTYPE_p_libtorrent__storage_params swig_types[136] -#define SWIGTYPE_p_libtorrent__storage_piece_set swig_types[137] -#define SWIGTYPE_p_libtorrent__torrent_added_alert swig_types[138] -#define SWIGTYPE_p_libtorrent__torrent_alert swig_types[139] -#define SWIGTYPE_p_libtorrent__torrent_checked_alert swig_types[140] -#define SWIGTYPE_p_libtorrent__torrent_delete_failed_alert swig_types[141] -#define SWIGTYPE_p_libtorrent__torrent_deleted_alert swig_types[142] -#define SWIGTYPE_p_libtorrent__torrent_error_alert swig_types[143] -#define SWIGTYPE_p_libtorrent__torrent_finished_alert swig_types[144] -#define SWIGTYPE_p_libtorrent__torrent_handle swig_types[145] -#define SWIGTYPE_p_libtorrent__torrent_info swig_types[146] -#define SWIGTYPE_p_libtorrent__torrent_log_alert swig_types[147] -#define SWIGTYPE_p_libtorrent__torrent_need_cert_alert swig_types[148] -#define SWIGTYPE_p_libtorrent__torrent_paused_alert swig_types[149] -#define SWIGTYPE_p_libtorrent__torrent_plugin swig_types[150] -#define SWIGTYPE_p_libtorrent__torrent_removed_alert swig_types[151] -#define SWIGTYPE_p_libtorrent__torrent_resumed_alert swig_types[152] -#define SWIGTYPE_p_libtorrent__torrent_status swig_types[153] -#define SWIGTYPE_p_libtorrent__torrent_update_alert swig_types[154] -#define SWIGTYPE_p_libtorrent__tracker_alert swig_types[155] -#define SWIGTYPE_p_libtorrent__tracker_announce_alert swig_types[156] -#define SWIGTYPE_p_libtorrent__tracker_error_alert swig_types[157] -#define SWIGTYPE_p_libtorrent__tracker_reply_alert swig_types[158] -#define SWIGTYPE_p_libtorrent__tracker_warning_alert swig_types[159] -#define SWIGTYPE_p_libtorrent__trackerid_alert swig_types[160] -#define SWIGTYPE_p_libtorrent__type_error swig_types[161] -#define SWIGTYPE_p_libtorrent__udp_error_alert swig_types[162] -#define SWIGTYPE_p_libtorrent__unwanted_block_alert swig_types[163] -#define SWIGTYPE_p_libtorrent__url_seed_alert swig_types[164] -#define SWIGTYPE_p_libtorrent__web_seed_entry swig_types[165] -#define SWIGTYPE_p_libtorrent__zero_storage swig_types[166] -#define SWIGTYPE_p_list_type swig_types[167] -#define SWIGTYPE_p_long swig_types[168] -#define SWIGTYPE_p_long_long swig_types[169] -#define SWIGTYPE_p_mapped_type swig_types[170] -#define SWIGTYPE_p_nodes_t swig_types[171] -#define SWIGTYPE_p_posix_stat swig_types[172] -#define SWIGTYPE_p_posix_wrapper swig_types[173] -#define SWIGTYPE_p_set_piece_hashes_listener swig_types[174] -#define SWIGTYPE_p_short swig_types[175] -#define SWIGTYPE_p_signed_char swig_types[176] -#define SWIGTYPE_p_size_type swig_types[177] -#define SWIGTYPE_p_std__listT_libtorrent__entry_t swig_types[178] -#define SWIGTYPE_p_std__listT_std__string_t swig_types[179] -#define SWIGTYPE_p_std__mapT_int_libtorrent__sha1_hash_t swig_types[180] -#define SWIGTYPE_p_std__mapT_std__string_libtorrent__entry_t swig_types[181] -#define SWIGTYPE_p_std__mapT_std__string_long_t swig_types[182] -#define SWIGTYPE_p_std__pairT_int_int_t swig_types[183] -#define SWIGTYPE_p_std__pairT_std__string_dht_extension_handler_listener_p_t swig_types[184] -#define SWIGTYPE_p_std__pairT_std__string_int_t swig_types[185] -#define SWIGTYPE_p_std__pairT_std__string_libtorrent__bdecode_node_t swig_types[186] -#define SWIGTYPE_p_std__pairT_std__string_std__string_t swig_types[187] -#define SWIGTYPE_p_std__runtime_error swig_types[188] -#define SWIGTYPE_p_std__vectorT_char_t swig_types[189] -#define SWIGTYPE_p_std__vectorT_int_t swig_types[190] -#define SWIGTYPE_p_std__vectorT_libtorrent__alert_p_t swig_types[191] -#define SWIGTYPE_p_std__vectorT_libtorrent__announce_entry_t swig_types[192] -#define SWIGTYPE_p_std__vectorT_libtorrent__dht_lookup_t swig_types[193] -#define SWIGTYPE_p_std__vectorT_libtorrent__dht_routing_bucket_t swig_types[194] -#define SWIGTYPE_p_std__vectorT_libtorrent__entry_t swig_types[195] -#define SWIGTYPE_p_std__vectorT_libtorrent__file_slice_t swig_types[196] -#define SWIGTYPE_p_std__vectorT_libtorrent__partial_piece_info_t swig_types[197] -#define SWIGTYPE_p_std__vectorT_libtorrent__peer_connection_handle_t swig_types[198] -#define SWIGTYPE_p_std__vectorT_libtorrent__peer_info_t swig_types[199] -#define SWIGTYPE_p_std__vectorT_libtorrent__peer_list_entry_t swig_types[200] -#define SWIGTYPE_p_std__vectorT_libtorrent__sha1_hash_t swig_types[201] -#define SWIGTYPE_p_std__vectorT_libtorrent__stats_metric_t swig_types[202] -#define SWIGTYPE_p_std__vectorT_libtorrent__torrent_handle_t swig_types[203] -#define SWIGTYPE_p_std__vectorT_libtorrent__torrent_status_t swig_types[204] -#define SWIGTYPE_p_std__vectorT_libtorrent__web_seed_entry_t swig_types[205] -#define SWIGTYPE_p_std__vectorT_long_long_t swig_types[206] -#define SWIGTYPE_p_std__vectorT_signed_char_t swig_types[207] -#define SWIGTYPE_p_std__vectorT_std__pairT_int_int_t_t swig_types[208] -#define SWIGTYPE_p_std__vectorT_std__pairT_std__string_boost__functionT_bool_fudp__endpoint_const_R_libtorrent__bdecode_node_const_R_libtorrent__entry_RF_t_t_t swig_types[209] -#define SWIGTYPE_p_std__vectorT_std__pairT_std__string_dht_extension_handler_listener_p_t_t swig_types[210] -#define SWIGTYPE_p_std__vectorT_std__pairT_std__string_int_t_t swig_types[211] -#define SWIGTYPE_p_std__vectorT_std__pairT_std__string_std__string_t_t swig_types[212] -#define SWIGTYPE_p_std__vectorT_std__string_t swig_types[213] -#define SWIGTYPE_p_std__vectorT_tcp__endpoint_t swig_types[214] -#define SWIGTYPE_p_std__vectorT_unsigned_char_t swig_types[215] -#define SWIGTYPE_p_string_type swig_types[216] -#define SWIGTYPE_p_swig_peer_plugin swig_types[217] -#define SWIGTYPE_p_swig_plugin swig_types[218] -#define SWIGTYPE_p_swig_storage swig_types[219] -#define SWIGTYPE_p_swig_storage_constructor swig_types[220] -#define SWIGTYPE_p_swig_torrent_plugin swig_types[221] -#define SWIGTYPE_p_tailqueueT_libtorrent__disk_io_job_t swig_types[222] -#define SWIGTYPE_p_tcp__endpoint swig_types[223] -#define SWIGTYPE_p_udp__endpoint swig_types[224] -#define SWIGTYPE_p_unsigned_char swig_types[225] -#define SWIGTYPE_p_unsigned_int swig_types[226] -#define SWIGTYPE_p_unsigned_long_long swig_types[227] -#define SWIGTYPE_p_unsigned_short swig_types[228] -#define SWIGTYPE_p_unspecified_bool_type swig_types[229] -#define SWIGTYPE_p_value_type swig_types[230] -static swig_type_info *swig_types[232]; -static swig_module_info swig_module = {swig_types, 231, 0, 0, 0, 0}; +#define SWIGTYPE_p_filter_tuple_t swig_types[18] +#define SWIGTYPE_p_headers_t swig_types[19] +#define SWIGTYPE_p_int swig_types[20] +#define SWIGTYPE_p_integer_type swig_types[21] +#define SWIGTYPE_p_key_type swig_types[22] +#define SWIGTYPE_p_libtorrent__add_torrent_alert swig_types[23] +#define SWIGTYPE_p_libtorrent__add_torrent_params swig_types[24] +#define SWIGTYPE_p_libtorrent__alert swig_types[25] +#define SWIGTYPE_p_libtorrent__announce_entry swig_types[26] +#define SWIGTYPE_p_libtorrent__anonymous_mode_alert swig_types[27] +#define SWIGTYPE_p_libtorrent__aux__session_settings swig_types[28] +#define SWIGTYPE_p_libtorrent__bdecode_node swig_types[29] +#define SWIGTYPE_p_libtorrent__bitfield swig_types[30] +#define SWIGTYPE_p_libtorrent__block_downloading_alert swig_types[31] +#define SWIGTYPE_p_libtorrent__block_finished_alert swig_types[32] +#define SWIGTYPE_p_libtorrent__block_info swig_types[33] +#define SWIGTYPE_p_libtorrent__block_timeout_alert swig_types[34] +#define SWIGTYPE_p_libtorrent__bt_peer_connection_handle swig_types[35] +#define SWIGTYPE_p_libtorrent__cache_flushed_alert swig_types[36] +#define SWIGTYPE_p_libtorrent__counters swig_types[37] +#define SWIGTYPE_p_libtorrent__create_torrent swig_types[38] +#define SWIGTYPE_p_libtorrent__default_storage swig_types[39] +#define SWIGTYPE_p_libtorrent__detail__bdecode_token swig_types[40] +#define SWIGTYPE_p_libtorrent__dht_announce_alert swig_types[41] +#define SWIGTYPE_p_libtorrent__dht_bootstrap_alert swig_types[42] +#define SWIGTYPE_p_libtorrent__dht_direct_response_alert swig_types[43] +#define SWIGTYPE_p_libtorrent__dht_error_alert swig_types[44] +#define SWIGTYPE_p_libtorrent__dht_get_peers_alert swig_types[45] +#define SWIGTYPE_p_libtorrent__dht_get_peers_reply_alert swig_types[46] +#define SWIGTYPE_p_libtorrent__dht_immutable_item_alert swig_types[47] +#define SWIGTYPE_p_libtorrent__dht_log_alert swig_types[48] +#define SWIGTYPE_p_libtorrent__dht_lookup swig_types[49] +#define SWIGTYPE_p_libtorrent__dht_mutable_item_alert swig_types[50] +#define SWIGTYPE_p_libtorrent__dht_outgoing_get_peers_alert swig_types[51] +#define SWIGTYPE_p_libtorrent__dht_pkt_alert swig_types[52] +#define SWIGTYPE_p_libtorrent__dht_put_alert swig_types[53] +#define SWIGTYPE_p_libtorrent__dht_reply_alert swig_types[54] +#define SWIGTYPE_p_libtorrent__dht_routing_bucket swig_types[55] +#define SWIGTYPE_p_libtorrent__dht_settings swig_types[56] +#define SWIGTYPE_p_libtorrent__dht_stats_alert swig_types[57] +#define SWIGTYPE_p_libtorrent__disabled_storage swig_types[58] +#define SWIGTYPE_p_libtorrent__disk_buffer_holder swig_types[59] +#define SWIGTYPE_p_libtorrent__disk_job_fence swig_types[60] +#define SWIGTYPE_p_libtorrent__entry swig_types[61] +#define SWIGTYPE_p_libtorrent__external_ip_alert swig_types[62] +#define SWIGTYPE_p_libtorrent__fastresume_rejected_alert swig_types[63] +#define SWIGTYPE_p_libtorrent__file_completed_alert swig_types[64] +#define SWIGTYPE_p_libtorrent__file_error_alert swig_types[65] +#define SWIGTYPE_p_libtorrent__file_rename_failed_alert swig_types[66] +#define SWIGTYPE_p_libtorrent__file_renamed_alert swig_types[67] +#define SWIGTYPE_p_libtorrent__file_slice swig_types[68] +#define SWIGTYPE_p_libtorrent__file_storage swig_types[69] +#define SWIGTYPE_p_libtorrent__fingerprint swig_types[70] +#define SWIGTYPE_p_libtorrent__hash_failed_alert swig_types[71] +#define SWIGTYPE_p_libtorrent__i2p_alert swig_types[72] +#define SWIGTYPE_p_libtorrent__incoming_connection_alert swig_types[73] +#define SWIGTYPE_p_libtorrent__incoming_request_alert swig_types[74] +#define SWIGTYPE_p_libtorrent__invalid_request_alert swig_types[75] +#define SWIGTYPE_p_libtorrent__ip_filter swig_types[76] +#define SWIGTYPE_p_libtorrent__listen_failed_alert swig_types[77] +#define SWIGTYPE_p_libtorrent__listen_succeeded_alert swig_types[78] +#define SWIGTYPE_p_libtorrent__log_alert swig_types[79] +#define SWIGTYPE_p_libtorrent__lsd_error_alert swig_types[80] +#define SWIGTYPE_p_libtorrent__lsd_peer_alert swig_types[81] +#define SWIGTYPE_p_libtorrent__metadata_failed_alert swig_types[82] +#define SWIGTYPE_p_libtorrent__metadata_received_alert swig_types[83] +#define SWIGTYPE_p_libtorrent__mmap_cache_alert swig_types[84] +#define SWIGTYPE_p_libtorrent__partial_piece_info swig_types[85] +#define SWIGTYPE_p_libtorrent__peer_alert swig_types[86] +#define SWIGTYPE_p_libtorrent__peer_ban_alert swig_types[87] +#define SWIGTYPE_p_libtorrent__peer_blocked_alert swig_types[88] +#define SWIGTYPE_p_libtorrent__peer_class swig_types[89] +#define SWIGTYPE_p_libtorrent__peer_class_info swig_types[90] +#define SWIGTYPE_p_libtorrent__peer_class_pool swig_types[91] +#define SWIGTYPE_p_libtorrent__peer_class_type_filter swig_types[92] +#define SWIGTYPE_p_libtorrent__peer_connect_alert swig_types[93] +#define SWIGTYPE_p_libtorrent__peer_connection_handle swig_types[94] +#define SWIGTYPE_p_libtorrent__peer_disconnected_alert swig_types[95] +#define SWIGTYPE_p_libtorrent__peer_error_alert swig_types[96] +#define SWIGTYPE_p_libtorrent__peer_info swig_types[97] +#define SWIGTYPE_p_libtorrent__peer_list_entry swig_types[98] +#define SWIGTYPE_p_libtorrent__peer_log_alert swig_types[99] +#define SWIGTYPE_p_libtorrent__peer_plugin swig_types[100] +#define SWIGTYPE_p_libtorrent__peer_request swig_types[101] +#define SWIGTYPE_p_libtorrent__peer_snubbed_alert swig_types[102] +#define SWIGTYPE_p_libtorrent__peer_unsnubbed_alert swig_types[103] +#define SWIGTYPE_p_libtorrent__performance_alert swig_types[104] +#define SWIGTYPE_p_libtorrent__picker_log_alert swig_types[105] +#define SWIGTYPE_p_libtorrent__piece_finished_alert swig_types[106] +#define SWIGTYPE_p_libtorrent__piece_manager swig_types[107] +#define SWIGTYPE_p_libtorrent__pool_file_status swig_types[108] +#define SWIGTYPE_p_libtorrent__port_filter swig_types[109] +#define SWIGTYPE_p_libtorrent__portmap_alert swig_types[110] +#define SWIGTYPE_p_libtorrent__portmap_error_alert swig_types[111] +#define SWIGTYPE_p_libtorrent__portmap_log_alert swig_types[112] +#define SWIGTYPE_p_libtorrent__read_piece_alert swig_types[113] +#define SWIGTYPE_p_libtorrent__request_dropped_alert swig_types[114] +#define SWIGTYPE_p_libtorrent__save_resume_data_alert swig_types[115] +#define SWIGTYPE_p_libtorrent__save_resume_data_failed_alert swig_types[116] +#define SWIGTYPE_p_libtorrent__scrape_failed_alert swig_types[117] +#define SWIGTYPE_p_libtorrent__scrape_reply_alert swig_types[118] +#define SWIGTYPE_p_libtorrent__session swig_types[119] +#define SWIGTYPE_p_libtorrent__session_handle swig_types[120] +#define SWIGTYPE_p_libtorrent__session_proxy swig_types[121] +#define SWIGTYPE_p_libtorrent__session_stats_alert swig_types[122] +#define SWIGTYPE_p_libtorrent__settings_pack swig_types[123] +#define SWIGTYPE_p_libtorrent__sha1_hash swig_types[124] +#define SWIGTYPE_p_libtorrent__stat swig_types[125] +#define SWIGTYPE_p_libtorrent__stat_channel swig_types[126] +#define SWIGTYPE_p_libtorrent__state_changed_alert swig_types[127] +#define SWIGTYPE_p_libtorrent__state_update_alert swig_types[128] +#define SWIGTYPE_p_libtorrent__stats_alert swig_types[129] +#define SWIGTYPE_p_libtorrent__stats_metric swig_types[130] +#define SWIGTYPE_p_libtorrent__storage_error swig_types[131] +#define SWIGTYPE_p_libtorrent__storage_interface swig_types[132] +#define SWIGTYPE_p_libtorrent__storage_moved_alert swig_types[133] +#define SWIGTYPE_p_libtorrent__storage_moved_failed_alert swig_types[134] +#define SWIGTYPE_p_libtorrent__storage_params swig_types[135] +#define SWIGTYPE_p_libtorrent__storage_piece_set swig_types[136] +#define SWIGTYPE_p_libtorrent__torrent_added_alert swig_types[137] +#define SWIGTYPE_p_libtorrent__torrent_alert swig_types[138] +#define SWIGTYPE_p_libtorrent__torrent_checked_alert swig_types[139] +#define SWIGTYPE_p_libtorrent__torrent_delete_failed_alert swig_types[140] +#define SWIGTYPE_p_libtorrent__torrent_deleted_alert swig_types[141] +#define SWIGTYPE_p_libtorrent__torrent_error_alert swig_types[142] +#define SWIGTYPE_p_libtorrent__torrent_finished_alert swig_types[143] +#define SWIGTYPE_p_libtorrent__torrent_handle swig_types[144] +#define SWIGTYPE_p_libtorrent__torrent_info swig_types[145] +#define SWIGTYPE_p_libtorrent__torrent_log_alert swig_types[146] +#define SWIGTYPE_p_libtorrent__torrent_need_cert_alert swig_types[147] +#define SWIGTYPE_p_libtorrent__torrent_paused_alert swig_types[148] +#define SWIGTYPE_p_libtorrent__torrent_plugin swig_types[149] +#define SWIGTYPE_p_libtorrent__torrent_removed_alert swig_types[150] +#define SWIGTYPE_p_libtorrent__torrent_resumed_alert swig_types[151] +#define SWIGTYPE_p_libtorrent__torrent_status swig_types[152] +#define SWIGTYPE_p_libtorrent__torrent_update_alert swig_types[153] +#define SWIGTYPE_p_libtorrent__tracker_alert swig_types[154] +#define SWIGTYPE_p_libtorrent__tracker_announce_alert swig_types[155] +#define SWIGTYPE_p_libtorrent__tracker_error_alert swig_types[156] +#define SWIGTYPE_p_libtorrent__tracker_reply_alert swig_types[157] +#define SWIGTYPE_p_libtorrent__tracker_warning_alert swig_types[158] +#define SWIGTYPE_p_libtorrent__trackerid_alert swig_types[159] +#define SWIGTYPE_p_libtorrent__type_error swig_types[160] +#define SWIGTYPE_p_libtorrent__udp_error_alert swig_types[161] +#define SWIGTYPE_p_libtorrent__unwanted_block_alert swig_types[162] +#define SWIGTYPE_p_libtorrent__url_seed_alert swig_types[163] +#define SWIGTYPE_p_libtorrent__web_seed_entry swig_types[164] +#define SWIGTYPE_p_libtorrent__zero_storage swig_types[165] +#define SWIGTYPE_p_list_type swig_types[166] +#define SWIGTYPE_p_long swig_types[167] +#define SWIGTYPE_p_long_long swig_types[168] +#define SWIGTYPE_p_mapped_type swig_types[169] +#define SWIGTYPE_p_nodes_t swig_types[170] +#define SWIGTYPE_p_posix_stat swig_types[171] +#define SWIGTYPE_p_posix_wrapper swig_types[172] +#define SWIGTYPE_p_set_piece_hashes_listener swig_types[173] +#define SWIGTYPE_p_short swig_types[174] +#define SWIGTYPE_p_signed_char swig_types[175] +#define SWIGTYPE_p_size_type swig_types[176] +#define SWIGTYPE_p_std__listT_libtorrent__entry_t swig_types[177] +#define SWIGTYPE_p_std__listT_std__string_t swig_types[178] +#define SWIGTYPE_p_std__mapT_int_libtorrent__sha1_hash_t swig_types[179] +#define SWIGTYPE_p_std__mapT_std__string_libtorrent__entry_t swig_types[180] +#define SWIGTYPE_p_std__mapT_std__string_long_t swig_types[181] +#define SWIGTYPE_p_std__pairT_int_int_t swig_types[182] +#define SWIGTYPE_p_std__pairT_std__string_dht_extension_handler_listener_p_t swig_types[183] +#define SWIGTYPE_p_std__pairT_std__string_int_t swig_types[184] +#define SWIGTYPE_p_std__pairT_std__string_libtorrent__bdecode_node_t swig_types[185] +#define SWIGTYPE_p_std__pairT_std__string_std__string_t swig_types[186] +#define SWIGTYPE_p_std__runtime_error swig_types[187] +#define SWIGTYPE_p_std__vectorT_char_t swig_types[188] +#define SWIGTYPE_p_std__vectorT_int_t swig_types[189] +#define SWIGTYPE_p_std__vectorT_libtorrent__alert_p_t swig_types[190] +#define SWIGTYPE_p_std__vectorT_libtorrent__announce_entry_t swig_types[191] +#define SWIGTYPE_p_std__vectorT_libtorrent__dht_lookup_t swig_types[192] +#define SWIGTYPE_p_std__vectorT_libtorrent__dht_routing_bucket_t swig_types[193] +#define SWIGTYPE_p_std__vectorT_libtorrent__entry_t swig_types[194] +#define SWIGTYPE_p_std__vectorT_libtorrent__file_slice_t swig_types[195] +#define SWIGTYPE_p_std__vectorT_libtorrent__partial_piece_info_t swig_types[196] +#define SWIGTYPE_p_std__vectorT_libtorrent__peer_connection_handle_t swig_types[197] +#define SWIGTYPE_p_std__vectorT_libtorrent__peer_info_t swig_types[198] +#define SWIGTYPE_p_std__vectorT_libtorrent__peer_list_entry_t swig_types[199] +#define SWIGTYPE_p_std__vectorT_libtorrent__sha1_hash_t swig_types[200] +#define SWIGTYPE_p_std__vectorT_libtorrent__stats_metric_t swig_types[201] +#define SWIGTYPE_p_std__vectorT_libtorrent__torrent_handle_t swig_types[202] +#define SWIGTYPE_p_std__vectorT_libtorrent__torrent_status_t swig_types[203] +#define SWIGTYPE_p_std__vectorT_libtorrent__web_seed_entry_t swig_types[204] +#define SWIGTYPE_p_std__vectorT_long_long_t swig_types[205] +#define SWIGTYPE_p_std__vectorT_signed_char_t swig_types[206] +#define SWIGTYPE_p_std__vectorT_std__pairT_int_int_t_t swig_types[207] +#define SWIGTYPE_p_std__vectorT_std__pairT_std__string_boost__functionT_bool_fudp__endpoint_const_R_libtorrent__bdecode_node_const_R_libtorrent__entry_RF_t_t_t swig_types[208] +#define SWIGTYPE_p_std__vectorT_std__pairT_std__string_dht_extension_handler_listener_p_t_t swig_types[209] +#define SWIGTYPE_p_std__vectorT_std__pairT_std__string_int_t_t swig_types[210] +#define SWIGTYPE_p_std__vectorT_std__pairT_std__string_std__string_t_t swig_types[211] +#define SWIGTYPE_p_std__vectorT_std__string_t swig_types[212] +#define SWIGTYPE_p_std__vectorT_tcp__endpoint_t swig_types[213] +#define SWIGTYPE_p_std__vectorT_unsigned_char_t swig_types[214] +#define SWIGTYPE_p_string_type swig_types[215] +#define SWIGTYPE_p_swig_peer_plugin swig_types[216] +#define SWIGTYPE_p_swig_plugin swig_types[217] +#define SWIGTYPE_p_swig_storage swig_types[218] +#define SWIGTYPE_p_swig_storage_constructor swig_types[219] +#define SWIGTYPE_p_swig_torrent_plugin swig_types[220] +#define SWIGTYPE_p_tailqueueT_libtorrent__disk_io_job_t swig_types[221] +#define SWIGTYPE_p_tcp__endpoint swig_types[222] +#define SWIGTYPE_p_udp__endpoint swig_types[223] +#define SWIGTYPE_p_unsigned_char swig_types[224] +#define SWIGTYPE_p_unsigned_int swig_types[225] +#define SWIGTYPE_p_unsigned_long_long swig_types[226] +#define SWIGTYPE_p_unsigned_short swig_types[227] +#define SWIGTYPE_p_unspecified_bool_type swig_types[228] +#define SWIGTYPE_p_value_type swig_types[229] +static swig_type_info *swig_types[231]; +static swig_module_info swig_module = {swig_types, 230, 0, 0, 0, 0}; #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name) #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name) @@ -1785,6 +1784,7 @@ static swig_module_info swig_module = {swig_types, 231, 0, 0, 0, 0}; #include "libtorrent/create_torrent.hpp" #include "libtorrent/announce_entry.hpp" #include "libtorrent/torrent_status.hpp" +#include "libtorrent/ed25519.hpp" #include "libtorrent/extensions/ut_pex.hpp" #include "libtorrent/extensions/ut_metadata.hpp" @@ -1792,8 +1792,7 @@ static swig_module_info swig_module = {swig_types, 231, 0, 0, 0, 0}; #include "libtorrent/extensions/smart_ban.hpp" #include "libtorrent/kademlia/item.hpp" -#include "libtorrent/ed25519.hpp" - + // additional includes using namespace boost; @@ -1801,65 +1800,6 @@ using namespace boost::system; using namespace libtorrent; -class ed25519 { -public: - - static const int seed_size = ed25519_seed_size; - static const int private_key_size = ed25519_private_key_size; - static const int public_key_size = ed25519_public_key_size; - static const int signature_size = ed25519_signature_size; - static const int scalar_size = ed25519_scalar_size; - static const int shared_secret_size = ed25519_shared_secret_size; - - static void create_seed(std::vector& seed) { - ed25519_create_seed((unsigned char*)seed.data()); - } - - static void create_keypair(std::vector& public_key, - std::vector& private_key, - std::vector& seed) { - ed25519_create_keypair((unsigned char*)public_key.data(), - (unsigned char*)private_key.data(), - (unsigned char*)seed.data()); - } - - static void sign(std::vector& signature, - std::vector& message, - std::vector& public_key, - std::vector& private_key) { - ed25519_sign((unsigned char*)signature.data(), - (unsigned char*)message.data(), - message.size(), - (unsigned char*)public_key.data(), - (unsigned char*)private_key.data()); - } - - static int verify(std::vector& signature, - std::vector& message, - std::vector& private_key) { - return ed25519_verify((unsigned char*)signature.data(), - (unsigned char*)message.data(), - message.size(), - (unsigned char*)private_key.data()); - } - - static void add_scalar(std::vector& public_key, - std::vector& private_key, - std::vector& scalar) { - ed25519_add_scalar((unsigned char*)public_key.data(), - (unsigned char*)private_key.data(), - (unsigned char*)scalar.data()); - } - - static void key_exchange(std::vector& shared_secret, - std::vector& public_key, - std::vector& private_key) { - ed25519_key_exchange((unsigned char*)shared_secret.data(), - (unsigned char*)public_key.data(), - (unsigned char*)private_key.data()); - } -}; - namespace libtorrent { namespace dht { // code copied from item.cpp @@ -3330,7 +3270,6 @@ SWIGV8_ClientData _exports_address_v6_clientData; SWIGV8_ClientData _exports_high_resolution_clock_clientData; SWIGV8_ClientData _exports_tcp_endpoint_clientData; SWIGV8_ClientData _exports_udp_endpoint_clientData; -SWIGV8_ClientData _exports_ed25519_clientData; SWIGV8_ClientData _exports_dht_item_clientData; SWIGV8_ClientData _exports_add_files_listener_clientData; SWIGV8_ClientData _exports_set_piece_hashes_listener_clientData; @@ -104604,6 +104543,96 @@ static SwigV8ReturnValue _wrap_torrent_status_info_hash_get(v8::Local property, const SwigV8PropertyCallbackInfo &info) { + SWIGV8_HANDLESCOPE(); + + v8::Handle jsresult; + + jsresult = SWIG_From_int((int)(ed25519_seed_size)); + + SWIGV8_RETURN_INFO(jsresult, info); + + goto fail; +fail: + SWIGV8_RETURN_INFO(SWIGV8_UNDEFINED(), info); +} + + +static SwigV8ReturnValue _wrap_ed25519_private_key_size(v8::Local property, const SwigV8PropertyCallbackInfo &info) { + SWIGV8_HANDLESCOPE(); + + v8::Handle jsresult; + + jsresult = SWIG_From_int((int)(ed25519_private_key_size)); + + SWIGV8_RETURN_INFO(jsresult, info); + + goto fail; +fail: + SWIGV8_RETURN_INFO(SWIGV8_UNDEFINED(), info); +} + + +static SwigV8ReturnValue _wrap_ed25519_public_key_size(v8::Local property, const SwigV8PropertyCallbackInfo &info) { + SWIGV8_HANDLESCOPE(); + + v8::Handle jsresult; + + jsresult = SWIG_From_int((int)(ed25519_public_key_size)); + + SWIGV8_RETURN_INFO(jsresult, info); + + goto fail; +fail: + SWIGV8_RETURN_INFO(SWIGV8_UNDEFINED(), info); +} + + +static SwigV8ReturnValue _wrap_ed25519_signature_size(v8::Local property, const SwigV8PropertyCallbackInfo &info) { + SWIGV8_HANDLESCOPE(); + + v8::Handle jsresult; + + jsresult = SWIG_From_int((int)(ed25519_signature_size)); + + SWIGV8_RETURN_INFO(jsresult, info); + + goto fail; +fail: + SWIGV8_RETURN_INFO(SWIGV8_UNDEFINED(), info); +} + + +static SwigV8ReturnValue _wrap_ed25519_scalar_size(v8::Local property, const SwigV8PropertyCallbackInfo &info) { + SWIGV8_HANDLESCOPE(); + + v8::Handle jsresult; + + jsresult = SWIG_From_int((int)(ed25519_scalar_size)); + + SWIGV8_RETURN_INFO(jsresult, info); + + goto fail; +fail: + SWIGV8_RETURN_INFO(SWIGV8_UNDEFINED(), info); +} + + +static SwigV8ReturnValue _wrap_ed25519_shared_secret_size(v8::Local property, const SwigV8PropertyCallbackInfo &info) { + SWIGV8_HANDLESCOPE(); + + v8::Handle jsresult; + + jsresult = SWIG_From_int((int)(ed25519_shared_secret_size)); + + SWIGV8_RETURN_INFO(jsresult, info); + + goto fail; +fail: + SWIGV8_RETURN_INFO(SWIGV8_UNDEFINED(), info); +} + + static SwigV8ReturnValue _wrap_new_address__SWIG_0(const SwigV8Arguments &args, V8ErrorHandler &SWIGV8_ErrorHandler) { SWIGV8_HANDLESCOPE(); @@ -107312,462 +107341,6 @@ static SwigV8ReturnValue _wrap_set_utp_stream_logging(const SwigV8Arguments &arg } -static SwigV8ReturnValue _wrap_ed25519_seed_size(v8::Local property, const SwigV8PropertyCallbackInfo &info) { - SWIGV8_HANDLESCOPE(); - - v8::Handle jsresult; - - jsresult = SWIG_From_int((int)(ed25519::seed_size)); - - SWIGV8_RETURN_INFO(jsresult, info); - - goto fail; -fail: - SWIGV8_RETURN_INFO(SWIGV8_UNDEFINED(), info); -} - - -static SwigV8ReturnValue _wrap_ed25519_private_key_size(v8::Local property, const SwigV8PropertyCallbackInfo &info) { - SWIGV8_HANDLESCOPE(); - - v8::Handle jsresult; - - jsresult = SWIG_From_int((int)(ed25519::private_key_size)); - - SWIGV8_RETURN_INFO(jsresult, info); - - goto fail; -fail: - SWIGV8_RETURN_INFO(SWIGV8_UNDEFINED(), info); -} - - -static SwigV8ReturnValue _wrap_ed25519_public_key_size(v8::Local property, const SwigV8PropertyCallbackInfo &info) { - SWIGV8_HANDLESCOPE(); - - v8::Handle jsresult; - - jsresult = SWIG_From_int((int)(ed25519::public_key_size)); - - SWIGV8_RETURN_INFO(jsresult, info); - - goto fail; -fail: - SWIGV8_RETURN_INFO(SWIGV8_UNDEFINED(), info); -} - - -static SwigV8ReturnValue _wrap_ed25519_signature_size(v8::Local property, const SwigV8PropertyCallbackInfo &info) { - SWIGV8_HANDLESCOPE(); - - v8::Handle jsresult; - - jsresult = SWIG_From_int((int)(ed25519::signature_size)); - - SWIGV8_RETURN_INFO(jsresult, info); - - goto fail; -fail: - SWIGV8_RETURN_INFO(SWIGV8_UNDEFINED(), info); -} - - -static SwigV8ReturnValue _wrap_ed25519_scalar_size(v8::Local property, const SwigV8PropertyCallbackInfo &info) { - SWIGV8_HANDLESCOPE(); - - v8::Handle jsresult; - - jsresult = SWIG_From_int((int)(ed25519::scalar_size)); - - SWIGV8_RETURN_INFO(jsresult, info); - - goto fail; -fail: - SWIGV8_RETURN_INFO(SWIGV8_UNDEFINED(), info); -} - - -static SwigV8ReturnValue _wrap_ed25519_shared_secret_size(v8::Local property, const SwigV8PropertyCallbackInfo &info) { - SWIGV8_HANDLESCOPE(); - - v8::Handle jsresult; - - jsresult = SWIG_From_int((int)(ed25519::shared_secret_size)); - - SWIGV8_RETURN_INFO(jsresult, info); - - goto fail; -fail: - SWIGV8_RETURN_INFO(SWIGV8_UNDEFINED(), info); -} - - -static SwigV8ReturnValue _wrap_ed25519_create_seed(const SwigV8Arguments &args) { - SWIGV8_HANDLESCOPE(); - - v8::Handle jsresult; - std::vector< char > *arg1 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - - if(args.Length() != 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_ed25519_create_seed."); - - res1 = SWIG_ConvertPtr(args[0], &argp1, SWIGTYPE_p_std__vectorT_char_t, 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ed25519_create_seed" "', argument " "1"" of type '" "std::vector< char > &""'"); - } - if (!argp1) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "ed25519_create_seed" "', argument " "1"" of type '" "std::vector< char > &""'"); - } - arg1 = (std::vector< char > *)(argp1); - ed25519::create_seed(*arg1); - jsresult = SWIGV8_UNDEFINED(); - - - SWIGV8_RETURN(jsresult); - - goto fail; -fail: - SWIGV8_RETURN(SWIGV8_UNDEFINED()); -} - - -static SwigV8ReturnValue _wrap_ed25519_create_keypair(const SwigV8Arguments &args) { - SWIGV8_HANDLESCOPE(); - - v8::Handle jsresult; - std::vector< char > *arg1 = 0 ; - std::vector< char > *arg2 = 0 ; - std::vector< char > *arg3 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - - if(args.Length() != 3) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_ed25519_create_keypair."); - - res1 = SWIG_ConvertPtr(args[0], &argp1, SWIGTYPE_p_std__vectorT_char_t, 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ed25519_create_keypair" "', argument " "1"" of type '" "std::vector< char > &""'"); - } - if (!argp1) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "ed25519_create_keypair" "', argument " "1"" of type '" "std::vector< char > &""'"); - } - arg1 = (std::vector< char > *)(argp1); - res2 = SWIG_ConvertPtr(args[1], &argp2, SWIGTYPE_p_std__vectorT_char_t, 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ed25519_create_keypair" "', argument " "2"" of type '" "std::vector< char > &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "ed25519_create_keypair" "', argument " "2"" of type '" "std::vector< char > &""'"); - } - arg2 = (std::vector< char > *)(argp2); - res3 = SWIG_ConvertPtr(args[2], &argp3, SWIGTYPE_p_std__vectorT_char_t, 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ed25519_create_keypair" "', argument " "3"" of type '" "std::vector< char > &""'"); - } - if (!argp3) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "ed25519_create_keypair" "', argument " "3"" of type '" "std::vector< char > &""'"); - } - arg3 = (std::vector< char > *)(argp3); - ed25519::create_keypair(*arg1,*arg2,*arg3); - jsresult = SWIGV8_UNDEFINED(); - - - - - SWIGV8_RETURN(jsresult); - - goto fail; -fail: - SWIGV8_RETURN(SWIGV8_UNDEFINED()); -} - - -static SwigV8ReturnValue _wrap_ed25519_sign(const SwigV8Arguments &args) { - SWIGV8_HANDLESCOPE(); - - v8::Handle jsresult; - std::vector< char > *arg1 = 0 ; - std::vector< char > *arg2 = 0 ; - std::vector< char > *arg3 = 0 ; - std::vector< char > *arg4 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - - if(args.Length() != 4) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_ed25519_sign."); - - res1 = SWIG_ConvertPtr(args[0], &argp1, SWIGTYPE_p_std__vectorT_char_t, 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ed25519_sign" "', argument " "1"" of type '" "std::vector< char > &""'"); - } - if (!argp1) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "ed25519_sign" "', argument " "1"" of type '" "std::vector< char > &""'"); - } - arg1 = (std::vector< char > *)(argp1); - res2 = SWIG_ConvertPtr(args[1], &argp2, SWIGTYPE_p_std__vectorT_char_t, 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ed25519_sign" "', argument " "2"" of type '" "std::vector< char > &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "ed25519_sign" "', argument " "2"" of type '" "std::vector< char > &""'"); - } - arg2 = (std::vector< char > *)(argp2); - res3 = SWIG_ConvertPtr(args[2], &argp3, SWIGTYPE_p_std__vectorT_char_t, 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ed25519_sign" "', argument " "3"" of type '" "std::vector< char > &""'"); - } - if (!argp3) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "ed25519_sign" "', argument " "3"" of type '" "std::vector< char > &""'"); - } - arg3 = (std::vector< char > *)(argp3); - res4 = SWIG_ConvertPtr(args[3], &argp4, SWIGTYPE_p_std__vectorT_char_t, 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "ed25519_sign" "', argument " "4"" of type '" "std::vector< char > &""'"); - } - if (!argp4) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "ed25519_sign" "', argument " "4"" of type '" "std::vector< char > &""'"); - } - arg4 = (std::vector< char > *)(argp4); - ed25519::sign(*arg1,*arg2,*arg3,*arg4); - jsresult = SWIGV8_UNDEFINED(); - - - - - - SWIGV8_RETURN(jsresult); - - goto fail; -fail: - SWIGV8_RETURN(SWIGV8_UNDEFINED()); -} - - -static SwigV8ReturnValue _wrap_ed25519_verify(const SwigV8Arguments &args) { - SWIGV8_HANDLESCOPE(); - - v8::Handle jsresult; - std::vector< char > *arg1 = 0 ; - std::vector< char > *arg2 = 0 ; - std::vector< char > *arg3 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - int result; - - if(args.Length() != 3) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_ed25519_verify."); - - res1 = SWIG_ConvertPtr(args[0], &argp1, SWIGTYPE_p_std__vectorT_char_t, 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ed25519_verify" "', argument " "1"" of type '" "std::vector< char > &""'"); - } - if (!argp1) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "ed25519_verify" "', argument " "1"" of type '" "std::vector< char > &""'"); - } - arg1 = (std::vector< char > *)(argp1); - res2 = SWIG_ConvertPtr(args[1], &argp2, SWIGTYPE_p_std__vectorT_char_t, 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ed25519_verify" "', argument " "2"" of type '" "std::vector< char > &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "ed25519_verify" "', argument " "2"" of type '" "std::vector< char > &""'"); - } - arg2 = (std::vector< char > *)(argp2); - res3 = SWIG_ConvertPtr(args[2], &argp3, SWIGTYPE_p_std__vectorT_char_t, 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ed25519_verify" "', argument " "3"" of type '" "std::vector< char > &""'"); - } - if (!argp3) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "ed25519_verify" "', argument " "3"" of type '" "std::vector< char > &""'"); - } - arg3 = (std::vector< char > *)(argp3); - result = (int)ed25519::verify(*arg1,*arg2,*arg3); - jsresult = SWIG_From_int((int)(result)); - - - - - SWIGV8_RETURN(jsresult); - - goto fail; -fail: - SWIGV8_RETURN(SWIGV8_UNDEFINED()); -} - - -static SwigV8ReturnValue _wrap_ed25519_add_scalar(const SwigV8Arguments &args) { - SWIGV8_HANDLESCOPE(); - - v8::Handle jsresult; - std::vector< char > *arg1 = 0 ; - std::vector< char > *arg2 = 0 ; - std::vector< char > *arg3 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - - if(args.Length() != 3) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_ed25519_add_scalar."); - - res1 = SWIG_ConvertPtr(args[0], &argp1, SWIGTYPE_p_std__vectorT_char_t, 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ed25519_add_scalar" "', argument " "1"" of type '" "std::vector< char > &""'"); - } - if (!argp1) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "ed25519_add_scalar" "', argument " "1"" of type '" "std::vector< char > &""'"); - } - arg1 = (std::vector< char > *)(argp1); - res2 = SWIG_ConvertPtr(args[1], &argp2, SWIGTYPE_p_std__vectorT_char_t, 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ed25519_add_scalar" "', argument " "2"" of type '" "std::vector< char > &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "ed25519_add_scalar" "', argument " "2"" of type '" "std::vector< char > &""'"); - } - arg2 = (std::vector< char > *)(argp2); - res3 = SWIG_ConvertPtr(args[2], &argp3, SWIGTYPE_p_std__vectorT_char_t, 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ed25519_add_scalar" "', argument " "3"" of type '" "std::vector< char > &""'"); - } - if (!argp3) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "ed25519_add_scalar" "', argument " "3"" of type '" "std::vector< char > &""'"); - } - arg3 = (std::vector< char > *)(argp3); - ed25519::add_scalar(*arg1,*arg2,*arg3); - jsresult = SWIGV8_UNDEFINED(); - - - - - SWIGV8_RETURN(jsresult); - - goto fail; -fail: - SWIGV8_RETURN(SWIGV8_UNDEFINED()); -} - - -static SwigV8ReturnValue _wrap_ed25519_key_exchange(const SwigV8Arguments &args) { - SWIGV8_HANDLESCOPE(); - - v8::Handle jsresult; - std::vector< char > *arg1 = 0 ; - std::vector< char > *arg2 = 0 ; - std::vector< char > *arg3 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - - if(args.Length() != 3) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_ed25519_key_exchange."); - - res1 = SWIG_ConvertPtr(args[0], &argp1, SWIGTYPE_p_std__vectorT_char_t, 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ed25519_key_exchange" "', argument " "1"" of type '" "std::vector< char > &""'"); - } - if (!argp1) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "ed25519_key_exchange" "', argument " "1"" of type '" "std::vector< char > &""'"); - } - arg1 = (std::vector< char > *)(argp1); - res2 = SWIG_ConvertPtr(args[1], &argp2, SWIGTYPE_p_std__vectorT_char_t, 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ed25519_key_exchange" "', argument " "2"" of type '" "std::vector< char > &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "ed25519_key_exchange" "', argument " "2"" of type '" "std::vector< char > &""'"); - } - arg2 = (std::vector< char > *)(argp2); - res3 = SWIG_ConvertPtr(args[2], &argp3, SWIGTYPE_p_std__vectorT_char_t, 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ed25519_key_exchange" "', argument " "3"" of type '" "std::vector< char > &""'"); - } - if (!argp3) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "ed25519_key_exchange" "', argument " "3"" of type '" "std::vector< char > &""'"); - } - arg3 = (std::vector< char > *)(argp3); - ed25519::key_exchange(*arg1,*arg2,*arg3); - jsresult = SWIGV8_UNDEFINED(); - - - - - SWIGV8_RETURN(jsresult); - - goto fail; -fail: - SWIGV8_RETURN(SWIGV8_UNDEFINED()); -} - - -static SwigV8ReturnValue _wrap_new_ed25519(const SwigV8Arguments &args) { - SWIGV8_HANDLESCOPE(); - - v8::Handle self = args.Holder(); - ed25519 *result; - if(args.Length() != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_new_ed25519."); - result = (ed25519 *)new ed25519(); - - - - SWIGV8_SetPrivateData(self, result, SWIGTYPE_p_ed25519, SWIG_POINTER_OWN); - SWIGV8_RETURN(self); - - goto fail; -fail: - SWIGV8_RETURN(SWIGV8_UNDEFINED()); -} - - -#if (SWIG_V8_VERSION < 0x031710) -static void _wrap_delete_ed25519(v8::Persistent object, void *parameter) { - SWIGV8_Proxy *proxy = static_cast(parameter); -#elif (SWIG_V8_VERSION < 0x031900) - static void _wrap_delete_ed25519(v8::Isolate *isolate, v8::Persistent object, void *parameter) { - SWIGV8_Proxy *proxy = static_cast(parameter); -#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) - static void _wrap_delete_ed25519(v8::Isolate *isolate, v8::Persistent< v8::Object> *object, SWIGV8_Proxy *proxy) { -#else - static void _wrap_delete_ed25519(const v8::WeakCallbackData &data) { - v8::Local object = data.GetValue(); - SWIGV8_Proxy *proxy = data.GetParameter(); -#endif - - if(proxy->swigCMemOwn && proxy->swigCObject) { - ed25519 * arg1 = (ed25519 *)proxy->swigCObject; - delete arg1; - } - delete proxy; - -#if (SWIG_V8_VERSION < 0x031710) - object.Dispose(); -#elif (SWIG_V8_VERSION < 0x031900) - object.Dispose(isolate); -#elif (SWIG_V8_VERSION < 0x032100) - object->Dispose(isolate); -#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) - object->Dispose(); -#else - object.Clear(); -#endif - } - - static SwigV8ReturnValue _wrap_dht_item_canonical_string(const SwigV8Arguments &args) { SWIGV8_HANDLESCOPE(); @@ -108193,7 +107766,7 @@ static SwigV8ReturnValue _wrap_JLIBTORRENT_REVISION_SHA1(v8::Local p v8::Handle jsresult; - jsresult = SWIG_FromCharPtr((const char *)"229199f40e691a532435d2ae7936da4fd6b4bb69"); + jsresult = SWIG_FromCharPtr((const char *)"21fdcd5374f98fec45e5697fc70af14fa57dec4e"); SWIGV8_RETURN_INFO(jsresult, info); @@ -108343,6 +107916,319 @@ static SwigV8ReturnValue _wrap_to_hours(const SwigV8Arguments &args) { } +static SwigV8ReturnValue _wrap_ed25519_create_seed(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle jsresult; + std::vector< int8_t > *arg1 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + + if(args.Length() != 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_ed25519_create_seed."); + + res1 = SWIG_ConvertPtr(args[0], &argp1, SWIGTYPE_p_std__vectorT_signed_char_t, 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ed25519_create_seed" "', argument " "1"" of type '" "std::vector< int8_t > &""'"); + } + if (!argp1) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "ed25519_create_seed" "', argument " "1"" of type '" "std::vector< int8_t > &""'"); + } + arg1 = (std::vector< int8_t > *)(argp1); + ed25519_create_seed(*arg1); + jsresult = SWIGV8_UNDEFINED(); + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_ed25519_create_keypair(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle jsresult; + std::vector< int8_t > *arg1 = 0 ; + std::vector< int8_t > *arg2 = 0 ; + std::vector< int8_t > *arg3 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + + if(args.Length() != 3) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_ed25519_create_keypair."); + + res1 = SWIG_ConvertPtr(args[0], &argp1, SWIGTYPE_p_std__vectorT_signed_char_t, 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ed25519_create_keypair" "', argument " "1"" of type '" "std::vector< int8_t > &""'"); + } + if (!argp1) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "ed25519_create_keypair" "', argument " "1"" of type '" "std::vector< int8_t > &""'"); + } + arg1 = (std::vector< int8_t > *)(argp1); + res2 = SWIG_ConvertPtr(args[1], &argp2, SWIGTYPE_p_std__vectorT_signed_char_t, 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ed25519_create_keypair" "', argument " "2"" of type '" "std::vector< int8_t > &""'"); + } + if (!argp2) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "ed25519_create_keypair" "', argument " "2"" of type '" "std::vector< int8_t > &""'"); + } + arg2 = (std::vector< int8_t > *)(argp2); + res3 = SWIG_ConvertPtr(args[2], &argp3, SWIGTYPE_p_std__vectorT_signed_char_t, 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ed25519_create_keypair" "', argument " "3"" of type '" "std::vector< int8_t > &""'"); + } + if (!argp3) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "ed25519_create_keypair" "', argument " "3"" of type '" "std::vector< int8_t > &""'"); + } + arg3 = (std::vector< int8_t > *)(argp3); + ed25519_create_keypair(*arg1,*arg2,*arg3); + jsresult = SWIGV8_UNDEFINED(); + + + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_ed25519_sign(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle jsresult; + std::vector< int8_t > *arg1 = 0 ; + std::vector< int8_t > *arg2 = 0 ; + std::vector< int8_t > *arg3 = 0 ; + std::vector< int8_t > *arg4 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; + + if(args.Length() != 4) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_ed25519_sign."); + + res1 = SWIG_ConvertPtr(args[0], &argp1, SWIGTYPE_p_std__vectorT_signed_char_t, 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ed25519_sign" "', argument " "1"" of type '" "std::vector< int8_t > &""'"); + } + if (!argp1) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "ed25519_sign" "', argument " "1"" of type '" "std::vector< int8_t > &""'"); + } + arg1 = (std::vector< int8_t > *)(argp1); + res2 = SWIG_ConvertPtr(args[1], &argp2, SWIGTYPE_p_std__vectorT_signed_char_t, 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ed25519_sign" "', argument " "2"" of type '" "std::vector< int8_t > &""'"); + } + if (!argp2) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "ed25519_sign" "', argument " "2"" of type '" "std::vector< int8_t > &""'"); + } + arg2 = (std::vector< int8_t > *)(argp2); + res3 = SWIG_ConvertPtr(args[2], &argp3, SWIGTYPE_p_std__vectorT_signed_char_t, 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ed25519_sign" "', argument " "3"" of type '" "std::vector< int8_t > &""'"); + } + if (!argp3) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "ed25519_sign" "', argument " "3"" of type '" "std::vector< int8_t > &""'"); + } + arg3 = (std::vector< int8_t > *)(argp3); + res4 = SWIG_ConvertPtr(args[3], &argp4, SWIGTYPE_p_std__vectorT_signed_char_t, 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "ed25519_sign" "', argument " "4"" of type '" "std::vector< int8_t > &""'"); + } + if (!argp4) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "ed25519_sign" "', argument " "4"" of type '" "std::vector< int8_t > &""'"); + } + arg4 = (std::vector< int8_t > *)(argp4); + ed25519_sign(*arg1,*arg2,*arg3,*arg4); + jsresult = SWIGV8_UNDEFINED(); + + + + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_ed25519_verify(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle jsresult; + std::vector< int8_t > *arg1 = 0 ; + std::vector< int8_t > *arg2 = 0 ; + std::vector< int8_t > *arg3 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + int result; + + if(args.Length() != 3) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_ed25519_verify."); + + res1 = SWIG_ConvertPtr(args[0], &argp1, SWIGTYPE_p_std__vectorT_signed_char_t, 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ed25519_verify" "', argument " "1"" of type '" "std::vector< int8_t > &""'"); + } + if (!argp1) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "ed25519_verify" "', argument " "1"" of type '" "std::vector< int8_t > &""'"); + } + arg1 = (std::vector< int8_t > *)(argp1); + res2 = SWIG_ConvertPtr(args[1], &argp2, SWIGTYPE_p_std__vectorT_signed_char_t, 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ed25519_verify" "', argument " "2"" of type '" "std::vector< int8_t > &""'"); + } + if (!argp2) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "ed25519_verify" "', argument " "2"" of type '" "std::vector< int8_t > &""'"); + } + arg2 = (std::vector< int8_t > *)(argp2); + res3 = SWIG_ConvertPtr(args[2], &argp3, SWIGTYPE_p_std__vectorT_signed_char_t, 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ed25519_verify" "', argument " "3"" of type '" "std::vector< int8_t > &""'"); + } + if (!argp3) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "ed25519_verify" "', argument " "3"" of type '" "std::vector< int8_t > &""'"); + } + arg3 = (std::vector< int8_t > *)(argp3); + result = (int)ed25519_verify(*arg1,*arg2,*arg3); + jsresult = SWIG_From_int((int)(result)); + + + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_ed25519_add_scalar(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle jsresult; + std::vector< int8_t > *arg1 = 0 ; + std::vector< int8_t > *arg2 = 0 ; + std::vector< int8_t > *arg3 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + + if(args.Length() != 3) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_ed25519_add_scalar."); + + res1 = SWIG_ConvertPtr(args[0], &argp1, SWIGTYPE_p_std__vectorT_signed_char_t, 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ed25519_add_scalar" "', argument " "1"" of type '" "std::vector< int8_t > &""'"); + } + if (!argp1) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "ed25519_add_scalar" "', argument " "1"" of type '" "std::vector< int8_t > &""'"); + } + arg1 = (std::vector< int8_t > *)(argp1); + res2 = SWIG_ConvertPtr(args[1], &argp2, SWIGTYPE_p_std__vectorT_signed_char_t, 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ed25519_add_scalar" "', argument " "2"" of type '" "std::vector< int8_t > &""'"); + } + if (!argp2) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "ed25519_add_scalar" "', argument " "2"" of type '" "std::vector< int8_t > &""'"); + } + arg2 = (std::vector< int8_t > *)(argp2); + res3 = SWIG_ConvertPtr(args[2], &argp3, SWIGTYPE_p_std__vectorT_signed_char_t, 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ed25519_add_scalar" "', argument " "3"" of type '" "std::vector< int8_t > &""'"); + } + if (!argp3) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "ed25519_add_scalar" "', argument " "3"" of type '" "std::vector< int8_t > &""'"); + } + arg3 = (std::vector< int8_t > *)(argp3); + ed25519_add_scalar(*arg1,*arg2,*arg3); + jsresult = SWIGV8_UNDEFINED(); + + + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_ed25519_key_exchange(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle jsresult; + std::vector< int8_t > *arg1 = 0 ; + std::vector< int8_t > *arg2 = 0 ; + std::vector< int8_t > *arg3 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + + if(args.Length() != 3) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_ed25519_key_exchange."); + + res1 = SWIG_ConvertPtr(args[0], &argp1, SWIGTYPE_p_std__vectorT_signed_char_t, 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ed25519_key_exchange" "', argument " "1"" of type '" "std::vector< int8_t > &""'"); + } + if (!argp1) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "ed25519_key_exchange" "', argument " "1"" of type '" "std::vector< int8_t > &""'"); + } + arg1 = (std::vector< int8_t > *)(argp1); + res2 = SWIG_ConvertPtr(args[1], &argp2, SWIGTYPE_p_std__vectorT_signed_char_t, 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ed25519_key_exchange" "', argument " "2"" of type '" "std::vector< int8_t > &""'"); + } + if (!argp2) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "ed25519_key_exchange" "', argument " "2"" of type '" "std::vector< int8_t > &""'"); + } + arg2 = (std::vector< int8_t > *)(argp2); + res3 = SWIG_ConvertPtr(args[2], &argp3, SWIGTYPE_p_std__vectorT_signed_char_t, 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ed25519_key_exchange" "', argument " "3"" of type '" "std::vector< int8_t > &""'"); + } + if (!argp3) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "ed25519_key_exchange" "', argument " "3"" of type '" "std::vector< int8_t > &""'"); + } + arg3 = (std::vector< int8_t > *)(argp3); + ed25519_key_exchange(*arg1,*arg2,*arg3); + jsresult = SWIGV8_UNDEFINED(); + + + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + #if (SWIG_V8_VERSION < 0x031710) static void _wrap_delete_add_files_listener(v8::Persistent object, void *parameter) { SWIGV8_Proxy *proxy = static_cast(parameter); @@ -112742,7 +112628,6 @@ static swig_type_info _swigt__p_dht_extension_handler_listener = {"_p_dht_extens static swig_type_info _swigt__p_dht_item = {"_p_dht_item", "p_dht_item", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_dictionary_type = {"_p_dictionary_type", "dictionary_type *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_difference_type = {"_p_difference_type", "difference_type *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_ed25519 = {"_p_ed25519", "p_ed25519", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_filter_tuple_t = {"_p_filter_tuple_t", "filter_tuple_t *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_headers_t = {"_p_headers_t", "headers_t *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_int = {"_p_int", "intptr_t *|int *|int_least32_t *|int_fast32_t *|int32_t *|int_fast16_t *", 0, 0, (void*)0, 0}; @@ -112975,7 +112860,6 @@ static swig_type_info *swig_type_initial[] = { &_swigt__p_dht_item, &_swigt__p_dictionary_type, &_swigt__p_difference_type, - &_swigt__p_ed25519, &_swigt__p_filter_tuple_t, &_swigt__p_headers_t, &_swigt__p_int, @@ -113208,7 +113092,6 @@ static swig_cast_info _swigc__p_dht_extension_handler_listener[] = { {&_swigt__ static swig_cast_info _swigc__p_dht_item[] = { {&_swigt__p_dht_item, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_dictionary_type[] = { {&_swigt__p_dictionary_type, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_difference_type[] = { {&_swigt__p_difference_type, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_ed25519[] = { {&_swigt__p_ed25519, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_filter_tuple_t[] = { {&_swigt__p_filter_tuple_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_headers_t[] = { {&_swigt__p_headers_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_int[] = { {&_swigt__p_int, 0, 0, 0},{0, 0, 0, 0}}; @@ -113441,7 +113324,6 @@ static swig_cast_info *swig_cast_initial[] = { _swigc__p_dht_item, _swigc__p_dictionary_type, _swigc__p_difference_type, - _swigc__p_ed25519, _swigc__p_filter_tuple_t, _swigc__p_headers_t, _swigc__p_int, @@ -115245,13 +115127,6 @@ _exports_udp_endpoint_clientData.dtor = _wrap_delete_udp_endpoint; if (SWIGTYPE_p_udp__endpoint->clientdata == 0) { SWIGTYPE_p_udp__endpoint->clientdata = &_exports_udp_endpoint_clientData; } -/* Name: _exports_ed25519, Type: p_ed25519, Dtor: _wrap_delete_ed25519 */ -v8::Handle _exports_ed25519_class = SWIGV8_CreateClassTemplate("_exports_ed25519"); -SWIGV8_SET_CLASS_TEMPL(_exports_ed25519_clientData.class_templ, _exports_ed25519_class); -_exports_ed25519_clientData.dtor = _wrap_delete_ed25519; -if (SWIGTYPE_p_ed25519->clientdata == 0) { - SWIGTYPE_p_ed25519->clientdata = &_exports_ed25519_clientData; -} /* Name: _exports_dht_item, Type: p_dht_item, Dtor: _wrap_delete_dht_item */ v8::Handle _exports_dht_item_class = SWIGV8_CreateClassTemplate("_exports_dht_item"); SWIGV8_SET_CLASS_TEMPL(_exports_dht_item_clientData.class_templ, _exports_dht_item_class); @@ -117176,6 +117051,12 @@ SWIGV8_AddMemberVariable(_exports_torrent_status_class, "announcing_to_lsd", _wr SWIGV8_AddMemberVariable(_exports_torrent_status_class, "announcing_to_dht", _wrap_torrent_status_announcing_to_dht_get, _wrap_torrent_status_announcing_to_dht_set); SWIGV8_AddMemberVariable(_exports_torrent_status_class, "stop_when_ready", _wrap_torrent_status_stop_when_ready_get, _wrap_torrent_status_stop_when_ready_set); SWIGV8_AddMemberVariable(_exports_torrent_status_class, "info_hash", _wrap_torrent_status_info_hash_get, _wrap_torrent_status_info_hash_set); +SWIGV8_AddStaticVariable(exports_obj, "ed25519_seed_size", _wrap_ed25519_seed_size, JS_veto_set_variable); +SWIGV8_AddStaticVariable(exports_obj, "ed25519_private_key_size", _wrap_ed25519_private_key_size, JS_veto_set_variable); +SWIGV8_AddStaticVariable(exports_obj, "ed25519_public_key_size", _wrap_ed25519_public_key_size, JS_veto_set_variable); +SWIGV8_AddStaticVariable(exports_obj, "ed25519_signature_size", _wrap_ed25519_signature_size, JS_veto_set_variable); +SWIGV8_AddStaticVariable(exports_obj, "ed25519_scalar_size", _wrap_ed25519_scalar_size, JS_veto_set_variable); +SWIGV8_AddStaticVariable(exports_obj, "ed25519_shared_secret_size", _wrap_ed25519_shared_secret_size, JS_veto_set_variable); SWIGV8_AddMemberFunction(_exports_address_class, "is_v4", _wrap_address_is_v4); SWIGV8_AddMemberFunction(_exports_address_class, "is_v6", _wrap_address_is_v6); SWIGV8_AddMemberFunction(_exports_address_class, "to_v4", _wrap_address_to_v4); @@ -120197,12 +120078,6 @@ _exports_udp_endpoint_class_0->SetCallHandler(_wrap_new_udp_endpoint); _exports_udp_endpoint_class_0->Inherit(_exports_udp_endpoint_class); _exports_udp_endpoint_class_0->SetHiddenPrototype(true); v8::Handle _exports_udp_endpoint_obj = _exports_udp_endpoint_class_0->GetFunction(); -/* Class: ed25519 (_exports_ed25519) */ -v8::Handle _exports_ed25519_class_0 = SWIGV8_CreateClassTemplate("ed25519"); -_exports_ed25519_class_0->SetCallHandler(_wrap_new_ed25519); -_exports_ed25519_class_0->Inherit(_exports_ed25519_class); -_exports_ed25519_class_0->SetHiddenPrototype(true); -v8::Handle _exports_ed25519_obj = _exports_ed25519_class_0->GetFunction(); /* Class: dht_item (_exports_dht_item) */ v8::Handle _exports_dht_item_class_0 = SWIGV8_CreateClassTemplate("dht_item"); _exports_dht_item_class_0->SetCallHandler(_wrap_new_dht_item); @@ -121730,24 +121605,6 @@ SWIGV8_AddStaticFunction(_exports_address_v6_obj, "v4_mapped", _wrap_address_v6_ SWIGV8_AddStaticFunction(_exports_address_v6_obj, "v4_compatible", _wrap_address_v6_v4_compatible); SWIGV8_AddStaticFunction(exports_obj, "is_utp_stream_logging", _wrap_is_utp_stream_logging); SWIGV8_AddStaticFunction(exports_obj, "set_utp_stream_logging", _wrap_set_utp_stream_logging); -SWIGV8_AddStaticVariable(_exports_ed25519_obj, "seed_size", _wrap_ed25519_seed_size, JS_veto_set_variable); -SWIGV8_AddStaticVariable(_exports_ed25519_obj, "seed_size", _wrap_ed25519_seed_size, JS_veto_set_variable); -SWIGV8_AddStaticVariable(_exports_ed25519_obj, "private_key_size", _wrap_ed25519_private_key_size, JS_veto_set_variable); -SWIGV8_AddStaticVariable(_exports_ed25519_obj, "private_key_size", _wrap_ed25519_private_key_size, JS_veto_set_variable); -SWIGV8_AddStaticVariable(_exports_ed25519_obj, "public_key_size", _wrap_ed25519_public_key_size, JS_veto_set_variable); -SWIGV8_AddStaticVariable(_exports_ed25519_obj, "public_key_size", _wrap_ed25519_public_key_size, JS_veto_set_variable); -SWIGV8_AddStaticVariable(_exports_ed25519_obj, "signature_size", _wrap_ed25519_signature_size, JS_veto_set_variable); -SWIGV8_AddStaticVariable(_exports_ed25519_obj, "signature_size", _wrap_ed25519_signature_size, JS_veto_set_variable); -SWIGV8_AddStaticVariable(_exports_ed25519_obj, "scalar_size", _wrap_ed25519_scalar_size, JS_veto_set_variable); -SWIGV8_AddStaticVariable(_exports_ed25519_obj, "scalar_size", _wrap_ed25519_scalar_size, JS_veto_set_variable); -SWIGV8_AddStaticVariable(_exports_ed25519_obj, "shared_secret_size", _wrap_ed25519_shared_secret_size, JS_veto_set_variable); -SWIGV8_AddStaticVariable(_exports_ed25519_obj, "shared_secret_size", _wrap_ed25519_shared_secret_size, JS_veto_set_variable); -SWIGV8_AddStaticFunction(_exports_ed25519_obj, "create_seed", _wrap_ed25519_create_seed); -SWIGV8_AddStaticFunction(_exports_ed25519_obj, "create_keypair", _wrap_ed25519_create_keypair); -SWIGV8_AddStaticFunction(_exports_ed25519_obj, "sign", _wrap_ed25519_sign); -SWIGV8_AddStaticFunction(_exports_ed25519_obj, "verify", _wrap_ed25519_verify); -SWIGV8_AddStaticFunction(_exports_ed25519_obj, "add_scalar", _wrap_ed25519_add_scalar); -SWIGV8_AddStaticFunction(_exports_ed25519_obj, "key_exchange", _wrap_ed25519_key_exchange); SWIGV8_AddStaticFunction(_exports_dht_item_obj, "canonical_string", _wrap_dht_item_canonical_string); SWIGV8_AddStaticFunction(_exports_dht_item_obj, "item_target_id", _wrap_dht_item__wrap_dht_item_item_target_id); SWIGV8_AddStaticFunction(_exports_dht_item_obj, "verify_mutable_item", _wrap_dht_item_verify_mutable_item); @@ -121757,6 +121614,12 @@ SWIGV8_AddStaticFunction(exports_obj, "to_milliseconds", _wrap_to_milliseconds); SWIGV8_AddStaticFunction(exports_obj, "to_microseconds", _wrap_to_microseconds); SWIGV8_AddStaticFunction(exports_obj, "to_minutes", _wrap_to_minutes); SWIGV8_AddStaticFunction(exports_obj, "to_hours", _wrap_to_hours); +SWIGV8_AddStaticFunction(exports_obj, "ed25519_create_seed", _wrap_ed25519_create_seed); +SWIGV8_AddStaticFunction(exports_obj, "ed25519_create_keypair", _wrap_ed25519_create_keypair); +SWIGV8_AddStaticFunction(exports_obj, "ed25519_sign", _wrap_ed25519_sign); +SWIGV8_AddStaticFunction(exports_obj, "ed25519_verify", _wrap_ed25519_verify); +SWIGV8_AddStaticFunction(exports_obj, "ed25519_add_scalar", _wrap_ed25519_add_scalar); +SWIGV8_AddStaticFunction(exports_obj, "ed25519_key_exchange", _wrap_ed25519_key_exchange); SWIGV8_AddStaticFunction(exports_obj, "add_files_cb", _wrap_add_files_cb); SWIGV8_AddStaticFunction(exports_obj, "add_files_ex", _wrap_add_files_ex); SWIGV8_AddStaticFunction(exports_obj, "set_piece_hashes_ex", _wrap_set_piece_hashes_ex); @@ -121950,7 +121813,6 @@ exports_obj->Set(SWIGV8_SYMBOL_NEW("address_v6"), _exports_address_v6_obj); exports_obj->Set(SWIGV8_SYMBOL_NEW("high_resolution_clock"), _exports_high_resolution_clock_obj); exports_obj->Set(SWIGV8_SYMBOL_NEW("tcp_endpoint"), _exports_tcp_endpoint_obj); exports_obj->Set(SWIGV8_SYMBOL_NEW("udp_endpoint"), _exports_udp_endpoint_obj); -exports_obj->Set(SWIGV8_SYMBOL_NEW("ed25519"), _exports_ed25519_obj); exports_obj->Set(SWIGV8_SYMBOL_NEW("dht_item"), _exports_dht_item_obj); exports_obj->Set(SWIGV8_SYMBOL_NEW("add_files_listener"), _exports_add_files_listener_obj); exports_obj->Set(SWIGV8_SYMBOL_NEW("set_piece_hashes_listener"), _exports_set_piece_hashes_listener_obj);