├── README.md ├── ShadowPath.podspec ├── ShadowPath.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ ├── xcshareddata │ │ └── ShadowPath.xcscmblueprint │ └── xcuserdata │ │ └── mac.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ ├── bob.xcuserdatad │ └── xcschemes │ │ ├── ShadowPath.xcscheme │ │ ├── ShadowPathDemo.xcscheme │ │ └── xcschememanagement.plist │ ├── chenshijie.xcuserdatad │ └── xcschemes │ │ ├── ShadowPath.xcscheme │ │ ├── ShadowPathDemo.xcscheme │ │ └── xcschememanagement.plist │ ├── lewei.xcuserdatad │ └── xcschemes │ │ ├── ShadowPath.xcscheme │ │ ├── ShadowPathDemo.xcscheme │ │ └── xcschememanagement.plist │ ├── mac.xcuserdatad │ └── xcschemes │ │ └── xcschememanagement.plist │ └── th.xcuserdatad │ └── xcschemes │ ├── ShadowPath.xcscheme │ ├── ShadowPathDemo.xcscheme │ └── xcschememanagement.plist ├── ShadowPath ├── .DS_Store ├── Antinat │ ├── an_config.h │ ├── client │ │ ├── an_core.h │ │ ├── an_core.m │ │ ├── an_direct.m │ │ ├── an_internals.h │ │ ├── an_proxy.m │ │ ├── an_socks4.m │ │ ├── an_socks5.m │ │ ├── an_ssl.m │ │ ├── antinat.h │ │ ├── iscmd5.h │ │ └── iscmd5.m │ ├── expat-lib │ │ ├── include │ │ │ └── expat │ │ │ │ ├── expat.h │ │ │ │ └── expat_external.h │ │ └── lib │ │ │ └── libexpat.a │ ├── fmemopen.c │ ├── fmemopen.h │ └── server │ │ ├── AntinatServer.h │ │ ├── AntinatServer.m │ │ ├── addrinfo.m │ │ ├── an_main.h │ │ ├── an_main.m │ │ ├── an_serv.h │ │ ├── auth.m │ │ ├── config.m │ │ ├── conn.m │ │ ├── libds.m │ │ ├── loggers.m │ │ ├── os_unix.m │ │ ├── socks4.m │ │ └── socks5.m ├── Info.plist ├── Privoxy │ ├── actionlist.h │ ├── actions.h │ ├── actions.m │ ├── cgi.c │ ├── cgi.h │ ├── cgiedit.c │ ├── cgiedit.h │ ├── cgisimple.c │ ├── cgisimple.h │ ├── deanimate.c │ ├── deanimate.h │ ├── encode.c │ ├── encode.h │ ├── errlog.h │ ├── errlog.m │ ├── filters.c │ ├── filters.h │ ├── gateway.c │ ├── gateway.h │ ├── jbsockets.c │ ├── jbsockets.h │ ├── jcc.h │ ├── jcc.m │ ├── list.c │ ├── list.h │ ├── loadcfg.c │ ├── loadcfg.h │ ├── loaders.c │ ├── loaders.h │ ├── miscutil.c │ ├── miscutil.h │ ├── parsers.c │ ├── parsers.h │ ├── pcre │ │ ├── chartables.c │ │ ├── get.c │ │ ├── internal.h │ │ ├── pcre.c │ │ ├── pcre.h │ │ ├── pcreposix.c │ │ ├── pcreposix.h │ │ └── study.c │ ├── pcrs.c │ ├── pcrs.h │ ├── project.h │ ├── radix.c │ ├── radix.h │ ├── sp_config.h │ ├── ssplit.c │ ├── ssplit.h │ ├── urlmatch.c │ └── urlmatch.h ├── ShadowPath.h ├── libmaxminddb │ ├── AUTHORS │ ├── Changes.md │ ├── LICENSE │ ├── Makefile.am │ ├── NOTICE │ ├── README.dev.md │ ├── README.md │ ├── appveyor.yml │ ├── bin │ │ ├── Makefile.am │ │ └── mmdblookup.c │ ├── bootstrap │ ├── common.mk │ ├── configure.ac │ ├── dev-bin │ │ ├── make-man-pages.pl │ │ ├── make-release.sh │ │ ├── ppa-release.sh │ │ ├── regen-prototypes.pl │ │ ├── regen-win32-test-projs.pl │ │ ├── uncrustify-all.sh │ │ └── valgrind-all.pl │ ├── doc │ │ ├── libmaxminddb.md │ │ └── mmdblookup.md │ ├── include │ │ ├── maxminddb.h │ │ ├── maxminddb_config.h │ │ └── maxminddb_config.h.in │ ├── projects │ │ ├── VS12-tests │ │ │ ├── bad_pointers.vcxproj │ │ │ ├── basic_lookup.vcxproj │ │ │ ├── data_entry_list.vcxproj │ │ │ ├── data_types.vcxproj │ │ │ ├── dump.vcxproj │ │ │ ├── get_value.vcxproj │ │ │ ├── get_value_pointer_bug.vcxproj │ │ │ ├── ipv4_start_cache.vcxproj │ │ │ ├── ipv6_lookup_in_ipv4.vcxproj │ │ │ ├── libtap.vcxproj │ │ │ ├── maxminddb_test_helper.vcxproj │ │ │ ├── metadata.vcxproj │ │ │ ├── no_map_get_value.vcxproj │ │ │ ├── read_node.vcxproj │ │ │ ├── shared.vcxproj │ │ │ ├── threads.vcxproj │ │ │ └── version.vcxproj │ │ ├── VS12 │ │ │ ├── README.md │ │ │ ├── libmaxminddb-release.props │ │ │ ├── libmaxminddb-x64.props │ │ │ ├── libmaxminddb.props │ │ │ ├── libmaxminddb.sln │ │ │ ├── libmaxminddb.vcxproj │ │ │ ├── libmaxminddb.vcxproj.filters │ │ │ └── maxminddb_config.h │ │ └── test.vcxproj.template │ ├── src │ │ ├── Makefile.am │ │ ├── libmaxminddb.pc.in │ │ ├── maxminddb-compat-util.h │ │ └── maxminddb.c │ └── t │ │ ├── Makefile.am │ │ ├── bad_pointers_t.c │ │ ├── basic_lookup_t.c │ │ ├── compile_c++_t.pl │ │ ├── data_entry_list_t.c │ │ ├── data_types_t.c │ │ ├── dump_t.c │ │ ├── get_value_pointer_bug_t.c │ │ ├── get_value_t.c │ │ ├── ipv4_start_cache_t.c │ │ ├── ipv6_lookup_in_ipv4_t.c │ │ ├── maxminddb_test_helper.c │ │ ├── maxminddb_test_helper.h │ │ ├── metadata_pointers_t.c │ │ ├── metadata_t.c │ │ ├── mmdblookup_t.pl │ │ ├── no_map_get_value_t.c │ │ ├── read_node_t.c │ │ ├── threads_t.c │ │ └── version_t.c ├── libopenssl │ ├── .DS_Store │ ├── include │ │ ├── .DS_Store │ │ ├── LICENSE │ │ └── openssl │ │ │ ├── aes.h │ │ │ ├── asn1.h │ │ │ ├── asn1_mac.h │ │ │ ├── asn1t.h │ │ │ ├── bio.h │ │ │ ├── blowfish.h │ │ │ ├── bn.h │ │ │ ├── buffer.h │ │ │ ├── camellia.h │ │ │ ├── cast.h │ │ │ ├── cmac.h │ │ │ ├── cms.h │ │ │ ├── comp.h │ │ │ ├── conf.h │ │ │ ├── conf_api.h │ │ │ ├── crypto.h │ │ │ ├── des.h │ │ │ ├── des_old.h │ │ │ ├── dh.h │ │ │ ├── dsa.h │ │ │ ├── dso.h │ │ │ ├── dtls1.h │ │ │ ├── e_os2.h │ │ │ ├── ebcdic.h │ │ │ ├── ec.h │ │ │ ├── ecdh.h │ │ │ ├── ecdsa.h │ │ │ ├── engine.h │ │ │ ├── err.h │ │ │ ├── evp.h │ │ │ ├── hmac.h │ │ │ ├── idea.h │ │ │ ├── krb5_asn.h │ │ │ ├── kssl.h │ │ │ ├── lhash.h │ │ │ ├── md4.h │ │ │ ├── md5.h │ │ │ ├── mdc2.h │ │ │ ├── modes.h │ │ │ ├── obj_mac.h │ │ │ ├── objects.h │ │ │ ├── ocsp.h │ │ │ ├── opensslconf.h │ │ │ ├── opensslconf_ios_arm64.h │ │ │ ├── opensslconf_ios_armv7.h │ │ │ ├── opensslconf_ios_armv7s.h │ │ │ ├── opensslconf_ios_i386.h │ │ │ ├── opensslconf_tvos_arm64.h │ │ │ ├── opensslconf_tvos_x86_64.h │ │ │ ├── opensslv.h │ │ │ ├── ossl_typ.h │ │ │ ├── pem.h │ │ │ ├── pem2.h │ │ │ ├── pkcs12.h │ │ │ ├── pkcs7.h │ │ │ ├── pqueue.h │ │ │ ├── rand.h │ │ │ ├── rc2.h │ │ │ ├── rc4.h │ │ │ ├── ripemd.h │ │ │ ├── rsa.h │ │ │ ├── safestack.h │ │ │ ├── seed.h │ │ │ ├── sha.h │ │ │ ├── srp.h │ │ │ ├── srtp.h │ │ │ ├── ssl.h │ │ │ ├── ssl2.h │ │ │ ├── ssl23.h │ │ │ ├── ssl3.h │ │ │ ├── stack.h │ │ │ ├── symhacks.h │ │ │ ├── tls1.h │ │ │ ├── ts.h │ │ │ ├── txt_db.h │ │ │ ├── ui.h │ │ │ ├── ui_compat.h │ │ │ ├── whrlpool.h │ │ │ ├── x509.h │ │ │ ├── x509_vfy.h │ │ │ └── x509v3.h │ └── lib │ │ ├── libcrypto.a │ │ └── libssl.a ├── libsodium-ios │ ├── include │ │ ├── sodium.h │ │ └── sodium │ │ │ ├── core.h │ │ │ ├── crypto_aead_aes256gcm.h │ │ │ ├── crypto_aead_chacha20poly1305.h │ │ │ ├── crypto_auth.h │ │ │ ├── crypto_auth_hmacsha256.h │ │ │ ├── crypto_auth_hmacsha512.h │ │ │ ├── crypto_auth_hmacsha512256.h │ │ │ ├── crypto_box.h │ │ │ ├── crypto_box_curve25519xsalsa20poly1305.h │ │ │ ├── crypto_core_hchacha20.h │ │ │ ├── crypto_core_hsalsa20.h │ │ │ ├── crypto_core_salsa20.h │ │ │ ├── crypto_core_salsa2012.h │ │ │ ├── crypto_core_salsa208.h │ │ │ ├── crypto_generichash.h │ │ │ ├── crypto_generichash_blake2b.h │ │ │ ├── crypto_hash.h │ │ │ ├── crypto_hash_sha256.h │ │ │ ├── crypto_hash_sha512.h │ │ │ ├── crypto_int32.h │ │ │ ├── crypto_int64.h │ │ │ ├── crypto_onetimeauth.h │ │ │ ├── crypto_onetimeauth_poly1305.h │ │ │ ├── crypto_pwhash.h │ │ │ ├── crypto_pwhash_argon2i.h │ │ │ ├── crypto_pwhash_scryptsalsa208sha256.h │ │ │ ├── crypto_scalarmult.h │ │ │ ├── crypto_scalarmult_curve25519.h │ │ │ ├── crypto_secretbox.h │ │ │ ├── crypto_secretbox_xsalsa20poly1305.h │ │ │ ├── crypto_shorthash.h │ │ │ ├── crypto_shorthash_siphash24.h │ │ │ ├── crypto_sign.h │ │ │ ├── crypto_sign_ed25519.h │ │ │ ├── crypto_sign_edwards25519sha512batch.h │ │ │ ├── crypto_stream.h │ │ │ ├── crypto_stream_aes128ctr.h │ │ │ ├── crypto_stream_chacha20.h │ │ │ ├── crypto_stream_salsa20.h │ │ │ ├── crypto_stream_salsa2012.h │ │ │ ├── crypto_stream_salsa208.h │ │ │ ├── crypto_stream_xsalsa20.h │ │ │ ├── crypto_uint16.h │ │ │ ├── crypto_uint32.h │ │ │ ├── crypto_uint64.h │ │ │ ├── crypto_uint8.h │ │ │ ├── crypto_verify_16.h │ │ │ ├── crypto_verify_32.h │ │ │ ├── crypto_verify_64.h │ │ │ ├── export.h │ │ │ ├── randombytes.h │ │ │ ├── randombytes_salsa20_random.h │ │ │ ├── randombytes_sysrandom.h │ │ │ ├── runtime.h │ │ │ ├── utils.h │ │ │ └── version.h │ └── lib │ │ └── libsodium.a ├── mbedtls │ ├── .DS_Store │ ├── include │ │ ├── .DS_Store │ │ └── mbedtls │ │ │ ├── LICENSE │ │ │ ├── aes.h │ │ │ ├── aesni.h │ │ │ ├── arc4.h │ │ │ ├── asn1.h │ │ │ ├── asn1write.h │ │ │ ├── base64.h │ │ │ ├── bignum.h │ │ │ ├── blowfish.h │ │ │ ├── bn_mul.h │ │ │ ├── camellia.h │ │ │ ├── ccm.h │ │ │ ├── certs.h │ │ │ ├── check_config.h │ │ │ ├── cipher.h │ │ │ ├── cipher_internal.h │ │ │ ├── compat-1.3.h │ │ │ ├── ctr_drbg.h │ │ │ ├── debug.h │ │ │ ├── des.h │ │ │ ├── dhm.h │ │ │ ├── ecdh.h │ │ │ ├── ecdsa.h │ │ │ ├── ecp.h │ │ │ ├── entropy.h │ │ │ ├── entropy_poll.h │ │ │ ├── error.h │ │ │ ├── gcm.h │ │ │ ├── havege.h │ │ │ ├── hmac_drbg.h │ │ │ ├── mb_config.h │ │ │ ├── md.h │ │ │ ├── md2.h │ │ │ ├── md4.h │ │ │ ├── md5.h │ │ │ ├── md_internal.h │ │ │ ├── memory_buffer_alloc.h │ │ │ ├── net.h │ │ │ ├── oid.h │ │ │ ├── padlock.h │ │ │ ├── pem.h │ │ │ ├── pk.h │ │ │ ├── pk_internal.h │ │ │ ├── pkcs11.h │ │ │ ├── pkcs12.h │ │ │ ├── pkcs5.h │ │ │ ├── platform.h │ │ │ ├── ripemd160.h │ │ │ ├── rsa.h │ │ │ ├── sha1.h │ │ │ ├── sha256.h │ │ │ ├── sha512.h │ │ │ ├── ssl.h │ │ │ ├── ssl_cache.h │ │ │ ├── ssl_ciphersuites.h │ │ │ ├── ssl_cookie.h │ │ │ ├── ssl_internal.h │ │ │ ├── ssl_ticket.h │ │ │ ├── threading.h │ │ │ ├── timing.h │ │ │ ├── version.h │ │ │ ├── x509.h │ │ │ ├── x509_crl.h │ │ │ ├── x509_crt.h │ │ │ ├── x509_csr.h │ │ │ └── xtea.h │ └── lib │ │ └── libmbedtls.a └── shadowsocks-libev │ ├── .DS_Store │ ├── AUTHORS │ ├── COPYING │ ├── Changes │ ├── INSTALL │ ├── LICENSE │ ├── Makefile.am │ ├── Makefile.in │ ├── README.md │ ├── acl │ ├── chn.acl │ └── local.acl │ ├── aclocal.m4 │ ├── auto │ ├── ar-lib │ ├── compile │ ├── config.guess │ ├── config.sub │ ├── depcomp │ ├── install-sh │ ├── ltmain.sh │ └── missing │ ├── autogen.sh │ ├── config.h │ ├── config.h.in │ ├── config.log │ ├── configure │ ├── configure.ac │ ├── debian │ ├── .gitignore │ ├── README.Debian │ ├── changelog │ ├── compat │ ├── config.json │ ├── control │ ├── copyright │ ├── copyright.original │ ├── libshadowsocks-libev-dev.install │ ├── libshadowsocks-libev1.install │ ├── rules │ ├── shadowsocks-libev-local@.service │ ├── shadowsocks-libev-redir@.service │ ├── shadowsocks-libev-server@.service │ ├── shadowsocks-libev-tunnel@.service │ ├── shadowsocks-libev.default │ ├── shadowsocks-libev.docs │ ├── shadowsocks-libev.init │ ├── shadowsocks-libev.install │ ├── shadowsocks-libev.postinst │ ├── shadowsocks-libev.postrm │ ├── shadowsocks-libev.service │ ├── source.lintian-overrides │ ├── source │ │ └── format │ └── watch │ ├── doc │ ├── Makefile.am │ ├── Makefile.in │ ├── asciidoc.conf │ ├── manpage-base.xsl │ ├── manpage-bold-literal.xsl │ ├── manpage-normal.xsl │ ├── shadowsocks-libev.asciidoc │ ├── ss-local.asciidoc │ ├── ss-manager.asciidoc │ ├── ss-nat.asciidoc │ ├── ss-redir.asciidoc │ ├── ss-server.asciidoc │ └── ss-tunnel.asciidoc │ ├── docker │ ├── alpine │ │ ├── Dockerfile │ │ ├── README.md │ │ └── docker-compose.yml │ └── ubuntu │ │ ├── Dockerfile │ │ ├── README.md │ │ └── entrypoint │ ├── libcork │ ├── COPYING │ ├── Makefile.am │ ├── Makefile.in │ ├── README.markdown │ ├── cli │ │ └── commands.c │ ├── core │ │ ├── allocator.c │ │ ├── error.c │ │ ├── gc.c │ │ ├── hash.c │ │ ├── ip-address.c │ │ ├── mempool.c │ │ ├── timestamp.c │ │ └── u128.c │ ├── ds │ │ ├── array.c │ │ ├── bitset.c │ │ ├── buffer.c │ │ ├── dllist.c │ │ ├── file-stream.c │ │ ├── hash-table.c │ │ ├── managed-buffer.c │ │ ├── ring-buffer.c │ │ └── slice.c │ ├── include │ │ └── libcork │ │ │ ├── cli.h │ │ │ ├── cli │ │ │ └── commands.h │ │ │ ├── config.h │ │ │ ├── config │ │ │ ├── arch.h │ │ │ ├── bsd.h │ │ │ ├── config.h │ │ │ ├── gcc.h │ │ │ ├── linux.h │ │ │ ├── macosx.h │ │ │ ├── mingw32.h │ │ │ └── solaris.h │ │ │ ├── core.h │ │ │ ├── core │ │ │ ├── allocator.h │ │ │ ├── api.h │ │ │ ├── attributes.h │ │ │ ├── byte-order.h │ │ │ ├── callbacks.h │ │ │ ├── error.h │ │ │ ├── gc.h │ │ │ ├── hash.h │ │ │ ├── id.h │ │ │ ├── mempool.h │ │ │ ├── net-addresses.h │ │ │ ├── timestamp.h │ │ │ ├── types.h │ │ │ └── u128.h │ │ │ ├── ds.h │ │ │ ├── ds │ │ │ ├── array.h │ │ │ ├── bitset.h │ │ │ ├── buffer.h │ │ │ ├── dllist.h │ │ │ ├── hash-table.h │ │ │ ├── managed-buffer.h │ │ │ ├── ring-buffer.h │ │ │ ├── slice.h │ │ │ └── stream.h │ │ │ ├── helpers │ │ │ ├── errors.h │ │ │ ├── gc.h │ │ │ └── posix.h │ │ │ ├── os.h │ │ │ ├── os │ │ │ ├── files.h │ │ │ ├── process.h │ │ │ └── subprocess.h │ │ │ ├── threads.h │ │ │ └── threads │ │ │ ├── atomics.h │ │ │ └── basics.h │ ├── posix │ │ ├── directory-walker.c │ │ ├── env.c │ │ ├── exec.c │ │ ├── files.c │ │ ├── process.c │ │ └── subprocess.c │ └── pthreads │ │ └── thread.c │ ├── libev │ ├── Changes │ ├── LICENSE │ ├── Makefile.am │ ├── Makefile.in │ ├── README │ ├── Symbols.ev │ ├── Symbols.event │ ├── aclocal.m4 │ ├── autogen.sh │ ├── configure.ac │ ├── ev++.h │ ├── ev.3 │ ├── ev.c │ ├── ev.h │ ├── ev.pod │ ├── ev_epoll.c │ ├── ev_kqueue.c │ ├── ev_poll.c │ ├── ev_port.c │ ├── ev_select.c │ ├── ev_vars.h │ ├── ev_win32.c │ ├── ev_wrap.h │ ├── event.c │ ├── event.h │ └── libev.m4 │ ├── libipset │ ├── LICENSE.txt │ ├── Makefile.am │ ├── Makefile.in │ ├── README.markdown │ ├── bdd │ │ ├── Makefile.am │ │ ├── Makefile.in │ │ ├── assignments.c │ │ ├── basics.c │ │ ├── bdd-iterator.c │ │ ├── expanded.c │ │ ├── reachable.c │ │ ├── read.c │ │ └── write.c │ ├── general.c │ ├── include │ │ └── ipset │ │ │ ├── bdd │ │ │ └── nodes.h │ │ │ ├── bits.h │ │ │ ├── errors.h │ │ │ ├── ipset.h │ │ │ └── logging.h │ ├── map │ │ ├── Makefile.am │ │ ├── Makefile.in │ │ ├── allocation.c │ │ ├── inspection-template.c.in │ │ ├── inspection.c │ │ ├── ipv4_map.c │ │ ├── ipv6_map.c │ │ └── storage.c │ └── set │ │ ├── Makefile.am │ │ ├── Makefile.in │ │ ├── allocation.c │ │ ├── inspection-template.c.in │ │ ├── inspection.c │ │ ├── ipv4_set.c │ │ ├── ipv6_set.c │ │ ├── iterator.c │ │ └── storage.c │ ├── libsodium │ ├── .gitignore │ ├── .travis.yml │ ├── AUTHORS │ ├── ChangeLog │ ├── LICENSE │ ├── Makefile.am │ ├── Makefile.in │ ├── README │ ├── README.markdown │ ├── THANKS │ ├── autogen.sh │ ├── build-aux │ │ ├── config.guess │ │ ├── config.sub │ │ ├── depcomp │ │ ├── install-sh │ │ ├── ltmain.sh │ │ └── missing │ ├── configure │ ├── configure.ac │ ├── libsodium.pc.in │ ├── libsodium.sln │ ├── libsodium.vcxproj │ ├── libsodium.vcxproj.filters │ ├── logo.png │ ├── m4 │ │ ├── ax_check_compile_flag.m4 │ │ ├── ax_check_define.m4 │ │ ├── ax_check_gnu_make.m4 │ │ ├── ax_check_link_flag.m4 │ │ ├── ld-output-def.m4 │ │ └── pkg.m4 │ ├── packaging │ │ └── nuget │ │ │ ├── .gitignore │ │ │ ├── package.bat │ │ │ ├── package.config │ │ │ └── package.gsl │ └── src │ │ ├── Makefile.am │ │ ├── Makefile.in │ │ └── libsodium │ │ ├── Makefile.am │ │ ├── Makefile.in │ │ ├── crypto_aead │ │ ├── aes256gcm │ │ │ └── aesni │ │ │ │ └── aead_aes256gcm_aesni.c │ │ └── chacha20poly1305 │ │ │ └── sodium │ │ │ └── aead_chacha20poly1305.c │ │ ├── crypto_auth │ │ ├── crypto_auth.c │ │ ├── hmacsha256 │ │ │ ├── auth_hmacsha256_api.c │ │ │ └── cp │ │ │ │ ├── hmac_hmacsha256.c │ │ │ │ └── verify_hmacsha256.c │ │ ├── hmacsha512 │ │ │ ├── auth_hmacsha512_api.c │ │ │ └── cp │ │ │ │ ├── hmac_hmacsha512.c │ │ │ │ └── verify_hmacsha512.c │ │ └── hmacsha512256 │ │ │ ├── auth_hmacsha512256_api.c │ │ │ └── cp │ │ │ ├── hmac_hmacsha512256.c │ │ │ └── verify_hmacsha512256.c │ │ ├── crypto_box │ │ ├── crypto_box.c │ │ ├── crypto_box_easy.c │ │ ├── crypto_box_seal.c │ │ └── curve25519xsalsa20poly1305 │ │ │ ├── box_curve25519xsalsa20poly1305_api.c │ │ │ └── ref │ │ │ ├── after_curve25519xsalsa20poly1305.c │ │ │ ├── before_curve25519xsalsa20poly1305.c │ │ │ ├── box_curve25519xsalsa20poly1305.c │ │ │ └── keypair_curve25519xsalsa20poly1305.c │ │ ├── crypto_core │ │ ├── hsalsa20 │ │ │ ├── core_hsalsa20_api.c │ │ │ └── ref2 │ │ │ │ └── core_hsalsa20.c │ │ ├── salsa20 │ │ │ ├── core_salsa20_api.c │ │ │ └── ref │ │ │ │ └── core_salsa20.c │ │ ├── salsa2012 │ │ │ ├── core_salsa2012_api.c │ │ │ └── ref │ │ │ │ └── core_salsa2012.c │ │ └── salsa208 │ │ │ ├── core_salsa208_api.c │ │ │ └── ref │ │ │ └── core_salsa208.c │ │ ├── crypto_generichash │ │ ├── blake2 │ │ │ ├── generichash_blake2_api.c │ │ │ └── ref │ │ │ │ ├── blake2-impl.h │ │ │ │ ├── blake2.h │ │ │ │ ├── blake2b-compress-ref.c │ │ │ │ ├── blake2b-compress-sse41.c │ │ │ │ ├── blake2b-compress-ssse3.c │ │ │ │ ├── blake2b-load-sse2.h │ │ │ │ ├── blake2b-load-sse41.h │ │ │ │ ├── blake2b-ref.c │ │ │ │ ├── blake2b-round.h │ │ │ │ └── generichash_blake2b.c │ │ └── crypto_generichash.c │ │ ├── crypto_hash │ │ ├── crypto_hash.c │ │ ├── sha256 │ │ │ ├── cp │ │ │ │ └── hash_sha256.c │ │ │ └── hash_sha256_api.c │ │ └── sha512 │ │ │ ├── cp │ │ │ └── hash_sha512.c │ │ │ └── hash_sha512_api.c │ │ ├── crypto_onetimeauth │ │ ├── crypto_onetimeauth.c │ │ └── poly1305 │ │ │ ├── donna │ │ │ ├── poly1305_donna.c │ │ │ ├── poly1305_donna.h │ │ │ ├── poly1305_donna32.h │ │ │ └── poly1305_donna64.h │ │ │ ├── onetimeauth_poly1305.c │ │ │ ├── onetimeauth_poly1305.h │ │ │ └── sse2 │ │ │ ├── poly1305_sse2.c │ │ │ └── poly1305_sse2.h │ │ ├── crypto_pwhash │ │ └── scryptsalsa208sha256 │ │ │ ├── crypto_scrypt-common.c │ │ │ ├── crypto_scrypt.h │ │ │ ├── nosse │ │ │ └── pwhash_scryptsalsa208sha256_nosse.c │ │ │ ├── pbkdf2-sha256.c │ │ │ ├── pbkdf2-sha256.h │ │ │ ├── pwhash_scryptsalsa208sha256.c │ │ │ ├── scrypt_platform.c │ │ │ ├── sse │ │ │ └── pwhash_scryptsalsa208sha256_sse.c │ │ │ └── sysendian.h │ │ ├── crypto_scalarmult │ │ ├── crypto_scalarmult.c │ │ └── curve25519 │ │ │ ├── donna_c64 │ │ │ ├── curve25519_donna_c64.c │ │ │ └── curve25519_donna_c64.h │ │ │ ├── ref10 │ │ │ ├── curve25519_ref10.c │ │ │ ├── curve25519_ref10.h │ │ │ ├── fe.h │ │ │ ├── fe_0_curve25519_ref10.c │ │ │ ├── fe_1_curve25519_ref10.c │ │ │ ├── fe_add_curve25519_ref10.c │ │ │ ├── fe_copy_curve25519_ref10.c │ │ │ ├── fe_cswap_curve25519_ref10.c │ │ │ ├── fe_frombytes_curve25519_ref10.c │ │ │ ├── fe_invert_curve25519_ref10.c │ │ │ ├── fe_mul121666_curve25519_ref10.c │ │ │ ├── fe_mul_curve25519_ref10.c │ │ │ ├── fe_sq_curve25519_ref10.c │ │ │ ├── fe_sub_curve25519_ref10.c │ │ │ ├── fe_tobytes_curve25519_ref10.c │ │ │ ├── montgomery.h │ │ │ └── pow225521.h │ │ │ ├── sandy2x │ │ │ ├── consts.S │ │ │ ├── consts_namespace.h │ │ │ ├── curve25519_sandy2x.c │ │ │ ├── curve25519_sandy2x.h │ │ │ ├── fe.h │ │ │ ├── fe51.h │ │ │ ├── fe51_invert.c │ │ │ ├── fe51_mul.S │ │ │ ├── fe51_namespace.h │ │ │ ├── fe51_nsquare.S │ │ │ ├── fe51_pack.S │ │ │ ├── fe_frombytes_sandy2x.c │ │ │ ├── ladder.S │ │ │ ├── ladder.h │ │ │ ├── ladder_base.S │ │ │ ├── ladder_base.h │ │ │ ├── ladder_base_namespace.h │ │ │ ├── ladder_namespace.h │ │ │ └── sandy2x.S │ │ │ ├── scalarmult_curve25519.c │ │ │ └── scalarmult_curve25519.h │ │ ├── crypto_secretbox │ │ ├── crypto_secretbox.c │ │ ├── crypto_secretbox_easy.c │ │ └── xsalsa20poly1305 │ │ │ ├── ref │ │ │ └── box_xsalsa20poly1305.c │ │ │ └── secretbox_xsalsa20poly1305_api.c │ │ ├── crypto_shorthash │ │ ├── crypto_shorthash.c │ │ └── siphash24 │ │ │ ├── ref │ │ │ └── shorthash_siphash24.c │ │ │ └── shorthash_siphash24_api.c │ │ ├── crypto_sign │ │ ├── crypto_sign.c │ │ └── ed25519 │ │ │ ├── description │ │ │ ├── ref10 │ │ │ ├── base.h │ │ │ ├── base2.h │ │ │ ├── d.h │ │ │ ├── d2.h │ │ │ ├── fe.h │ │ │ ├── fe_0.c │ │ │ ├── fe_1.c │ │ │ ├── fe_add.c │ │ │ ├── fe_cmov.c │ │ │ ├── fe_copy.c │ │ │ ├── fe_frombytes.c │ │ │ ├── fe_invert.c │ │ │ ├── fe_isnegative.c │ │ │ ├── fe_isnonzero.c │ │ │ ├── fe_mul.c │ │ │ ├── fe_neg.c │ │ │ ├── fe_pow22523.c │ │ │ ├── fe_sq.c │ │ │ ├── fe_sq2.c │ │ │ ├── fe_sub.c │ │ │ ├── fe_tobytes.c │ │ │ ├── ge.h │ │ │ ├── ge_add.c │ │ │ ├── ge_add.h │ │ │ ├── ge_double_scalarmult.c │ │ │ ├── ge_frombytes.c │ │ │ ├── ge_madd.c │ │ │ ├── ge_madd.h │ │ │ ├── ge_msub.c │ │ │ ├── ge_msub.h │ │ │ ├── ge_p1p1_to_p2.c │ │ │ ├── ge_p1p1_to_p3.c │ │ │ ├── ge_p2_0.c │ │ │ ├── ge_p2_dbl.c │ │ │ ├── ge_p2_dbl.h │ │ │ ├── ge_p3_0.c │ │ │ ├── ge_p3_dbl.c │ │ │ ├── ge_p3_to_cached.c │ │ │ ├── ge_p3_to_p2.c │ │ │ ├── ge_p3_tobytes.c │ │ │ ├── ge_precomp_0.c │ │ │ ├── ge_scalarmult_base.c │ │ │ ├── ge_sub.c │ │ │ ├── ge_sub.h │ │ │ ├── ge_tobytes.c │ │ │ ├── keypair.c │ │ │ ├── obsolete.c │ │ │ ├── open.c │ │ │ ├── pow22523.h │ │ │ ├── pow225521.h │ │ │ ├── sc.h │ │ │ ├── sc_muladd.c │ │ │ ├── sc_reduce.c │ │ │ ├── sign.c │ │ │ └── sqrtm1.h │ │ │ └── sign_ed25519_api.c │ │ ├── crypto_stream │ │ ├── aes128ctr │ │ │ ├── portable │ │ │ │ ├── afternm_aes128ctr.c │ │ │ │ ├── beforenm_aes128ctr.c │ │ │ │ ├── common.h │ │ │ │ ├── common_aes128ctr.c │ │ │ │ ├── consts.h │ │ │ │ ├── consts_aes128ctr.c │ │ │ │ ├── int128.h │ │ │ │ ├── int128_aes128ctr.c │ │ │ │ ├── stream_aes128ctr.c │ │ │ │ ├── types.h │ │ │ │ └── xor_afternm_aes128ctr.c │ │ │ └── stream_aes128ctr_api.c │ │ ├── chacha20 │ │ │ ├── ref │ │ │ │ ├── stream_chacha20_ref.c │ │ │ │ └── stream_chacha20_ref.h │ │ │ ├── stream_chacha20.c │ │ │ ├── stream_chacha20.h │ │ │ └── vec │ │ │ │ ├── stream_chacha20_vec.c │ │ │ │ └── stream_chacha20_vec.h │ │ ├── crypto_stream.c │ │ ├── salsa20 │ │ │ ├── amd64_xmm6 │ │ │ │ └── stream_salsa20_amd64_xmm6.S │ │ │ ├── ref │ │ │ │ ├── stream_salsa20_ref.c │ │ │ │ └── xor_salsa20_ref.c │ │ │ └── stream_salsa20_api.c │ │ ├── salsa2012 │ │ │ ├── ref │ │ │ │ ├── stream_salsa2012.c │ │ │ │ └── xor_salsa2012.c │ │ │ └── stream_salsa2012_api.c │ │ ├── salsa208 │ │ │ ├── ref │ │ │ │ ├── stream_salsa208.c │ │ │ │ └── xor_salsa208.c │ │ │ └── stream_salsa208_api.c │ │ └── xsalsa20 │ │ │ ├── ref │ │ │ ├── stream_xsalsa20.c │ │ │ └── xor_xsalsa20.c │ │ │ └── stream_xsalsa20_api.c │ │ ├── crypto_verify │ │ ├── 16 │ │ │ ├── ref │ │ │ │ └── verify_16.c │ │ │ └── verify_16_api.c │ │ ├── 32 │ │ │ ├── ref │ │ │ │ └── verify_32.c │ │ │ └── verify_32_api.c │ │ └── 64 │ │ │ ├── ref │ │ │ └── verify_64.c │ │ │ └── verify_64_api.c │ │ ├── include │ │ ├── Makefile.am │ │ ├── Makefile.in │ │ ├── sodium.h │ │ └── sodium │ │ │ ├── core.h │ │ │ ├── crypto_aead_aes256gcm.h │ │ │ ├── crypto_aead_chacha20poly1305.h │ │ │ ├── crypto_auth.h │ │ │ ├── crypto_auth_hmacsha256.h │ │ │ ├── crypto_auth_hmacsha512.h │ │ │ ├── crypto_auth_hmacsha512256.h │ │ │ ├── crypto_box.h │ │ │ ├── crypto_box_curve25519xsalsa20poly1305.h │ │ │ ├── crypto_core_hsalsa20.h │ │ │ ├── crypto_core_salsa20.h │ │ │ ├── crypto_core_salsa2012.h │ │ │ ├── crypto_core_salsa208.h │ │ │ ├── crypto_generichash.h │ │ │ ├── crypto_generichash_blake2b.h │ │ │ ├── crypto_hash.h │ │ │ ├── crypto_hash_sha256.h │ │ │ ├── crypto_hash_sha512.h │ │ │ ├── crypto_int32.h │ │ │ ├── crypto_int64.h │ │ │ ├── crypto_onetimeauth.h │ │ │ ├── crypto_onetimeauth_poly1305.h │ │ │ ├── crypto_pwhash_scryptsalsa208sha256.h │ │ │ ├── crypto_scalarmult.h │ │ │ ├── crypto_scalarmult_curve25519.h │ │ │ ├── crypto_secretbox.h │ │ │ ├── crypto_secretbox_xsalsa20poly1305.h │ │ │ ├── crypto_shorthash.h │ │ │ ├── crypto_shorthash_siphash24.h │ │ │ ├── crypto_sign.h │ │ │ ├── crypto_sign_ed25519.h │ │ │ ├── crypto_sign_edwards25519sha512batch.h │ │ │ ├── crypto_stream.h │ │ │ ├── crypto_stream_aes128ctr.h │ │ │ ├── crypto_stream_chacha20.h │ │ │ ├── crypto_stream_salsa20.h │ │ │ ├── crypto_stream_salsa2012.h │ │ │ ├── crypto_stream_salsa208.h │ │ │ ├── crypto_stream_xsalsa20.h │ │ │ ├── crypto_uint16.h │ │ │ ├── crypto_uint32.h │ │ │ ├── crypto_uint64.h │ │ │ ├── crypto_uint8.h │ │ │ ├── crypto_verify_16.h │ │ │ ├── crypto_verify_32.h │ │ │ ├── crypto_verify_64.h │ │ │ ├── export.h │ │ │ ├── randombytes.h │ │ │ ├── randombytes_nativeclient.h │ │ │ ├── randombytes_salsa20_random.h │ │ │ ├── randombytes_sysrandom.h │ │ │ ├── runtime.h │ │ │ ├── utils.h │ │ │ └── version.h.in │ │ ├── randombytes │ │ ├── nativeclient │ │ │ └── randombytes_nativeclient.c │ │ ├── randombytes.c │ │ ├── salsa20 │ │ │ └── randombytes_salsa20_random.c │ │ └── sysrandom │ │ │ └── randombytes_sysrandom.c │ │ └── sodium │ │ ├── core.c │ │ ├── runtime.c │ │ ├── utils.c │ │ └── version.c │ ├── libudns │ ├── COPYING.LGPL │ ├── Makefile.am │ ├── Makefile.in │ ├── NEWS │ ├── NOTES │ ├── TODO │ ├── dnsget.1 │ ├── dnsget.c │ ├── ex-rdns.c │ ├── getopt.c │ ├── inet_XtoX.c │ ├── rblcheck.1 │ ├── rblcheck.c │ ├── udns.3 │ ├── udns.h │ ├── udns_XtoX.c │ ├── udns_bl.c │ ├── udns_codes.c │ ├── udns_dn.c │ ├── udns_dntosp.c │ ├── udns_init.c │ ├── udns_jran.c │ ├── udns_misc.c │ ├── udns_parse.c │ ├── udns_resolver.c │ ├── udns_rr_a.c │ ├── udns_rr_mx.c │ ├── udns_rr_naptr.c │ ├── udns_rr_ptr.c │ ├── udns_rr_srv.c │ └── udns_rr_txt.c │ ├── m4 │ ├── ax_pthread.m4 │ ├── ax_tls.m4 │ ├── inet_ntop.m4 │ ├── libtool.m4 │ ├── ltoptions.m4 │ ├── ltsugar.m4 │ ├── ltversion.m4 │ ├── lt~obsolete.m4 │ ├── mbedtls.m4 │ ├── openssl.m4 │ ├── polarssl.m4 │ ├── stack-protector.m4 │ └── zlib.m4 │ ├── openwrt │ ├── Makefile │ └── files │ │ ├── shadowsocks.init │ │ └── shadowsocks.json │ ├── rpm │ ├── SOURCES │ │ └── etc │ │ │ └── init.d │ │ │ └── shadowsocks-libev │ ├── SPECS │ │ └── shadowsocks-libev.spec │ └── genrpm.sh │ ├── shadowsocks-libev.pc.in │ └── src │ ├── .DS_Store │ ├── CMakeLists.txt │ ├── Makefile │ ├── Makefile.am │ ├── Makefile.in │ ├── acl.c │ ├── acl.h │ ├── android.c │ ├── cache.c │ ├── cache.h │ ├── common.h │ ├── encrypt.c │ ├── encrypt.h │ ├── http.c │ ├── http.h │ ├── includeobfs.h │ ├── jconf.c │ ├── jconf.h │ ├── json.c │ ├── json.h │ ├── local.c │ ├── local.h │ ├── manager.c │ ├── manager.h │ ├── netutils.c │ ├── netutils.h │ ├── obfs │ ├── auth.c │ ├── auth.h │ ├── auth_chain.c │ ├── auth_chain.h │ ├── base64.c │ ├── base64.h │ ├── crc32.c │ ├── crc32.h │ ├── http_simple.c │ ├── http_simple.h │ ├── obfs.c │ ├── obfs.h │ ├── obfsutil.c │ ├── obfsutil.h │ ├── tls1.2_ticket.c │ ├── tls1.2_ticket.h │ ├── verify.c │ └── verify.h │ ├── protocol.h │ ├── redir.c │ ├── redir.h │ ├── resolv.c │ ├── resolv.h │ ├── rule.c │ ├── rule.h │ ├── server.c │ ├── server.h │ ├── shadowsocks.h │ ├── socks5.h │ ├── ssrlink.py │ ├── tls.c │ ├── tls.h │ ├── tunnel.c │ ├── tunnel.h │ ├── udprelay.c │ ├── udprelay.h │ ├── uthash.h │ ├── utils.c │ ├── utils.h │ ├── win32.c │ └── win32.h └── ShadowPathDemo ├── AppDelegate.h ├── AppDelegate.m ├── Assets.xcassets └── AppIcon.appiconset │ └── Contents.json ├── Base.lproj ├── LaunchScreen.storyboard └── Main.storyboard ├── Info.plist ├── Supporting Files └── main.m ├── ViewController.h ├── ViewController.m └── config /README.md: -------------------------------------------------------------------------------- 1 | # ShadowPath 2 | -------------------------------------------------------------------------------- /ShadowPath.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = "ShadowPath" 3 | s.version = "0.1.0" 4 | s.summary = "Http and Socks proxy based on Privoxy and Antinat" 5 | s.description = <<-DESC 6 | Http and Socks proxy based on Privoxy and Antinat. 7 | DESC 8 | s.homepage = "http://icodesign.me" 9 | s.license = "GPLv2" 10 | s.author = { "iCodesign" => "leimagnet@gmail.com" } 11 | s.ios.deployment_target = '7.0' 12 | s.osx.deployment_target = '10.9' 13 | s.source_files = "ShadowPath", "ShadowPath/**/*.{c,h,m,swift}" 14 | s.libraries = "z" 15 | s.pod_target_xcconfig = { 16 | 'OTHER_CFLAGS' => '-DHAVE_CONFIG_H -DUSE_CRYPTO_OPENSSL -DLIB_ONLY -DUDPRELAY_LOCAL -DMODULE_LOCAL', 17 | # 'HEADER_SEARCH_PATHS' => '', 18 | } 19 | s.vendored_libraries = 'ShadowPath/Antinat/expat-lib/lib/libexpat.a', 'ShadowPath/shadowsocks-libev/libopenssl/lib/libcrypto.a', 'ShadowPath/shadowsocks-libev/libopenssl/lib/libssl.a', 'ShadowPath/shadowsocks-libev/libsodium-ios/lib/libsodium.a' 20 | end -------------------------------------------------------------------------------- /ShadowPath.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ShadowPath.xcodeproj/project.xcworkspace/xcuserdata/mac.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qman9501/ShadowPath/51942d6b4cbacc056a33993a3aa4eb0db6afcd94/ShadowPath.xcodeproj/project.xcworkspace/xcuserdata/mac.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /ShadowPath.xcodeproj/xcuserdata/bob.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | ShadowPath.xcscheme 8 | 9 | orderHint 10 | 7 11 | 12 | ShadowPathDemo.xcscheme 13 | 14 | orderHint 15 | 8 16 | 17 | 18 | SuppressBuildableAutocreation 19 | 20 | B82847B31CEB14B000820456 21 | 22 | primary 23 | 24 | 25 | B8DEFD7A1CE9C923003FC706 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /ShadowPath.xcodeproj/xcuserdata/chenshijie.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | ShadowPath.xcscheme 8 | 9 | orderHint 10 | 7 11 | 12 | ShadowPathDemo.xcscheme 13 | 14 | orderHint 15 | 8 16 | 17 | 18 | SuppressBuildableAutocreation 19 | 20 | B82847B31CEB14B000820456 21 | 22 | primary 23 | 24 | 25 | B8DEFD7A1CE9C923003FC706 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /ShadowPath.xcodeproj/xcuserdata/lewei.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | ShadowPath.xcscheme 8 | 9 | orderHint 10 | 7 11 | 12 | ShadowPathDemo.xcscheme 13 | 14 | orderHint 15 | 8 16 | 17 | 18 | SuppressBuildableAutocreation 19 | 20 | B82847B31CEB14B000820456 21 | 22 | primary 23 | 24 | 25 | B8DEFD7A1CE9C923003FC706 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /ShadowPath.xcodeproj/xcuserdata/mac.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | ShadowPath.xcscheme 8 | 9 | orderHint 10 | 7 11 | 12 | ShadowPathDemo.xcscheme 13 | 14 | orderHint 15 | 8 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /ShadowPath.xcodeproj/xcuserdata/th.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | ShadowPath.xcscheme 8 | 9 | orderHint 10 | 7 11 | 12 | ShadowPathDemo.xcscheme 13 | 14 | orderHint 15 | 8 16 | 17 | 18 | SuppressBuildableAutocreation 19 | 20 | B82847B31CEB14B000820456 21 | 22 | primary 23 | 24 | 25 | B8DEFD7A1CE9C923003FC706 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /ShadowPath/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qman9501/ShadowPath/51942d6b4cbacc056a33993a3aa4eb0db6afcd94/ShadowPath/.DS_Store -------------------------------------------------------------------------------- /ShadowPath/Antinat/client/an_core.h: -------------------------------------------------------------------------------- 1 | /* ANTINAT 2 | * ======= 3 | * This software is Copyright (c) 2003-05 Malcolm Smith. 4 | * No warranty is provided, including but not limited to 5 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 6 | * This code is licenced subject to the GNU General 7 | * Public Licence (GPL). See the COPYING file for more. 8 | */ 9 | 10 | #include "antinat.h" 11 | #include "an_internals.h" 12 | 13 | int _an_generic_recv (ANCONN conn, void *buf, size_t len, int flags); 14 | int _an_generic_send (ANCONN conn, const void *buf, size_t len, int flags); 15 | int _an_generic_recv_all (ANCONN conn, void *buf, size_t len); 16 | int _an_generic_send_all (ANCONN conn, const void *buf, size_t len); 17 | 18 | int _an_generic_close (ANCONN conn); 19 | 20 | int _an_blocking_recv (ANCONN conn, void *buf, size_t len, int flags); 21 | int _an_blocking_send (ANCONN conn, const void *buf, size_t len, int flags); 22 | 23 | int _an_rawconnect (ANCONN conn); 24 | 25 | int _an_generic_getline (ANCONN conn, void *buf, size_t nbuf); 26 | int _an_getsockaddr (st_sock_info *info, SOCKADDR * sa, int sl); 27 | 28 | int _an_setsockaddr (st_sock_info *info, SOCKADDR * sa, int sl); 29 | int _an_setsockaddr_sock (st_sock_info *info, SOCKET s, int peer); 30 | -------------------------------------------------------------------------------- /ShadowPath/Antinat/expat-lib/lib/libexpat.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qman9501/ShadowPath/51942d6b4cbacc056a33993a3aa4eb0db6afcd94/ShadowPath/Antinat/expat-lib/lib/libexpat.a -------------------------------------------------------------------------------- /ShadowPath/Antinat/server/AntinatServer.h: -------------------------------------------------------------------------------- 1 | // 2 | // AntinatServer.h 3 | // Potatso 4 | // 5 | // Created by LEI on 12/25/15. 6 | // Copyright © 2015 TouchingApp. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AntinatServer : NSObject 12 | + (AntinatServer *)sharedServer; 13 | - (int)startWithConfig:(NSString *)config; 14 | - (void)stop; 15 | @end 16 | -------------------------------------------------------------------------------- /ShadowPath/Antinat/server/AntinatServer.m: -------------------------------------------------------------------------------- 1 | // 2 | // AntinatServer.m 3 | // Potatso 4 | // 5 | // Created by LEI on 12/25/15. 6 | // Copyright © 2015 TouchingApp. All rights reserved. 7 | // 8 | 9 | #import "AntinatServer.h" 10 | #import "an_main.h" 11 | #import "an_serv.h" 12 | 13 | @implementation AntinatServer 14 | 15 | + (AntinatServer *)sharedServer { 16 | static dispatch_once_t onceToken; 17 | static AntinatServer *server; 18 | dispatch_once(&onceToken, ^{ 19 | server = [AntinatServer new]; 20 | }); 21 | return server; 22 | } 23 | 24 | - (instancetype)init { 25 | self = [super init]; 26 | if (self){ 27 | conn_dict = [NSMutableDictionary dictionary]; 28 | } 29 | return self; 30 | } 31 | 32 | - (int)startWithConfig:(NSString *)config { 33 | int fd = an_setup([config UTF8String], (int)config.length); 34 | [NSThread detachNewThreadSelector:@selector(start) toTarget:self withObject:nil]; 35 | return fd; 36 | } 37 | 38 | - (void)start { 39 | an_main(); 40 | } 41 | 42 | - (void)stop { 43 | closeup(0); 44 | } 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /ShadowPath/Antinat/server/an_main.h: -------------------------------------------------------------------------------- 1 | // 2 | // an_main.h 3 | // AntinatText 4 | // 5 | // Created by LEI on 12/20/15. 6 | // Copyright © 2015 TouchingApp. All rights reserved. 7 | // 8 | 9 | #ifndef an_main_h 10 | #define an_main_h 11 | 12 | int 13 | an_setup (const char *config_content, int config_content_size); 14 | 15 | int 16 | an_main (); 17 | 18 | void 19 | closeup (int x); 20 | 21 | #endif /* an_main_h */ 22 | -------------------------------------------------------------------------------- /ShadowPath/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(CURRENT_PROJECT_VERSION) 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /ShadowPath/Privoxy/radix.h: -------------------------------------------------------------------------------- 1 | // 2 | // radix.h 3 | // ShadowPath 4 | // 5 | // Created by LEI on 5/22/16. 6 | // Copyright © 2016 TouchingApp. All rights reserved. 7 | // 8 | 9 | #ifndef radix_h 10 | #define radix_h 11 | 12 | #include 13 | #include 14 | 15 | #define RADIX_NO_VALUE (uint32_t)0 16 | 17 | typedef struct radix_node_st radix_node_t; 18 | 19 | struct radix_node_st { 20 | radix_node_t *right; 21 | radix_node_t *left; 22 | radix_node_t *parent; 23 | char value; 24 | }; 25 | 26 | typedef struct { 27 | radix_node_t *root; 28 | size_t size; 29 | } radix_tree_t; 30 | 31 | radix_tree_t *radix_tree_create(); 32 | 33 | int radix32tree_insert(radix_tree_t *tree, 34 | uint32_t key, uint32_t mask, char value); 35 | 36 | int radix32tree_delete(radix_tree_t *tree, 37 | uint32_t key, uint32_t mask); 38 | 39 | char radix32tree_find(radix_tree_t *tree, uint32_t key); 40 | void radix_tree_free(radix_tree_t *tree); 41 | 42 | #endif /* radix_h */ 43 | -------------------------------------------------------------------------------- /ShadowPath/ShadowPath.h: -------------------------------------------------------------------------------- 1 | // 2 | // ShadowPath.h 3 | // ShadowPath 4 | // 5 | // Created by LEI on 5/16/16. 6 | // Copyright © 2016 TouchingApp. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for ShadowPath. 12 | FOUNDATION_EXPORT double ShadowPathVersionNumber; 13 | 14 | //! Project version string for ShadowPath. 15 | FOUNDATION_EXPORT const unsigned char ShadowPathVersionString[]; 16 | 17 | // In this header, you should import all the public headers of your framework using statements like #import 18 | 19 | #import "jcc.h" 20 | #import "project.h" 21 | #import "AntinatServer.h" 22 | #import "shadowsocks.h" 23 | -------------------------------------------------------------------------------- /ShadowPath/libmaxminddb/AUTHORS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qman9501/ShadowPath/51942d6b4cbacc056a33993a3aa4eb0db6afcd94/ShadowPath/libmaxminddb/AUTHORS -------------------------------------------------------------------------------- /ShadowPath/libmaxminddb/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | include_HEADERS = include/maxminddb.h 3 | 4 | nodist_include_HEADERS = include/maxminddb_config.h 5 | 6 | SUBDIRS = \ 7 | src \ 8 | bin \ 9 | t 10 | 11 | EXTRA_DIST = doc t Changes.md LICENSE NOTICE README.md projects/VS12 projects/VS12-tests 12 | dist-hook: 13 | dev-bin/make-man-pages.pl $(distdir) 14 | find $(distdir) -name '.git*' | xargs rm -fr 15 | 16 | safedist: clean dist 17 | tmpdir="$${TMPDIR-/tmp}/safedist-$$$$" \ 18 | && mkdir "$$tmpdir" \ 19 | && tar -xvf $(distdir).tar.gz --directory "$$tmpdir" \ 20 | && $(am__cd) "$$tmpdir/$(distdir)" \ 21 | && ./configure \ 22 | && make -j 4 check 23 | 24 | man1_MANS = man/man1/*.1 25 | 26 | man3_MANS = man/man3/*.3 27 | 28 | man/man1/*.1: 29 | if [ ! -f man/man1/mmdblookup.1 ]; then mkdir -p man/man1 && touch man/man1/mmdblookup.1; fi 30 | 31 | man/man3/*.3: 32 | if [ ! -f man/man3/libmaxminddb.3 ]; then mkdir -p man/man3 && touch man/man3/libmaxminddb.3; fi 33 | 34 | release: 35 | dev-bin/make-release.sh 36 | 37 | .PHONY: man/man1/*.1 man/man3/*.3 release 38 | -------------------------------------------------------------------------------- /ShadowPath/libmaxminddb/NOTICE: -------------------------------------------------------------------------------- 1 | Copyright 2013-2014 MaxMind, Inc. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. -------------------------------------------------------------------------------- /ShadowPath/libmaxminddb/appveyor.yml: -------------------------------------------------------------------------------- 1 | --- 2 | install: 3 | - git submodule update --init --recursive 4 | test_script: 5 | - .\projects\VS12\Debug\test_bad_pointers.exe 6 | - .\projects\VS12\Debug\test_basic_lookup.exe 7 | - .\projects\VS12\Debug\test_data_entry_list.exe 8 | - .\projects\VS12\Debug\test_data_types.exe 9 | - .\projects\VS12\Debug\test_dump.exe 10 | - .\projects\VS12\Debug\test_get_value_pointer_bug.exe 11 | - .\projects\VS12\Debug\test_get_value.exe 12 | - .\projects\VS12\Debug\test_ipv4_start_cache.exe 13 | - .\projects\VS12\Debug\test_ipv6_lookup_in_ipv4.exe 14 | - .\projects\VS12\Debug\test_metadata.exe 15 | - .\projects\VS12\Debug\test_no_map_get_value.exe 16 | - .\projects\VS12\Debug\test_read_node.exe 17 | - .\projects\VS12\Debug\test_version.exe 18 | notifications: 19 | - auth_token: 20 | secure: X+ymndzchVeC2LYsehzOt/GEMFfZJeTENeAU9lwNwTuCxBXFJNkuwZLd9joAtHgykHQoYqmEv/nH64+MA6nTlw== 21 | channel: ci 22 | on_build_failure: true 23 | on_build_status_changed: true 24 | on_build_success: true 25 | provider: Slack 26 | - on_build_failure: true 27 | on_build_status_changed: true 28 | on_build_success: false 29 | provider: Email 30 | subject: 'AppVeyor build {{status}}' 31 | to: 32 | - dev-ci@maxmind.com 33 | -------------------------------------------------------------------------------- /ShadowPath/libmaxminddb/bin/Makefile.am: -------------------------------------------------------------------------------- 1 | include $(top_srcdir)/common.mk 2 | 3 | AM_LDFLAGS = $(top_builddir)/src/libmaxminddb.la 4 | 5 | bin_PROGRAMS = mmdblookup 6 | -------------------------------------------------------------------------------- /ShadowPath/libmaxminddb/bootstrap: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | # make sure to use the installed libtool 4 | if [ -f ltmain.sh ]; then 5 | rm ltmain.sh 6 | fi 7 | autoreconf -fiv 8 | 9 | ################################################### 10 | # the steps below may help with outdated toolsets 11 | 12 | # disable dependency trackeing for OS X with multiply arch option's 13 | # automake -i --gnu --add-missing 14 | 15 | 16 | #aclocal \ 17 | #&& automake -i --gnu --add-missing \ 18 | #&& autoconf 19 | 20 | #LIBTOOLIZE=$( which libtoolize glibtoolize | head -1 ) 21 | #$LIBTOOLIZE -f 22 | -------------------------------------------------------------------------------- /ShadowPath/libmaxminddb/common.mk: -------------------------------------------------------------------------------- 1 | if DEBUG 2 | AM_CFLAGS=-O0 -g -Wall -Wextra 3 | else 4 | AM_CFLAGS=-O2 -g 5 | endif 6 | 7 | AM_CPPFLAGS = -I$(top_srcdir)/include 8 | -------------------------------------------------------------------------------- /ShadowPath/libmaxminddb/dev-bin/ppa-release.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | set -x 5 | set -u 6 | 7 | DISTS=( wily trusty precise ) 8 | 9 | VERSION=$(perl -MFile::Slurp::Tiny=read_file -MDateTime <now->ymd eq \$2; 14 | say \$1; 15 | EOF 16 | ) 17 | 18 | RESULTS=/tmp/build-libmaxminddb-results/ 19 | SRCDIR="$RESULTS/libmaxminddb" 20 | 21 | mkdir -p "$SRCDIR" 22 | 23 | # gbp does weird things without a pristine checkout 24 | git clone git@github.com:maxmind/libmaxminddb.git -b ubuntu-ppa $SRCDIR 25 | 26 | pushd "$SRCDIR" 27 | git merge "$VERSION" 28 | 29 | for dist in "${DISTS[@]}"; do 30 | git clean -xfd 31 | git reset HEAD --hard 32 | 33 | dch -v "$VERSION-0+maxmind1~$dist" -D "$dist" -u low "New upstream release." 34 | gbp buildpackage -S --git-ignore-new 35 | done 36 | 37 | read -e -p "Release to PPA? (y/n)" SHOULD_RELEASE 38 | 39 | if [ "$SHOULD_RELEASE" != "y" ]; then 40 | echo "Aborting" 41 | exit 1 42 | fi 43 | 44 | dput ppa:maxmind/ppa ../*source.changes 45 | 46 | popd 47 | 48 | git add debian/changelog 49 | git commit -m "Update debian/changelog for $VERSION" 50 | git push 51 | -------------------------------------------------------------------------------- /ShadowPath/libmaxminddb/dev-bin/uncrustify-all.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | uncrustify="uncrustify -c .uncrustify.cfg --replace --no-backup" 4 | 5 | # We indent each thing twice because uncrustify is not idempotent - in some 6 | # cases it will flip-flop between two indentation styles. 7 | for dir in bin include src t; do 8 | c_files=`find $dir -maxdepth 1 -name '*.c'` 9 | if [ "$c_files" != "" ]; then 10 | $uncrustify $dir/*.c; 11 | $uncrustify $dir/*.c; 12 | fi 13 | 14 | h_files=`find $dir -maxdepth 1 -name '*.h'` 15 | if [ "$h_files" != "" ]; then 16 | $uncrustify $dir/*.h; 17 | $uncrustify $dir/*.h; 18 | fi 19 | done 20 | 21 | ./dev-bin/regen-prototypes.pl 22 | -------------------------------------------------------------------------------- /ShadowPath/libmaxminddb/dev-bin/valgrind-all.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use File::Basename qw( basename ); 7 | use FindBin qw( $Bin ); 8 | use IPC::Run3; 9 | 10 | my $top_dir = "$Bin/.."; 11 | 12 | my $output; 13 | 14 | my @tests = glob "$top_dir/t/.libs/lt-*_t"; 15 | 16 | my @mmdblookup = ( 17 | "$top_dir/bin/mmdblookup", 18 | '--file', "$top_dir/maxmind-db/test-data/MaxMind-DB-test-decoder.mmdb", 19 | '--ip', 20 | ); 21 | 22 | # We want IPv4 and IPv6 addresses - one of each that exists in the db and one 23 | # that doesn't 24 | my @ips = ( '1.1.1.1', '10.0.0.0', 'abcd::', '0900::' ); 25 | 26 | my @cmds = ( 27 | ( map { [ @mmdblookup, $_ ] } @ips ), 28 | ( map { [$_] } @tests ), 29 | ); 30 | 31 | for my $cmd (@cmds) { 32 | my $output; 33 | run3( 34 | [ qw( valgrind --leak-check=full -- ), @{$cmd} ], 35 | \undef, 36 | \$output, 37 | \$output, 38 | ); 39 | 40 | $output =~ s/^(?!=).*\n//mg; 41 | 42 | my $marker = '-' x 60; 43 | print $marker, "\n", ( join q{ }, basename( shift @{$cmd} ), @{$cmd} ), 44 | "\n", $marker, "\n", $output, 45 | "\n\n"; 46 | } 47 | -------------------------------------------------------------------------------- /ShadowPath/libmaxminddb/include/maxminddb_config.h: -------------------------------------------------------------------------------- 1 | /* include/maxminddb_config.h. Generated from maxminddb_config.h.in by configure. */ 2 | #ifndef MAXMINDDB_CONFIG_H 3 | #define MAXMINDDB_CONFIG_H 4 | 5 | #ifndef MMDB_UINT128_USING_MODE 6 | /* Define as 1 if we we use unsigned int __atribute__ ((__mode__(TI))) for uint128 values */ 7 | #define MMDB_UINT128_USING_MODE 1 8 | #endif 9 | 10 | #ifndef MMDB_UINT128_IS_BYTE_ARRAY 11 | /* Define as 1 if we don't have an unsigned __int128 type */ 12 | #define MMDB_UINT128_IS_BYTE_ARRAY 0 13 | #endif 14 | 15 | #endif /* MAXMINDDB_CONFIG_H */ 16 | -------------------------------------------------------------------------------- /ShadowPath/libmaxminddb/include/maxminddb_config.h.in: -------------------------------------------------------------------------------- 1 | #ifndef MAXMINDDB_CONFIG_H 2 | #define MAXMINDDB_CONFIG_H 3 | 4 | #ifndef MMDB_UINT128_USING_MODE 5 | /* Define as 1 if we we use unsigned int __atribute__ ((__mode__(TI))) for uint128 values */ 6 | #define MMDB_UINT128_USING_MODE 0 7 | #endif 8 | 9 | #ifndef MMDB_UINT128_IS_BYTE_ARRAY 10 | /* Define as 1 if we don't have an unsigned __int128 type */ 11 | #undef MMDB_UINT128_IS_BYTE_ARRAY 12 | #endif 13 | 14 | #endif /* MAXMINDDB_CONFIG_H */ 15 | -------------------------------------------------------------------------------- /ShadowPath/libmaxminddb/projects/VS12/libmaxminddb-release.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | MaxSpeed 9 | 10 | 11 | 12 | 13 | AnySuitable 14 | 15 | 16 | 17 | 18 | true 19 | 20 | 21 | 22 | 23 | Speed 24 | 25 | 26 | 27 | 28 | true 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /ShadowPath/libmaxminddb/projects/VS12/libmaxminddb-x64.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | $(SolutionDir)$(Platform)\$(Configuration)\obj\ 7 | 8 | 9 | 10 | MachineX64 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /ShadowPath/libmaxminddb/projects/VS12/libmaxminddb.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | 14 | 15 | Source Files 16 | 17 | 18 | 19 | 20 | Header Files 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /ShadowPath/libmaxminddb/projects/VS12/maxminddb_config.h: -------------------------------------------------------------------------------- 1 | #ifndef MAXMINDDB_CONFIG_H 2 | #define MAXMINDDB_CONFIG_H 3 | 4 | #ifndef MMDB_UINT128_USING_MODE 5 | /* Define as 1 if we we use unsigned int __atribute__ ((__mode__(TI))) for uint128 values */ 6 | #define MMDB_UINT128_USING_MODE 0 7 | #endif 8 | 9 | #ifndef MMDB_UINT128_IS_BYTE_ARRAY 10 | /* Define as 1 if we don't have an unsigned __int128 type */ 11 | #define MMDB_UINT128_IS_BYTE_ARRAY 1 12 | #endif 13 | 14 | #endif /* MAXMINDDB_CONFIG_H */ 15 | -------------------------------------------------------------------------------- /ShadowPath/libmaxminddb/src/Makefile.am: -------------------------------------------------------------------------------- 1 | include $(top_srcdir)/common.mk 2 | 3 | lib_LTLIBRARIES = libmaxminddb.la 4 | 5 | libmaxminddb_la_SOURCES = maxminddb.c maxminddb-compat-util.h 6 | libmaxminddb_la_LDFLAGS = -version-info 0:7:0 7 | include_HEADERS = $(top_srcdir)/include/maxminddb.h 8 | 9 | pkgconfig_DATA = libmaxminddb.pc 10 | -------------------------------------------------------------------------------- /ShadowPath/libmaxminddb/src/libmaxminddb.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: libmaxminddb 7 | Description: C library for the MaxMind DB file format 8 | URL: http://maxmind.github.io/libmaxminddb/ 9 | Version: @PACKAGE_VERSION@ 10 | Libs: -L${libdir} -lmaxminddb 11 | Cflags: -I${includedir} 12 | -------------------------------------------------------------------------------- /ShadowPath/libmaxminddb/t/Makefile.am: -------------------------------------------------------------------------------- 1 | include $(top_srcdir)/common.mk 2 | 3 | AM_LDFLAGS = $(top_builddir)/src/libmaxminddb.la 4 | 5 | noinst_LTLIBRARIES = libmmdbtest.la 6 | libmmdbtest_la_SOURCES = maxminddb_test_helper.c libtap/tap.c 7 | 8 | check_PROGRAMS = \ 9 | bad_pointers_t basic_lookup_t data_entry_list_t data_types_t \ 10 | dump_t get_value_t get_value_pointer_bug_t ipv4_start_cache_t \ 11 | ipv6_lookup_in_ipv4_t metadata_t metadata_pointers_t \ 12 | no_map_get_value_t read_node_t threads_t version_t 13 | 14 | threads_t_CFLAGS = $(CFLAGS) -pthread 15 | 16 | TESTS = $(check_PROGRAMS) compile_c++_t.pl mmdblookup_t.pl 17 | 18 | LDADD = libmmdbtest.la 19 | -------------------------------------------------------------------------------- /ShadowPath/libmaxminddb/t/ipv4_start_cache_t.c: -------------------------------------------------------------------------------- 1 | #include "maxminddb_test_helper.h" 2 | 3 | void test_one_ip(MMDB_s *mmdb, const char *ip, const char *filename, 4 | const char *mode_desc) 5 | { 6 | MMDB_lookup_result_s result = 7 | lookup_string_ok(mmdb, ip, filename, mode_desc); 8 | 9 | ok( 10 | result.found_entry, 11 | "got a result for an IPv4 address included in a larger-than-IPv4 subnet - %s - %s", 12 | ip, mode_desc); 13 | 14 | data_ok(&result, MMDB_DATA_TYPE_UTF8_STRING, "string value for IP", NULL); 15 | } 16 | 17 | void run_tests(int mode, const char *mode_desc) 18 | { 19 | const char *filename = "MaxMind-DB-no-ipv4-search-tree.mmdb"; 20 | const char *path = test_database_path(filename); 21 | MMDB_s *mmdb = open_ok(path, mode, mode_desc); 22 | free((void *)path); 23 | 24 | test_one_ip(mmdb, "1.1.1.1", filename, mode_desc); 25 | test_one_ip(mmdb, "255.255.255.255", filename, mode_desc); 26 | 27 | MMDB_close(mmdb); 28 | free(mmdb); 29 | } 30 | 31 | int main(void) 32 | { 33 | plan(NO_PLAN); 34 | for_all_modes(&run_tests); 35 | done_testing(); 36 | } 37 | -------------------------------------------------------------------------------- /ShadowPath/libmaxminddb/t/metadata_pointers_t.c: -------------------------------------------------------------------------------- 1 | #include "maxminddb_test_helper.h" 2 | 3 | void run_tests(int mode, const char *mode_desc) 4 | { 5 | const char *filename = "MaxMind-DB-test-metadata-pointers.mmdb"; 6 | const char *path = test_database_path(filename); 7 | MMDB_s *mmdb = open_ok(path, mode, mode_desc); 8 | free((void *)path); 9 | 10 | char *repeated_string = "Lots of pointers in metadata"; 11 | 12 | is(mmdb->metadata.database_type, repeated_string, 13 | "decoded pointer database_type"); 14 | 15 | for (uint16_t i = 0; i < mmdb->metadata.description.count; i++) { 16 | const char *language = 17 | mmdb->metadata.description.descriptions[i]->language; 18 | const char *description = 19 | mmdb->metadata.description.descriptions[i]->description; 20 | is(description, repeated_string, "%s description", language); 21 | } 22 | 23 | MMDB_close(mmdb); 24 | free(mmdb); 25 | } 26 | 27 | int main(void) 28 | { 29 | plan(NO_PLAN); 30 | for_all_modes(&run_tests); 31 | done_testing(); 32 | } 33 | -------------------------------------------------------------------------------- /ShadowPath/libmaxminddb/t/no_map_get_value_t.c: -------------------------------------------------------------------------------- 1 | #include "maxminddb_test_helper.h" 2 | 3 | void run_tests(int mode, const char *mode_desc) 4 | { 5 | const char *filename = "MaxMind-DB-string-value-entries.mmdb"; 6 | const char *path = test_database_path(filename); 7 | MMDB_s *mmdb = open_ok(path, mode, mode_desc); 8 | free((void *)path); 9 | 10 | const char *ip = "1.1.1.1"; 11 | MMDB_lookup_result_s result = 12 | lookup_string_ok(mmdb, ip, filename, mode_desc); 13 | 14 | MMDB_entry_data_s entry_data; 15 | int status = MMDB_get_value(&result.entry, &entry_data, NULL); 16 | 17 | cmp_ok(status, "==", MMDB_SUCCESS, 18 | "status for MMDB_get_value() is MMDB_SUCCESS"); 19 | ok(entry_data.has_data, "found a value when varargs list is just NULL"); 20 | cmp_ok(entry_data.type, "==", MMDB_DATA_TYPE_UTF8_STRING, 21 | "returned entry type is utf8_string"); 22 | 23 | MMDB_close(mmdb); 24 | free(mmdb); 25 | } 26 | 27 | int main(void) 28 | { 29 | plan(NO_PLAN); 30 | for_all_modes(&run_tests); 31 | done_testing(); 32 | } 33 | -------------------------------------------------------------------------------- /ShadowPath/libmaxminddb/t/version_t.c: -------------------------------------------------------------------------------- 1 | #include "maxminddb_test_helper.h" 2 | 3 | int main(void) 4 | { 5 | const char *version = MMDB_lib_version(); 6 | if (ok(version != NULL, "MMDB_lib_version exists")) { 7 | is(version, PACKAGE_VERSION, "version is " PACKAGE_VERSION); 8 | } 9 | done_testing(); 10 | } 11 | -------------------------------------------------------------------------------- /ShadowPath/libopenssl/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qman9501/ShadowPath/51942d6b4cbacc056a33993a3aa4eb0db6afcd94/ShadowPath/libopenssl/.DS_Store -------------------------------------------------------------------------------- /ShadowPath/libopenssl/include/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qman9501/ShadowPath/51942d6b4cbacc056a33993a3aa4eb0db6afcd94/ShadowPath/libopenssl/include/.DS_Store -------------------------------------------------------------------------------- /ShadowPath/libopenssl/include/openssl/ebcdic.h: -------------------------------------------------------------------------------- 1 | /* crypto/ebcdic.h */ 2 | 3 | #ifndef HEADER_EBCDIC_H 4 | # define HEADER_EBCDIC_H 5 | 6 | # include 7 | 8 | #ifdef __cplusplus 9 | extern "C" { 10 | #endif 11 | 12 | /* Avoid name clashes with other applications */ 13 | # define os_toascii _openssl_os_toascii 14 | # define os_toebcdic _openssl_os_toebcdic 15 | # define ebcdic2ascii _openssl_ebcdic2ascii 16 | # define ascii2ebcdic _openssl_ascii2ebcdic 17 | 18 | extern const unsigned char os_toascii[256]; 19 | extern const unsigned char os_toebcdic[256]; 20 | void *ebcdic2ascii(void *dest, const void *srce, size_t count); 21 | void *ascii2ebcdic(void *dest, const void *srce, size_t count); 22 | 23 | #ifdef __cplusplus 24 | } 25 | #endif 26 | #endif 27 | -------------------------------------------------------------------------------- /ShadowPath/libopenssl/include/openssl/whrlpool.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_WHRLPOOL_H 2 | # define HEADER_WHRLPOOL_H 3 | 4 | # include 5 | # include 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | # define WHIRLPOOL_DIGEST_LENGTH (512/8) 12 | # define WHIRLPOOL_BBLOCK 512 13 | # define WHIRLPOOL_COUNTER (256/8) 14 | 15 | typedef struct { 16 | union { 17 | unsigned char c[WHIRLPOOL_DIGEST_LENGTH]; 18 | /* double q is here to ensure 64-bit alignment */ 19 | double q[WHIRLPOOL_DIGEST_LENGTH / sizeof(double)]; 20 | } H; 21 | unsigned char data[WHIRLPOOL_BBLOCK / 8]; 22 | unsigned int bitoff; 23 | size_t bitlen[WHIRLPOOL_COUNTER / sizeof(size_t)]; 24 | } WHIRLPOOL_CTX; 25 | 26 | # ifndef OPENSSL_NO_WHIRLPOOL 27 | # ifdef OPENSSL_FIPS 28 | int private_WHIRLPOOL_Init(WHIRLPOOL_CTX *c); 29 | # endif 30 | int WHIRLPOOL_Init(WHIRLPOOL_CTX *c); 31 | int WHIRLPOOL_Update(WHIRLPOOL_CTX *c, const void *inp, size_t bytes); 32 | void WHIRLPOOL_BitUpdate(WHIRLPOOL_CTX *c, const void *inp, size_t bits); 33 | int WHIRLPOOL_Final(unsigned char *md, WHIRLPOOL_CTX *c); 34 | unsigned char *WHIRLPOOL(const void *inp, size_t bytes, unsigned char *md); 35 | # endif 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /ShadowPath/libopenssl/lib/libcrypto.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qman9501/ShadowPath/51942d6b4cbacc056a33993a3aa4eb0db6afcd94/ShadowPath/libopenssl/lib/libcrypto.a -------------------------------------------------------------------------------- /ShadowPath/libopenssl/lib/libssl.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qman9501/ShadowPath/51942d6b4cbacc056a33993a3aa4eb0db6afcd94/ShadowPath/libopenssl/lib/libssl.a -------------------------------------------------------------------------------- /ShadowPath/libsodium-ios/include/sodium/core.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef sodium_core_H 3 | #define sodium_core_H 4 | 5 | #include "export.h" 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | SODIUM_EXPORT 12 | int sodium_init(void) 13 | __attribute__ ((warn_unused_result)); 14 | 15 | #ifdef __cplusplus 16 | } 17 | #endif 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /ShadowPath/libsodium-ios/include/sodium/crypto_auth.h: -------------------------------------------------------------------------------- 1 | #ifndef crypto_auth_H 2 | #define crypto_auth_H 3 | 4 | #include 5 | 6 | #include "crypto_auth_hmacsha512256.h" 7 | #include "export.h" 8 | 9 | #ifdef __cplusplus 10 | # if __GNUC__ 11 | # pragma GCC diagnostic ignored "-Wlong-long" 12 | # endif 13 | extern "C" { 14 | #endif 15 | 16 | #define crypto_auth_BYTES crypto_auth_hmacsha512256_BYTES 17 | SODIUM_EXPORT 18 | size_t crypto_auth_bytes(void); 19 | 20 | #define crypto_auth_KEYBYTES crypto_auth_hmacsha512256_KEYBYTES 21 | SODIUM_EXPORT 22 | size_t crypto_auth_keybytes(void); 23 | 24 | #define crypto_auth_PRIMITIVE "hmacsha512256" 25 | SODIUM_EXPORT 26 | const char *crypto_auth_primitive(void); 27 | 28 | SODIUM_EXPORT 29 | int crypto_auth(unsigned char *out, const unsigned char *in, 30 | unsigned long long inlen, const unsigned char *k); 31 | 32 | SODIUM_EXPORT 33 | int crypto_auth_verify(const unsigned char *h, const unsigned char *in, 34 | unsigned long long inlen, const unsigned char *k) 35 | __attribute__ ((warn_unused_result)); 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /ShadowPath/libsodium-ios/include/sodium/crypto_core_hchacha20.h: -------------------------------------------------------------------------------- 1 | #ifndef crypto_core_hchacha20_H 2 | #define crypto_core_hchacha20_H 3 | 4 | #include 5 | #include "export.h" 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | #define crypto_core_hchacha20_OUTPUTBYTES 32U 12 | SODIUM_EXPORT 13 | size_t crypto_core_hchacha20_outputbytes(void); 14 | 15 | #define crypto_core_hchacha20_INPUTBYTES 16U 16 | SODIUM_EXPORT 17 | size_t crypto_core_hchacha20_inputbytes(void); 18 | 19 | #define crypto_core_hchacha20_KEYBYTES 32U 20 | SODIUM_EXPORT 21 | size_t crypto_core_hchacha20_keybytes(void); 22 | 23 | #define crypto_core_hchacha20_CONSTBYTES 16U 24 | SODIUM_EXPORT 25 | size_t crypto_core_hchacha20_constbytes(void); 26 | 27 | SODIUM_EXPORT 28 | int crypto_core_hchacha20(unsigned char *out, const unsigned char *in, 29 | const unsigned char *k, const unsigned char *c); 30 | 31 | #ifdef __cplusplus 32 | } 33 | #endif 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /ShadowPath/libsodium-ios/include/sodium/crypto_core_hsalsa20.h: -------------------------------------------------------------------------------- 1 | #ifndef crypto_core_hsalsa20_H 2 | #define crypto_core_hsalsa20_H 3 | 4 | #include 5 | #include "export.h" 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | #define crypto_core_hsalsa20_OUTPUTBYTES 32U 12 | SODIUM_EXPORT 13 | size_t crypto_core_hsalsa20_outputbytes(void); 14 | 15 | #define crypto_core_hsalsa20_INPUTBYTES 16U 16 | SODIUM_EXPORT 17 | size_t crypto_core_hsalsa20_inputbytes(void); 18 | 19 | #define crypto_core_hsalsa20_KEYBYTES 32U 20 | SODIUM_EXPORT 21 | size_t crypto_core_hsalsa20_keybytes(void); 22 | 23 | #define crypto_core_hsalsa20_CONSTBYTES 16U 24 | SODIUM_EXPORT 25 | size_t crypto_core_hsalsa20_constbytes(void); 26 | 27 | SODIUM_EXPORT 28 | int crypto_core_hsalsa20(unsigned char *out, const unsigned char *in, 29 | const unsigned char *k, const unsigned char *c); 30 | 31 | #ifdef __cplusplus 32 | } 33 | #endif 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /ShadowPath/libsodium-ios/include/sodium/crypto_core_salsa20.h: -------------------------------------------------------------------------------- 1 | #ifndef crypto_core_salsa20_H 2 | #define crypto_core_salsa20_H 3 | 4 | #include 5 | #include "export.h" 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | #define crypto_core_salsa20_OUTPUTBYTES 64U 12 | SODIUM_EXPORT 13 | size_t crypto_core_salsa20_outputbytes(void); 14 | 15 | #define crypto_core_salsa20_INPUTBYTES 16U 16 | SODIUM_EXPORT 17 | size_t crypto_core_salsa20_inputbytes(void); 18 | 19 | #define crypto_core_salsa20_KEYBYTES 32U 20 | SODIUM_EXPORT 21 | size_t crypto_core_salsa20_keybytes(void); 22 | 23 | #define crypto_core_salsa20_CONSTBYTES 16U 24 | SODIUM_EXPORT 25 | size_t crypto_core_salsa20_constbytes(void); 26 | 27 | SODIUM_EXPORT 28 | int crypto_core_salsa20(unsigned char *out, const unsigned char *in, 29 | const unsigned char *k, const unsigned char *c); 30 | 31 | #ifdef __cplusplus 32 | } 33 | #endif 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /ShadowPath/libsodium-ios/include/sodium/crypto_core_salsa2012.h: -------------------------------------------------------------------------------- 1 | #ifndef crypto_core_salsa2012_H 2 | #define crypto_core_salsa2012_H 3 | 4 | #include 5 | #include "export.h" 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | #define crypto_core_salsa2012_OUTPUTBYTES 64U 12 | SODIUM_EXPORT 13 | size_t crypto_core_salsa2012_outputbytes(void); 14 | 15 | #define crypto_core_salsa2012_INPUTBYTES 16U 16 | SODIUM_EXPORT 17 | size_t crypto_core_salsa2012_inputbytes(void); 18 | 19 | #define crypto_core_salsa2012_KEYBYTES 32U 20 | SODIUM_EXPORT 21 | size_t crypto_core_salsa2012_keybytes(void); 22 | 23 | #define crypto_core_salsa2012_CONSTBYTES 16U 24 | SODIUM_EXPORT 25 | size_t crypto_core_salsa2012_constbytes(void); 26 | 27 | SODIUM_EXPORT 28 | int crypto_core_salsa2012(unsigned char *out, const unsigned char *in, 29 | const unsigned char *k, const unsigned char *c); 30 | 31 | #ifdef __cplusplus 32 | } 33 | #endif 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /ShadowPath/libsodium-ios/include/sodium/crypto_core_salsa208.h: -------------------------------------------------------------------------------- 1 | #ifndef crypto_core_salsa208_H 2 | #define crypto_core_salsa208_H 3 | 4 | #include 5 | #include "export.h" 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | #define crypto_core_salsa208_OUTPUTBYTES 64U 12 | SODIUM_EXPORT 13 | size_t crypto_core_salsa208_outputbytes(void); 14 | 15 | #define crypto_core_salsa208_INPUTBYTES 16U 16 | SODIUM_EXPORT 17 | size_t crypto_core_salsa208_inputbytes(void); 18 | 19 | #define crypto_core_salsa208_KEYBYTES 32U 20 | SODIUM_EXPORT 21 | size_t crypto_core_salsa208_keybytes(void); 22 | 23 | #define crypto_core_salsa208_CONSTBYTES 16U 24 | SODIUM_EXPORT 25 | size_t crypto_core_salsa208_constbytes(void); 26 | 27 | SODIUM_EXPORT 28 | int crypto_core_salsa208(unsigned char *out, const unsigned char *in, 29 | const unsigned char *k, const unsigned char *c); 30 | 31 | #ifdef __cplusplus 32 | } 33 | #endif 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /ShadowPath/libsodium-ios/include/sodium/crypto_hash.h: -------------------------------------------------------------------------------- 1 | #ifndef crypto_hash_H 2 | #define crypto_hash_H 3 | 4 | /* 5 | * WARNING: Unless you absolutely need to use SHA512 for interoperatibility, 6 | * purposes, you might want to consider crypto_generichash() instead. 7 | * Unlike SHA512, crypto_generichash() is not vulnerable to length 8 | * extension attacks. 9 | */ 10 | 11 | #include 12 | 13 | #include "crypto_hash_sha512.h" 14 | #include "export.h" 15 | 16 | #ifdef __cplusplus 17 | # if __GNUC__ 18 | # pragma GCC diagnostic ignored "-Wlong-long" 19 | # endif 20 | extern "C" { 21 | #endif 22 | 23 | #define crypto_hash_BYTES crypto_hash_sha512_BYTES 24 | SODIUM_EXPORT 25 | size_t crypto_hash_bytes(void); 26 | 27 | SODIUM_EXPORT 28 | int crypto_hash(unsigned char *out, const unsigned char *in, 29 | unsigned long long inlen); 30 | 31 | #define crypto_hash_PRIMITIVE "sha512" 32 | SODIUM_EXPORT 33 | const char *crypto_hash_primitive(void) 34 | __attribute__ ((warn_unused_result)); 35 | 36 | #ifdef __cplusplus 37 | } 38 | #endif 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /ShadowPath/libsodium-ios/include/sodium/crypto_int32.h: -------------------------------------------------------------------------------- 1 | #ifndef crypto_int32_H 2 | #define crypto_int32_H 3 | 4 | #include 5 | 6 | typedef int32_t crypto_int32; 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /ShadowPath/libsodium-ios/include/sodium/crypto_int64.h: -------------------------------------------------------------------------------- 1 | #ifndef crypto_int64_H 2 | #define crypto_int64_H 3 | 4 | #include 5 | 6 | typedef int64_t crypto_int64; 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /ShadowPath/libsodium-ios/include/sodium/crypto_scalarmult.h: -------------------------------------------------------------------------------- 1 | #ifndef crypto_scalarmult_H 2 | #define crypto_scalarmult_H 3 | 4 | #include 5 | 6 | #include "crypto_scalarmult_curve25519.h" 7 | #include "export.h" 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | #define crypto_scalarmult_BYTES crypto_scalarmult_curve25519_BYTES 14 | SODIUM_EXPORT 15 | size_t crypto_scalarmult_bytes(void); 16 | 17 | #define crypto_scalarmult_SCALARBYTES crypto_scalarmult_curve25519_SCALARBYTES 18 | SODIUM_EXPORT 19 | size_t crypto_scalarmult_scalarbytes(void); 20 | 21 | #define crypto_scalarmult_PRIMITIVE "curve25519" 22 | SODIUM_EXPORT 23 | const char *crypto_scalarmult_primitive(void); 24 | 25 | SODIUM_EXPORT 26 | int crypto_scalarmult_base(unsigned char *q, const unsigned char *n); 27 | 28 | SODIUM_EXPORT 29 | int crypto_scalarmult(unsigned char *q, const unsigned char *n, 30 | const unsigned char *p) 31 | __attribute__ ((warn_unused_result)); 32 | 33 | #ifdef __cplusplus 34 | } 35 | #endif 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /ShadowPath/libsodium-ios/include/sodium/crypto_scalarmult_curve25519.h: -------------------------------------------------------------------------------- 1 | #ifndef crypto_scalarmult_curve25519_H 2 | #define crypto_scalarmult_curve25519_H 3 | 4 | #include 5 | 6 | #include "export.h" 7 | 8 | #ifdef __cplusplus 9 | extern "C" { 10 | #endif 11 | 12 | #define crypto_scalarmult_curve25519_BYTES 32U 13 | SODIUM_EXPORT 14 | size_t crypto_scalarmult_curve25519_bytes(void); 15 | 16 | #define crypto_scalarmult_curve25519_SCALARBYTES 32U 17 | SODIUM_EXPORT 18 | size_t crypto_scalarmult_curve25519_scalarbytes(void); 19 | 20 | SODIUM_EXPORT 21 | int crypto_scalarmult_curve25519(unsigned char *q, const unsigned char *n, 22 | const unsigned char *p) 23 | __attribute__ ((warn_unused_result)); 24 | 25 | SODIUM_EXPORT 26 | int crypto_scalarmult_curve25519_base(unsigned char *q, const unsigned char *n); 27 | 28 | /* ------------------------------------------------------------------------- */ 29 | 30 | int _crypto_scalarmult_curve25519_pick_best_implementation(void); 31 | 32 | #ifdef __cplusplus 33 | } 34 | #endif 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /ShadowPath/libsodium-ios/include/sodium/crypto_shorthash.h: -------------------------------------------------------------------------------- 1 | #ifndef crypto_shorthash_H 2 | #define crypto_shorthash_H 3 | 4 | #include 5 | 6 | #include "crypto_shorthash_siphash24.h" 7 | #include "export.h" 8 | 9 | #ifdef __cplusplus 10 | # if __GNUC__ 11 | # pragma GCC diagnostic ignored "-Wlong-long" 12 | # endif 13 | extern "C" { 14 | #endif 15 | 16 | #define crypto_shorthash_BYTES crypto_shorthash_siphash24_BYTES 17 | SODIUM_EXPORT 18 | size_t crypto_shorthash_bytes(void); 19 | 20 | #define crypto_shorthash_KEYBYTES crypto_shorthash_siphash24_KEYBYTES 21 | SODIUM_EXPORT 22 | size_t crypto_shorthash_keybytes(void); 23 | 24 | #define crypto_shorthash_PRIMITIVE "siphash24" 25 | SODIUM_EXPORT 26 | const char *crypto_shorthash_primitive(void); 27 | 28 | SODIUM_EXPORT 29 | int crypto_shorthash(unsigned char *out, const unsigned char *in, 30 | unsigned long long inlen, const unsigned char *k); 31 | 32 | #ifdef __cplusplus 33 | } 34 | #endif 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /ShadowPath/libsodium-ios/include/sodium/crypto_shorthash_siphash24.h: -------------------------------------------------------------------------------- 1 | #ifndef crypto_shorthash_siphash24_H 2 | #define crypto_shorthash_siphash24_H 3 | 4 | #include 5 | #include "export.h" 6 | 7 | #ifdef __cplusplus 8 | # if __GNUC__ 9 | # pragma GCC diagnostic ignored "-Wlong-long" 10 | # endif 11 | extern "C" { 12 | #endif 13 | 14 | #define crypto_shorthash_siphash24_BYTES 8U 15 | SODIUM_EXPORT 16 | size_t crypto_shorthash_siphash24_bytes(void); 17 | 18 | #define crypto_shorthash_siphash24_KEYBYTES 16U 19 | SODIUM_EXPORT 20 | size_t crypto_shorthash_siphash24_keybytes(void); 21 | 22 | SODIUM_EXPORT 23 | int crypto_shorthash_siphash24(unsigned char *out, const unsigned char *in, 24 | unsigned long long inlen, const unsigned char *k); 25 | 26 | #ifdef __cplusplus 27 | } 28 | #endif 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /ShadowPath/libsodium-ios/include/sodium/crypto_uint16.h: -------------------------------------------------------------------------------- 1 | #ifndef crypto_uint16_H 2 | #define crypto_uint16_H 3 | 4 | #include 5 | 6 | typedef uint16_t crypto_uint16; 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /ShadowPath/libsodium-ios/include/sodium/crypto_uint32.h: -------------------------------------------------------------------------------- 1 | #ifndef crypto_uint32_H 2 | #define crypto_uint32_H 3 | 4 | #include 5 | 6 | typedef uint32_t crypto_uint32; 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /ShadowPath/libsodium-ios/include/sodium/crypto_uint64.h: -------------------------------------------------------------------------------- 1 | #ifndef crypto_uint64_H 2 | #define crypto_uint64_H 3 | 4 | #include 5 | 6 | typedef uint64_t crypto_uint64; 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /ShadowPath/libsodium-ios/include/sodium/crypto_uint8.h: -------------------------------------------------------------------------------- 1 | #ifndef crypto_uint8_H 2 | #define crypto_uint8_H 3 | 4 | #include 5 | 6 | typedef uint8_t crypto_uint8; 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /ShadowPath/libsodium-ios/include/sodium/crypto_verify_16.h: -------------------------------------------------------------------------------- 1 | #ifndef crypto_verify_16_H 2 | #define crypto_verify_16_H 3 | 4 | #include 5 | #include "export.h" 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | #define crypto_verify_16_BYTES 16U 12 | SODIUM_EXPORT 13 | size_t crypto_verify_16_bytes(void); 14 | 15 | SODIUM_EXPORT 16 | int crypto_verify_16(const unsigned char *x, const unsigned char *y) 17 | __attribute__ ((warn_unused_result)); 18 | 19 | #ifdef __cplusplus 20 | } 21 | #endif 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /ShadowPath/libsodium-ios/include/sodium/crypto_verify_32.h: -------------------------------------------------------------------------------- 1 | #ifndef crypto_verify_32_H 2 | #define crypto_verify_32_H 3 | 4 | #include 5 | #include "export.h" 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | #define crypto_verify_32_BYTES 32U 12 | SODIUM_EXPORT 13 | size_t crypto_verify_32_bytes(void); 14 | 15 | SODIUM_EXPORT 16 | int crypto_verify_32(const unsigned char *x, const unsigned char *y) 17 | __attribute__ ((warn_unused_result)); 18 | 19 | #ifdef __cplusplus 20 | } 21 | #endif 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /ShadowPath/libsodium-ios/include/sodium/crypto_verify_64.h: -------------------------------------------------------------------------------- 1 | #ifndef crypto_verify_64_H 2 | #define crypto_verify_64_H 3 | 4 | #include 5 | #include "export.h" 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | #define crypto_verify_64_BYTES 64U 12 | SODIUM_EXPORT 13 | size_t crypto_verify_64_bytes(void); 14 | 15 | SODIUM_EXPORT 16 | int crypto_verify_64(const unsigned char *x, const unsigned char *y) 17 | __attribute__ ((warn_unused_result)); 18 | 19 | #ifdef __cplusplus 20 | } 21 | #endif 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /ShadowPath/libsodium-ios/include/sodium/export.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef sodium_export_H 3 | #define sodium_export_H 4 | 5 | #ifndef __GNUC__ 6 | # ifdef __attribute__ 7 | # undef __attribute__ 8 | # endif 9 | # define __attribute__(a) 10 | #endif 11 | 12 | #ifdef SODIUM_STATIC 13 | # define SODIUM_EXPORT 14 | #else 15 | # if defined(_MSC_VER) 16 | # ifdef SODIUM_DLL_EXPORT 17 | # define SODIUM_EXPORT __declspec(dllexport) 18 | # else 19 | # define SODIUM_EXPORT __declspec(dllimport) 20 | # endif 21 | # else 22 | # if defined(__SUNPRO_C) 23 | # ifndef __GNU_C__ 24 | # define SODIUM_EXPORT __attribute__ (visibility(__global)) 25 | # else 26 | # define SODIUM_EXPORT __attribute__ __global 27 | # endif 28 | # elif defined(_MSG_VER) 29 | # define SODIUM_EXPORT extern __declspec(dllexport) 30 | # else 31 | # define SODIUM_EXPORT __attribute__ ((visibility ("default"))) 32 | # endif 33 | # endif 34 | #endif 35 | 36 | #ifndef CRYPTO_ALIGN 37 | # if defined(__INTEL_COMPILER) || defined(_MSC_VER) 38 | # define CRYPTO_ALIGN(x) __declspec(align(x)) 39 | # else 40 | # define CRYPTO_ALIGN(x) __attribute__ ((aligned(x))) 41 | # endif 42 | #endif 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /ShadowPath/libsodium-ios/include/sodium/randombytes_salsa20_random.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef randombytes_salsa20_random_H 3 | #define randombytes_salsa20_random_H 4 | 5 | #include "export.h" 6 | #include "randombytes.h" 7 | 8 | #ifdef __cplusplus 9 | extern "C" { 10 | #endif 11 | 12 | SODIUM_EXPORT 13 | extern struct randombytes_implementation randombytes_salsa20_implementation; 14 | 15 | #ifdef __cplusplus 16 | } 17 | #endif 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /ShadowPath/libsodium-ios/include/sodium/randombytes_sysrandom.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef randombytes_sysrandom_H 3 | #define randombytes_sysrandom_H 4 | 5 | #include "export.h" 6 | #include "randombytes.h" 7 | 8 | #ifdef __cplusplus 9 | extern "C" { 10 | #endif 11 | 12 | SODIUM_EXPORT 13 | extern struct randombytes_implementation randombytes_sysrandom_implementation; 14 | 15 | #ifdef __cplusplus 16 | } 17 | #endif 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /ShadowPath/libsodium-ios/include/sodium/runtime.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef sodium_runtime_H 3 | #define sodium_runtime_H 4 | 5 | #include "export.h" 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | SODIUM_EXPORT 12 | int sodium_runtime_has_neon(void); 13 | 14 | SODIUM_EXPORT 15 | int sodium_runtime_has_sse2(void); 16 | 17 | SODIUM_EXPORT 18 | int sodium_runtime_has_sse3(void); 19 | 20 | SODIUM_EXPORT 21 | int sodium_runtime_has_ssse3(void); 22 | 23 | SODIUM_EXPORT 24 | int sodium_runtime_has_sse41(void); 25 | 26 | SODIUM_EXPORT 27 | int sodium_runtime_has_avx(void); 28 | 29 | SODIUM_EXPORT 30 | int sodium_runtime_has_pclmul(void); 31 | 32 | SODIUM_EXPORT 33 | int sodium_runtime_has_aesni(void); 34 | 35 | /* ------------------------------------------------------------------------- */ 36 | 37 | int _sodium_runtime_get_cpu_features(void); 38 | 39 | #ifdef __cplusplus 40 | } 41 | #endif 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /ShadowPath/libsodium-ios/include/sodium/version.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef sodium_version_H 3 | #define sodium_version_H 4 | 5 | #include "export.h" 6 | 7 | #define SODIUM_VERSION_STRING "1.0.9" 8 | 9 | #define SODIUM_LIBRARY_VERSION_MAJOR 9 10 | #define SODIUM_LIBRARY_VERSION_MINOR 2 11 | 12 | #ifdef __cplusplus 13 | extern "C" { 14 | #endif 15 | 16 | SODIUM_EXPORT 17 | const char *sodium_version_string(void); 18 | 19 | SODIUM_EXPORT 20 | int sodium_library_version_major(void); 21 | 22 | SODIUM_EXPORT 23 | int sodium_library_version_minor(void); 24 | 25 | #ifdef __cplusplus 26 | } 27 | #endif 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /ShadowPath/libsodium-ios/lib/libsodium.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qman9501/ShadowPath/51942d6b4cbacc056a33993a3aa4eb0db6afcd94/ShadowPath/libsodium-ios/lib/libsodium.a -------------------------------------------------------------------------------- /ShadowPath/mbedtls/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qman9501/ShadowPath/51942d6b4cbacc056a33993a3aa4eb0db6afcd94/ShadowPath/mbedtls/.DS_Store -------------------------------------------------------------------------------- /ShadowPath/mbedtls/include/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qman9501/ShadowPath/51942d6b4cbacc056a33993a3aa4eb0db6afcd94/ShadowPath/mbedtls/include/.DS_Store -------------------------------------------------------------------------------- /ShadowPath/mbedtls/lib/libmbedtls.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qman9501/ShadowPath/51942d6b4cbacc056a33993a3aa4eb0db6afcd94/ShadowPath/mbedtls/lib/libmbedtls.a -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qman9501/ShadowPath/51942d6b4cbacc056a33993a3aa4eb0db6afcd94/ShadowPath/shadowsocks-libev/.DS_Store -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/AUTHORS: -------------------------------------------------------------------------------- 1 | Shadowsocks-libev was originally created in late 2013, by 2 | Clowwindy , then rewritten and maintained by 3 | Max Lv . 4 | 5 | Here is an inevitably incomplete list of MUCH-APPRECIATED CONTRIBUTORS -- 6 | people who have submitted patches, fixed bugs, added translations, and 7 | generally made shadowsocks-libev that much better: 8 | 9 | https://github.com/shadowsocks/shadowsocks-libev/graphs/contributors 10 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/COPYING: -------------------------------------------------------------------------------- 1 | This program is free software: you can redistribute it and/or modify 2 | it under the terms of the GNU General Public License as published by 3 | the Free Software Foundation, either version 3 of the License, or 4 | (at your option) any later version. 5 | 6 | This program is distributed in the hope that it will be useful, 7 | but WITHOUT ANY WARRANTY; without even the implied warranty of 8 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 9 | GNU General Public License for more details. 10 | 11 | You should have received a copy of the GNU General Public License 12 | along with this program. If not, see . 13 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/Makefile.am: -------------------------------------------------------------------------------- 1 | if USE_SYSTEM_SHARED_LIB 2 | SUBDIRS = libcork libipset src 3 | else 4 | SUBDIRS = libsodium libcork libipset libudns libev src 5 | endif 6 | 7 | if ENABLE_DOCUMENTATION 8 | SUBDIRS += doc 9 | endif 10 | 11 | ACLOCAL_AMFLAGS = -I m4 12 | 13 | pkgconfiglibdir = $(libdir)/pkgconfig 14 | pkgconfiglib_DATA = shadowsocks-libev.pc 15 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/acl/local.acl: -------------------------------------------------------------------------------- 1 | 127.0.0.1 2 | ::1 3 | 10.0.0.0/8 4 | 172.16.0.0/12 5 | 192.168.0.0/16 6 | fc00::/7 7 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/autogen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | autoreconf --install --force 4 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/debian/.gitignore: -------------------------------------------------------------------------------- 1 | *.substvars 2 | debhelper-build-stamp 3 | libshadowsocks-libev1/ 4 | libshadowsocks-libev-dev/ 5 | tmp/ 6 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/debian/README.Debian: -------------------------------------------------------------------------------- 1 | shadowsocks-libev for Debian 2 | ---------------------- 3 | 4 | The Debian package has added systemd support. A default server service which 5 | reads the default configuration in /etc/default/shadowsocks-libev is installed 6 | and enabled by default, plus some other service templates placed in 7 | /lib/systemd/system, which can be used by users later. 8 | 9 | Another problem is that shadowsocks-libev is licensed under GPLv3+. This will 10 | conflict with OpenSSL License when linked against OpenSSL library. As a 11 | result, this package faces licensing problem. Use it at your own risk. 12 | 13 | -- Boyuan Yang <073plan@gmail.com> Wed, 14 Oct 2015 09:18:50 +0800 14 | 15 | (No special notes.) 16 | 17 | -- Max Lv Sat, 06 Apr 2013 16:59:15 +0800 18 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/debian/compat: -------------------------------------------------------------------------------- 1 | 9 2 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/debian/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "server":"127.0.0.1", 3 | "server_port":8388, 4 | "local_port":1080, 5 | "password":"barfoo!", 6 | "timeout":60, 7 | "method":null 8 | } 9 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/debian/copyright.original: -------------------------------------------------------------------------------- 1 | This work was packaged for Debian by: 2 | 3 | Max Lv on Sat, 06 Apr 2013 16:59:15 +0800 4 | 5 | It was downloaded from: 6 | 7 | https://github.com/madeye/shadowsocks-libev 8 | 9 | Upstream Author(s): 10 | 11 | clowwindy 12 | 13 | Copyright: 14 | 15 | Copyright (C) 2013 Max Lv 16 | 17 | License: 18 | 19 | GPLv3 20 | 21 | The Debian packaging is: 22 | 23 | Copyright (C) 2013 Max Lv 24 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/debian/libshadowsocks-libev-dev.install: -------------------------------------------------------------------------------- 1 | usr/include/ 2 | usr/lib/*/pkgconfig/ 3 | usr/lib/*/libshadowsocks-libev.so 4 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/debian/libshadowsocks-libev1.install: -------------------------------------------------------------------------------- 1 | usr/lib/*/libshadowsocks-libev.so.* 2 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # See debhelper(7) (uncomment to enable) 3 | # output every command that modifies files on the build system. 4 | #export DH_VERBOSE = 1 5 | 6 | # Security Hardening 7 | export DEB_BUILD_MAINT_OPTIONS = hardening=+all 8 | 9 | DPKG_EXPORT_BUILDFLAGS = 1 10 | include /usr/share/dpkg/buildflags.mk 11 | 12 | override_dh_auto_install: 13 | find src/ -name '*.la' -delete 14 | dh_auto_install 15 | 16 | override_dh_auto_configure: 17 | dh_auto_configure -- \ 18 | --enable-shared \ 19 | --disable-ssp 20 | 21 | override_dh_installchangelogs: 22 | dh_installchangelogs -XChanges 23 | 24 | %: 25 | dh $@ --with systemd 26 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/debian/shadowsocks-libev-local@.service: -------------------------------------------------------------------------------- 1 | # This file is part of shadowsocks-libev. 2 | # 3 | # Shadowsocks-libev is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; either version 3 of the License, or 6 | # (at your option) any later version. 7 | # 8 | # This is a template unit file. Users may copy and rename the file into 9 | # config directories to make new service instances. See systemd.unit(5) 10 | # for details. 11 | 12 | [Unit] 13 | Description=Shadowsocks-Libev Custom Client Service for %I 14 | Documentation=man:ss-local(1) 15 | After=network.target 16 | 17 | [Service] 18 | Type=simple 19 | CapabilityBoundingSet=CAP_NET_BIND_SERVICE 20 | ExecStart=/usr/bin/ss-local -c /etc/shadowsocks-libev/%i.json 21 | 22 | [Install] 23 | WantedBy=multi-user.target 24 | 25 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/debian/shadowsocks-libev-redir@.service: -------------------------------------------------------------------------------- 1 | # This file is part of shadowsocks-libev. 2 | # 3 | # Shadowsocks-libev is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; either version 3 of the License, or 6 | # (at your option) any later version. 7 | # 8 | # This is a template unit file. Users may copy and rename the file into 9 | # config directories to make new service instances. See systemd.unit(5) 10 | # for details. 11 | 12 | [Unit] 13 | Description=Shadowsocks-Libev Custom Client Service Redir Mode for %I 14 | Documentation=man:ss-redir(1) 15 | After=network.target 16 | 17 | [Service] 18 | Type=simple 19 | CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE 20 | ExecStart=/usr/bin/ss-redir -c /etc/shadowsocks-libev/%i.json 21 | 22 | [Install] 23 | WantedBy=multi-user.target 24 | 25 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/debian/shadowsocks-libev-server@.service: -------------------------------------------------------------------------------- 1 | # This file is part of shadowsocks-libev. 2 | # 3 | # Shadowsocks-libev is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; either version 3 of the License, or 6 | # (at your option) any later version. 7 | # 8 | # This is a template unit file. Users may copy and rename the file into 9 | # config directories to make new service instances. See systemd.unit(5) 10 | # for details. 11 | 12 | [Unit] 13 | Description=Shadowsocks-Libev Custom Server Service for %I 14 | Documentation=man:ss-server(1) 15 | After=network.target 16 | 17 | [Service] 18 | Type=simple 19 | CapabilityBoundingSet=CAP_NET_BIND_SERVICE 20 | ExecStart=/usr/bin/ss-server -c /etc/shadowsocks-libev/%i.json 21 | 22 | [Install] 23 | WantedBy=multi-user.target 24 | 25 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/debian/shadowsocks-libev-tunnel@.service: -------------------------------------------------------------------------------- 1 | # This file is part of shadowsocks-libev. 2 | # 3 | # Shadowsocks-libev is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; either version 3 of the License, or 6 | # (at your option) any later version. 7 | # 8 | # This is a template unit file. Users may copy and rename the file into 9 | # config directories to make new service instances. See systemd.unit(5) 10 | # for details. 11 | 12 | [Unit] 13 | Description=Shadowsocks-Libev Custom Client Service Tunnel Mode for %I 14 | Documentation=man:ss-tunnel(1) 15 | After=network.target 16 | 17 | [Service] 18 | Type=simple 19 | CapabilityBoundingSet=CAP_NET_BIND_SERVICE 20 | ExecStart=/usr/bin/ss-tunnel -c /etc/shadowsocks-libev/%i.json 21 | 22 | [Install] 23 | WantedBy=multi-user.target 24 | 25 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/debian/shadowsocks-libev.default: -------------------------------------------------------------------------------- 1 | # Defaults for shadowsocks initscript 2 | # sourced by /etc/init.d/shadowsocks-libev 3 | # installed at /etc/default/shadowsocks-libev by the maintainer scripts 4 | 5 | # 6 | # This is a POSIX shell fragment 7 | # 8 | # Note: `START', `GROUP' and `MAXFD' options are not recognized by systemd. 9 | # Please change those settings in the corresponding systemd unit file. 10 | 11 | # Enable during startup? 12 | START=yes 13 | 14 | # Configuration file 15 | CONFFILE="/etc/shadowsocks-libev/config.json" 16 | 17 | # Extra command line arguments 18 | DAEMON_ARGS="-u" 19 | 20 | # User and group to run the server as 21 | USER=root 22 | GROUP=root 23 | 24 | # Number of maximum file descriptors 25 | MAXFD=32768 26 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/debian/shadowsocks-libev.docs: -------------------------------------------------------------------------------- 1 | AUTHORS 2 | README.md 3 | debian/copyright.original 4 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/debian/shadowsocks-libev.install: -------------------------------------------------------------------------------- 1 | usr/bin/ 2 | usr/share/man/ 3 | debian/config.json usr/share/shadowsocks-libev 4 | debian/shadowsocks-libev-*.service lib/systemd/system 5 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/debian/shadowsocks-libev.postinst: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | case "$1" in 6 | configure|reconfigure) 7 | if [ ! -f /etc/shadowsocks-libev/config.json ]; then 8 | passwd=$(apg -n 1 -M ncl) 9 | mkdir -p /etc/shadowsocks-libev 10 | sed "s/barfoo!/$passwd/" /usr/share/shadowsocks-libev/config.json \ 11 | > /etc/shadowsocks-libev/config.json 12 | fi 13 | ;; 14 | abort-upgrade|abort-remove|abort-deconfigure) 15 | exit 0 16 | ;; 17 | *) 18 | echo "postinst called with unknown argument \`$1'" >&2 19 | exit 0 20 | ;; 21 | esac 22 | 23 | #DEBHELPER# 24 | 25 | exit 0 26 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/debian/shadowsocks-libev.postrm: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | case "$1" in 6 | purge) 7 | rm -f /etc/shadowsocks-libev/config.json 8 | test -f /etc/shadowsocks-libev/* \ 9 | || rm -r /etc/shadowsocks-libev/ 10 | ;; 11 | remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) 12 | exit 0 13 | ;; 14 | *) 15 | echo "postrm called with unknown argument \`$1'" >&2 16 | exit 0 17 | ;; 18 | esac 19 | 20 | #DEBHELPER# 21 | 22 | exit 0 23 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/debian/shadowsocks-libev.service: -------------------------------------------------------------------------------- 1 | # This file is part of shadowsocks-libev. 2 | # 3 | # Shadowsocks-libev is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; either version 3 of the License, or 6 | # (at your option) any later version. 7 | # 8 | # This file is default for Debian packaging. See also 9 | # /etc/default/shadowsocks-libev for environment variables. 10 | 11 | [Unit] 12 | Description=Shadowsocks-libev Default Server Service 13 | Documentation=man:shadowsocks-libev(8) 14 | After=network.target 15 | 16 | [Service] 17 | Type=simple 18 | EnvironmentFile=/etc/default/shadowsocks-libev 19 | User=root 20 | LimitNOFILE=32768 21 | ExecStart=/usr/bin/ss-server -a $USER -c $CONFFILE $DAEMON_ARGS 22 | 23 | [Install] 24 | WantedBy=multi-user.target 25 | 26 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/debian/source.lintian-overrides: -------------------------------------------------------------------------------- 1 | # false positive: #505857 2 | shadowsocks-libev source: debian-watch-file-should-mangle-version 3 | # false positive: #765166 4 | shadowsocks-libev source: license-problem-gfdl-invariants 5 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/debian/source/format: -------------------------------------------------------------------------------- 1 | 3.0 (quilt) 2 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/debian/watch: -------------------------------------------------------------------------------- 1 | version=4 2 | 3 | opts=" \ 4 | filenamemangle=s%(?:.*?)?v?(\d[\d.]*)\.tar\.gz%shadowsocks-libev-$1.tar.gz%" \ 5 | https://github.com/shadowsocks/shadowsocks-libev/tags \ 6 | (?:.*?/)?v?(\d[\d.]*)\.tar\.gz debian uupdate 7 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/doc/asciidoc.conf: -------------------------------------------------------------------------------- 1 | [tags] 2 | bracket-emphasis={1?[{1}]}<|> 3 | 4 | [quotes] 5 | <|>=#bracket-emphasis 6 | 7 | [attributes] 8 | asterisk=* 9 | plus=+ 10 | caret=^ 11 | startsb=[ 12 | endsb=] 13 | backslash=\ 14 | tilde=~ 15 | apostrophe=' 16 | backtick=` 17 | litdd=-- 18 | 19 | ifdef::doctype-manpage[] 20 | ifdef::backend-docbook[] 21 | [header] 22 | template::[header-declarations] 23 | 24 | 25 | {mantitle} 26 | {manvolnum} 27 | Shadowsocks-libev 28 | {version} 29 | Shadowsocks-libev Manual 30 | 31 | 32 | {manname} 33 | {manpurpose} 34 | 35 | endif::backend-docbook[] 36 | endif::doctype-manpage[] 37 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/doc/manpage-bold-literal.xsl: -------------------------------------------------------------------------------- 1 | 3 | 5 | 6 | 9 | 10 | 11 | fB 12 | 13 | 14 | fR 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/doc/manpage-normal.xsl: -------------------------------------------------------------------------------- 1 | 4 | 6 | 7 | 8 | 9 | 10 | \ 11 | . 12 | 13 | 14 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/docker/alpine/Dockerfile: -------------------------------------------------------------------------------- 1 | # 2 | # Dockerfile for shadowsocks-libev 3 | # 4 | 5 | FROM alpine 6 | MAINTAINER kev 7 | 8 | ENV SS_URL https://github.com/shadowsocks/shadowsocks-libev.git 9 | ENV SS_DIR shadowsocks-libev 10 | ENV SS_DEP git autoconf build-base curl libtool linux-headers openssl-dev asciidoc xmlto 11 | 12 | RUN set -ex \ 13 | && apk add --update $SS_DEP \ 14 | && git clone $SS_URL \ 15 | && cd $SS_DIR \ 16 | && ./configure \ 17 | && make install \ 18 | && cd .. \ 19 | && rm -rf $SS_DIR \ 20 | && apk del --purge $SS_DEP \ 21 | && rm -rf /var/cache/apk/* 22 | 23 | ENV SERVER_ADDR 0.0.0.0 24 | ENV SERVER_PORT 8388 25 | ENV PASSWORD= 26 | ENV METHOD aes-256-cfb 27 | ENV TIMEOUT 300 28 | ENV DNS_ADDR 8.8.8.8 29 | ENV DNS_ADDR_2 8.8.4.4 30 | 31 | EXPOSE $SERVER_PORT 32 | EXPOSE $SERVER_PORT/udp 33 | 34 | CMD ss-server -s $SERVER_ADDR \ 35 | -p $SERVER_PORT \ 36 | -k ${PASSWORD:-$(hostname)} \ 37 | -m $METHOD \ 38 | -t $TIMEOUT \ 39 | --fast-open \ 40 | -d $DNS_ADDR \ 41 | -d $DNS_ADDR_2 \ 42 | -u 43 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/docker/alpine/docker-compose.yml: -------------------------------------------------------------------------------- 1 | shadowsocks: 2 | image: shadowsocks-libev 3 | ports: 4 | - "8388:8388/tcp" 5 | - "8388:8388/udp" 6 | environment: 7 | - METHOD=aes-256-cfb 8 | - PASSWORD=9MLSpPmNt 9 | restart: always 10 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/docker/ubuntu/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:latest 2 | 3 | MAINTAINER Sah Lee 4 | 5 | ENV DEPENDENCIES git-core build-essential autoconf libtool libssl-dev asciidoc xmlto 6 | ENV BASEDIR /tmp/shadowsocks-libev 7 | ENV SERVER_PORT 8338 8 | 9 | # Set up building environment 10 | RUN apt-get update \ 11 | && apt-get install -y $DEPENDENCIES 12 | 13 | # Get the latest code, build and install 14 | RUN git clone https://github.com/shadowsocks/shadowsocks-libev.git $BASEDIR 15 | WORKDIR $BASEDIR 16 | RUN ./configure \ 17 | && make \ 18 | && make install 19 | 20 | # Tear down building environment and delete git repository 21 | WORKDIR / 22 | RUN rm -rf $BASEDIR/shadowsocks-libev\ 23 | && apt-get --purge autoremove -y $DEPENDENCIES 24 | 25 | # Port in the config file won't take affect. Instead we'll use 8388. 26 | EXPOSE $SERVER_PORT 27 | EXPOSE $SERVER_PORT/udp 28 | 29 | # Override the host and port in the config file. 30 | ADD entrypoint / 31 | ENTRYPOINT ["/entrypoint"] 32 | CMD ["-h"] 33 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libcork/core/hash.c: -------------------------------------------------------------------------------- 1 | /* -*- coding: utf-8 -*- 2 | * ---------------------------------------------------------------------- 3 | * Copyright © 2011, RedJack, LLC. 4 | * All rights reserved. 5 | * 6 | * Please see the COPYING file in this distribution for license 7 | * details. 8 | * ---------------------------------------------------------------------- 9 | */ 10 | 11 | #define CORK_HASH_ATTRIBUTES CORK_API 12 | 13 | #include "libcork/core/hash.h" 14 | #include "libcork/core/types.h" 15 | 16 | /* All of the following functions will be defined for us by libcork/core/hash.h: 17 | * cork_hash_buffer 18 | * cork_big_hash_buffer 19 | * cork_stable_hash_buffer 20 | */ 21 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libcork/include/libcork/cli.h: -------------------------------------------------------------------------------- 1 | /* -*- coding: utf-8 -*- 2 | * ---------------------------------------------------------------------- 3 | * Copyright © 2012, RedJack, LLC. 4 | * All rights reserved. 5 | * 6 | * Please see the COPYING file in this distribution for license 7 | * details. 8 | * ---------------------------------------------------------------------- 9 | */ 10 | 11 | #ifndef LIBCORK_CLI_H 12 | #define LIBCORK_CLI_H 13 | 14 | /*** include all of the parts ***/ 15 | 16 | #include 17 | 18 | #endif /* LIBCORK_CLI_H */ 19 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libcork/include/libcork/config.h: -------------------------------------------------------------------------------- 1 | /* -*- coding: utf-8 -*- 2 | * ---------------------------------------------------------------------- 3 | * Copyright © 2011, RedJack, LLC. 4 | * All rights reserved. 5 | * 6 | * Please see the COPYING file in this distribution for license 7 | * details. 8 | * ---------------------------------------------------------------------- 9 | */ 10 | 11 | #ifndef LIBCORK_CONFIG_H 12 | #define LIBCORK_CONFIG_H 13 | 14 | /*** include all of the parts ***/ 15 | 16 | #include 17 | 18 | #endif /* LIBCORK_CONFIG_H */ 19 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libcork/include/libcork/config/arch.h: -------------------------------------------------------------------------------- 1 | /* -*- coding: utf-8 -*- 2 | * ---------------------------------------------------------------------- 3 | * Copyright © 2012-2013, RedJack, LLC. 4 | * All rights reserved. 5 | * 6 | * Please see the COPYING file in this distribution for license 7 | * details. 8 | * ---------------------------------------------------------------------- 9 | */ 10 | 11 | #ifndef LIBCORK_CONFIG_ARCH_H 12 | #define LIBCORK_CONFIG_ARCH_H 13 | 14 | 15 | /*----------------------------------------------------------------------- 16 | * Platform 17 | */ 18 | 19 | #if defined(__i386__) || defined(_M_IX86) 20 | #define CORK_CONFIG_ARCH_X86 1 21 | #else 22 | #define CORK_CONFIG_ARCH_X86 0 23 | #endif 24 | 25 | #if defined(__x86_64__) || defined(_M_X64) 26 | #define CORK_CONFIG_ARCH_X64 1 27 | #else 28 | #define CORK_CONFIG_ARCH_X64 0 29 | #endif 30 | 31 | #if defined(__powerpc__) || defined(__ppc__) 32 | /* GCC-ish compiler */ 33 | #define CORK_CONFIG_ARCH_PPC 1 34 | #elif defined(_M_PPC) 35 | /* VS-ish compiler */ 36 | #define CORK_CONFIG_ARCH_PPC 1 37 | #elif defined(_ARCH_PPC) 38 | /* Something called XL C/C++? */ 39 | #define CORK_CONFIG_ARCH_PPC 1 40 | #else 41 | #define CORK_CONFIG_ARCH_PPC 0 42 | #endif 43 | 44 | 45 | #endif /* LIBCORK_CONFIG_ARCH_H */ 46 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libcork/include/libcork/config/bsd.h: -------------------------------------------------------------------------------- 1 | /* -*- coding: utf-8 -*- 2 | * ---------------------------------------------------------------------- 3 | * Copyright © 2013, RedJack, LLC. 4 | * All rights reserved. 5 | * 6 | * Please see the COPYING file in this distribution for license 7 | * details. 8 | * ---------------------------------------------------------------------- 9 | */ 10 | 11 | #ifndef LIBCORK_CONFIG_BSD_H 12 | #define LIBCORK_CONFIG_BSD_H 13 | 14 | /*----------------------------------------------------------------------- 15 | * Endianness 16 | */ 17 | 18 | #include 19 | 20 | #if BYTE_ORDER == BIG_ENDIAN 21 | #define CORK_CONFIG_IS_BIG_ENDIAN 1 22 | #define CORK_CONFIG_IS_LITTLE_ENDIAN 0 23 | #elif BYTE_ORDER == LITTLE_ENDIAN 24 | #define CORK_CONFIG_IS_BIG_ENDIAN 0 25 | #define CORK_CONFIG_IS_LITTLE_ENDIAN 1 26 | #else 27 | #error "Cannot determine system endianness" 28 | #endif 29 | 30 | #define CORK_HAVE_REALLOCF 1 31 | #define CORK_HAVE_PTHREADS 1 32 | 33 | 34 | #endif /* LIBCORK_CONFIG_BSD_H */ 35 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libcork/include/libcork/config/linux.h: -------------------------------------------------------------------------------- 1 | /* -*- coding: utf-8 -*- 2 | * ---------------------------------------------------------------------- 3 | * Copyright © 2011, RedJack, LLC. 4 | * All rights reserved. 5 | * 6 | * Please see the COPYING file in this distribution for license 7 | * details. 8 | * ---------------------------------------------------------------------- 9 | */ 10 | 11 | #ifndef LIBCORK_CONFIG_LINUX_H 12 | #define LIBCORK_CONFIG_LINUX_H 13 | 14 | /*----------------------------------------------------------------------- 15 | * Endianness 16 | */ 17 | 18 | #include 19 | 20 | #if __BYTE_ORDER == __BIG_ENDIAN 21 | #define CORK_CONFIG_IS_BIG_ENDIAN 1 22 | #define CORK_CONFIG_IS_LITTLE_ENDIAN 0 23 | #elif __BYTE_ORDER == __LITTLE_ENDIAN 24 | #define CORK_CONFIG_IS_BIG_ENDIAN 0 25 | #define CORK_CONFIG_IS_LITTLE_ENDIAN 1 26 | #else 27 | #error "Cannot determine system endianness" 28 | #endif 29 | 30 | #define CORK_HAVE_REALLOCF 0 31 | #define CORK_HAVE_PTHREADS 1 32 | 33 | 34 | #endif /* LIBCORK_CONFIG_LINUX_H */ 35 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libcork/include/libcork/config/macosx.h: -------------------------------------------------------------------------------- 1 | /* -*- coding: utf-8 -*- 2 | * ---------------------------------------------------------------------- 3 | * Copyright © 2011, RedJack, LLC. 4 | * All rights reserved. 5 | * 6 | * Please see the COPYING file in this distribution for license 7 | * details. 8 | * ---------------------------------------------------------------------- 9 | */ 10 | 11 | #ifndef LIBCORK_CONFIG_MACOSX_H 12 | #define LIBCORK_CONFIG_MACOSX_H 13 | 14 | /*----------------------------------------------------------------------- 15 | * Endianness 16 | */ 17 | 18 | #include 19 | 20 | #if BYTE_ORDER == BIG_ENDIAN 21 | #define CORK_CONFIG_IS_BIG_ENDIAN 1 22 | #define CORK_CONFIG_IS_LITTLE_ENDIAN 0 23 | #elif BYTE_ORDER == LITTLE_ENDIAN 24 | #define CORK_CONFIG_IS_BIG_ENDIAN 0 25 | #define CORK_CONFIG_IS_LITTLE_ENDIAN 1 26 | #else 27 | #error "Cannot determine system endianness" 28 | #endif 29 | 30 | #define CORK_HAVE_REALLOCF 1 31 | #define CORK_HAVE_PTHREADS 1 32 | 33 | 34 | #endif /* LIBCORK_CONFIG_MACOSX_H */ 35 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libcork/include/libcork/config/solaris.h: -------------------------------------------------------------------------------- 1 | /* -*- coding: utf-8 -*- 2 | * ---------------------------------------------------------------------- 3 | * Copyright © 2013, RedJack, LLC. 4 | * All rights reserved. 5 | * 6 | * Please see the COPYING file in this distribution for license 7 | * details. 8 | * ---------------------------------------------------------------------- 9 | */ 10 | 11 | #ifndef LIBCORK_CONFIG_SOLARIS_H 12 | #define LIBCORK_CONFIG_SOLARIS_H 13 | 14 | /*----------------------------------------------------------------------- 15 | * Endianness 16 | */ 17 | 18 | #include 19 | 20 | #if defined(_BIG_ENDIAN) 21 | #define CORK_CONFIG_IS_BIG_ENDIAN 1 22 | #define CORK_CONFIG_IS_LITTLE_ENDIAN 0 23 | #elif defined(_LITTLE_ENDIAN) 24 | #define CORK_CONFIG_IS_BIG_ENDIAN 0 25 | #define CORK_CONFIG_IS_LITTLE_ENDIAN 1 26 | #else 27 | #error "Cannot determine system endianness" 28 | #endif 29 | 30 | #define CORK_HAVE_REALLOCF 0 31 | #define CORK_HAVE_PTHREADS 1 32 | 33 | 34 | #endif /* LIBCORK_CONFIG_SOLARIS_H */ 35 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libcork/include/libcork/core.h: -------------------------------------------------------------------------------- 1 | /* -*- coding: utf-8 -*- 2 | * ---------------------------------------------------------------------- 3 | * Copyright © 2011-2013, RedJack, LLC. 4 | * All rights reserved. 5 | * 6 | * Please see the COPYING file in this distribution for license details. 7 | * ---------------------------------------------------------------------- 8 | */ 9 | 10 | #ifndef LIBCORK_CORE_H 11 | #define LIBCORK_CORE_H 12 | 13 | /*** include all of the parts ***/ 14 | 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | 29 | #endif /* LIBCORK_CORE_H */ 30 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libcork/include/libcork/core/api.h: -------------------------------------------------------------------------------- 1 | /* -*- coding: utf-8 -*- 2 | * ---------------------------------------------------------------------- 3 | * Copyright © 2012, RedJack, LLC. 4 | * All rights reserved. 5 | * 6 | * Please see the COPYING file in this distribution for license 7 | * details. 8 | * ---------------------------------------------------------------------- 9 | */ 10 | 11 | #ifndef LIBCORK_CORE_API_H 12 | #define LIBCORK_CORE_API_H 13 | 14 | #include 15 | 16 | /* If you're using libcork as a shared library, you don't need to do anything 17 | * special; the following will automatically set things up so that libcork's 18 | * public symbols are imported from the library. When we build the shared 19 | * library, we define this ourselves to export the symbols. */ 20 | 21 | #if !defined(CORK_API) 22 | #define CORK_API CORK_IMPORT 23 | #endif 24 | 25 | #endif /* LIBCORK_CORE_API_H */ 26 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libcork/include/libcork/core/callbacks.h: -------------------------------------------------------------------------------- 1 | /* -*- coding: utf-8 -*- 2 | * ---------------------------------------------------------------------- 3 | * Copyright © 2013, RedJack, LLC. 4 | * All rights reserved. 5 | * 6 | * Please see the COPYING file in this distribution for license details. 7 | * ---------------------------------------------------------------------- 8 | */ 9 | 10 | #ifndef LIBCORK_CORE_CALLBACKS_H 11 | #define LIBCORK_CORE_CALLBACKS_H 12 | 13 | 14 | #include 15 | 16 | 17 | typedef int 18 | (*cork_copy_f)(void *user_data, void *dest, const void *src); 19 | 20 | typedef void 21 | (*cork_done_f)(void *user_data, void *value); 22 | 23 | typedef void 24 | (*cork_free_f)(void *value); 25 | 26 | typedef cork_hash 27 | (*cork_hash_f)(void *user_data, const void *value); 28 | 29 | typedef bool 30 | (*cork_equals_f)(void *user_data, const void *value1, const void *value2); 31 | 32 | typedef void 33 | (*cork_init_f)(void *user_data, void *value); 34 | 35 | #define cork_free_user_data(parent) \ 36 | ((parent)->free_user_data == NULL? (void) 0: \ 37 | (parent)->free_user_data((parent)->user_data)) 38 | 39 | typedef void * 40 | (*cork_new_f)(void *user_data); 41 | 42 | 43 | #endif /* LIBCORK_CORE_CALLBACKS_H */ 44 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libcork/include/libcork/core/id.h: -------------------------------------------------------------------------------- 1 | /* -*- coding: utf-8 -*- 2 | * ---------------------------------------------------------------------- 3 | * Copyright © 2013, RedJack, LLC. 4 | * All rights reserved. 5 | * 6 | * Please see the COPYING file in this distribution for license details. 7 | * ---------------------------------------------------------------------- 8 | */ 9 | 10 | #ifndef LIBCORK_CORE_ID_H 11 | #define LIBCORK_CORE_ID_H 12 | 13 | #include 14 | 15 | 16 | struct cork_uid { 17 | const char *name; 18 | }; 19 | 20 | typedef const struct cork_uid *cork_uid; 21 | 22 | #define CORK_UID_NONE ((cork_uid) NULL) 23 | 24 | #define cork_uid_define_named(c_name, name) \ 25 | static const struct cork_uid c_name##__id = { name }; \ 26 | static cork_uid c_name = &c_name##__id; 27 | #define cork_uid_define(c_name) \ 28 | cork_uid_define_named(c_name, #c_name) 29 | 30 | #define cork_uid_equal(id1, id2) ((id1) == (id2)) 31 | #define cork_uid_hash(id) ((cork_hash) (uintptr_t) (id)) 32 | #define cork_uid_name(id) ((id)->name) 33 | 34 | 35 | #endif /* LIBCORK_CORE_ID_H */ 36 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libcork/include/libcork/ds.h: -------------------------------------------------------------------------------- 1 | /* -*- coding: utf-8 -*- 2 | * ---------------------------------------------------------------------- 3 | * Copyright © 2011, RedJack, LLC. 4 | * All rights reserved. 5 | * 6 | * Please see the COPYING file in this distribution for license 7 | * details. 8 | * ---------------------------------------------------------------------- 9 | */ 10 | 11 | #ifndef LIBCORK_DS_H 12 | #define LIBCORK_DS_H 13 | 14 | /*** include all of the parts ***/ 15 | 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | 26 | #endif /* LIBCORK_DS_H */ 27 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libcork/include/libcork/os.h: -------------------------------------------------------------------------------- 1 | /* -*- coding: utf-8 -*- 2 | * ---------------------------------------------------------------------- 3 | * Copyright © 2012-2013, RedJack, LLC. 4 | * All rights reserved. 5 | * 6 | * Please see the COPYING file in this distribution for license 7 | * details. 8 | * ---------------------------------------------------------------------- 9 | */ 10 | 11 | #ifndef LIBCORK_OS_H 12 | #define LIBCORK_OS_H 13 | 14 | /*** include all of the parts ***/ 15 | 16 | #include 17 | #include 18 | #include 19 | 20 | #endif /* LIBCORK_OS_H */ 21 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libcork/include/libcork/os/process.h: -------------------------------------------------------------------------------- 1 | /* -*- coding: utf-8 -*- 2 | * ---------------------------------------------------------------------- 3 | * Copyright © 2013, RedJack, LLC. 4 | * All rights reserved. 5 | * 6 | * Please see the COPYING file in this distribution for license 7 | * details. 8 | * ---------------------------------------------------------------------- 9 | */ 10 | 11 | #ifndef LIBCORK_CORE_PROCESS_H 12 | #define LIBCORK_CORE_PROCESS_H 13 | 14 | #include 15 | 16 | 17 | typedef void 18 | (*cork_cleanup_function)(void); 19 | 20 | CORK_API void 21 | cork_cleanup_at_exit_named(const char *name, int priority, 22 | cork_cleanup_function function); 23 | 24 | #define cork_cleanup_at_exit(priority, function) \ 25 | cork_cleanup_at_exit_named(#function, priority, function) 26 | 27 | 28 | #endif /* LIBCORK_CORE_PROCESS_H */ 29 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libcork/include/libcork/threads.h: -------------------------------------------------------------------------------- 1 | /* -*- coding: utf-8 -*- 2 | * ---------------------------------------------------------------------- 3 | * Copyright © 2012, RedJack, LLC. 4 | * All rights reserved. 5 | * 6 | * Please see the COPYING file in this distribution for license 7 | * details. 8 | * ---------------------------------------------------------------------- 9 | */ 10 | 11 | #ifndef LIBCORK_THREADS_H 12 | #define LIBCORK_THREADS_H 13 | 14 | /*** include all of the parts ***/ 15 | 16 | #include 17 | #include 18 | 19 | #endif /* LIBCORK_THREADS_H */ 20 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libev/Makefile.am: -------------------------------------------------------------------------------- 1 | AUTOMAKE_OPTIONS = foreign 2 | 3 | VERSION_INFO = 4:0:0 4 | 5 | EXTRA_DIST = LICENSE Changes libev.m4 autogen.sh \ 6 | ev_vars.h ev_wrap.h \ 7 | ev_epoll.c ev_select.c ev_poll.c ev_kqueue.c ev_port.c ev_win32.c \ 8 | ev.3 ev.pod Symbols.ev Symbols.event 9 | 10 | noinst_MANS = ev.3 11 | 12 | noinst_HEADERS = ev.h ev++.h event.h 13 | 14 | noinst_LTLIBRARIES = libev.la 15 | 16 | libev_la_SOURCES = ev.c event.c 17 | libev_la_LDFLAGS = -version-info $(VERSION_INFO) 18 | 19 | ev.3: ev.pod 20 | pod2man -n LIBEV -r "libev-$(VERSION)" -c "libev - high performance full featured event loop" -s3 <$< >$@ 21 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libev/Symbols.event: -------------------------------------------------------------------------------- 1 | event_active 2 | event_add 3 | event_base_dispatch 4 | event_base_free 5 | event_base_get_method 6 | event_base_loop 7 | event_base_loopexit 8 | event_base_new 9 | event_base_once 10 | event_base_priority_init 11 | event_base_set 12 | event_del 13 | event_dispatch 14 | event_get_callback 15 | event_get_method 16 | event_get_version 17 | event_init 18 | event_loop 19 | event_loopexit 20 | event_once 21 | event_pending 22 | event_priority_init 23 | event_priority_set 24 | event_set 25 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libev/autogen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | autoreconf --install --symlink --force 4 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libev/configure.ac: -------------------------------------------------------------------------------- 1 | AC_INIT 2 | 3 | orig_CFLAGS="$CFLAGS" 4 | 5 | AC_CONFIG_SRCDIR([ev_epoll.c]) 6 | 7 | dnl also update ev.h! 8 | AM_INIT_AUTOMAKE(libev,4.20) 9 | AC_CONFIG_HEADERS([config.h]) 10 | AM_MAINTAINER_MODE 11 | 12 | AC_PROG_CC 13 | 14 | dnl Supply default CFLAGS, if not specified 15 | if test -z "$orig_CFLAGS"; then 16 | if test x$GCC = xyes; then 17 | CFLAGS="-g -O3" 18 | fi 19 | fi 20 | 21 | AC_PROG_INSTALL 22 | AC_PROG_LIBTOOL 23 | 24 | m4_include([libev.m4]) 25 | 26 | AC_CONFIG_FILES([Makefile]) 27 | AC_OUTPUT 28 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libipset/README.markdown: -------------------------------------------------------------------------------- 1 | # ipset 2 | 3 | The ipset library provides C data types for storing sets of IP 4 | addresses, and maps of IP addresses to integers. It supports both 5 | IPv4 and IPv6 addresses. It's implemented using [Binary Decision 6 | Diagrams](http://en.wikipedia.org/wiki/Binary_decision_diagram) 7 | (BDDs), which (we hypothesize) makes it space efficient for large 8 | sets. 9 | 10 | Please see the INSTALL file for installation instructions. 11 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libipset/bdd/Makefile.am: -------------------------------------------------------------------------------- 1 | # This file is part of libasyncns. 2 | # 3 | # Copyright 2005-2008 Lennart Poettering 4 | # 5 | # libasyncns is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU Lesser General Public License as 7 | # published by the Free Software Foundation, either version 2.1 of the 8 | # License, or (at your option) any later version. 9 | # 10 | # libasyncns is distributed in the hope that it will be useful, but 11 | # WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | # Lesser General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU Lesser General Public 16 | # License along with libasyncns. If not, see 17 | # . 18 | 19 | noinst_LTLIBRARIES = libipset.la 20 | 21 | bdd_src = bdd/assignments.c bdd/basics.c bdd/bdd-iterator.c bdd/expanded.c \ 22 | bdd/reachable.c bdd/read.c bdd/write.c 23 | map_src = map/allocation.c map/inspection.c map/ipv4_map.c map/ipv6_map.c \ 24 | map/storage.c 25 | set_src = set/allocation.c set/inspection.c set/ipv4_set.c set/ipv6_set.c \ 26 | set/iterator.c set/storage.c 27 | 28 | libipset_la_SOURCES = ${bdd_src} ${map_src} ${set_src} 29 | 30 | libipset_la_LDFLAGS = -static 31 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libipset/bdd/Makefile.in: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qman9501/ShadowPath/51942d6b4cbacc056a33993a3aa4eb0db6afcd94/ShadowPath/shadowsocks-libev/libipset/bdd/Makefile.in -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libipset/general.c: -------------------------------------------------------------------------------- 1 | /* -*- coding: utf-8 -*- 2 | * ---------------------------------------------------------------------- 3 | * Copyright © 2009-2012, RedJack, LLC. 4 | * All rights reserved. 5 | * 6 | * Please see the LICENSE.txt file in this distribution for license 7 | * details. 8 | * ---------------------------------------------------------------------- 9 | */ 10 | 11 | #include 12 | 13 | #include "ipset/bdd/nodes.h" 14 | #include "ipset/ipset.h" 15 | 16 | 17 | int 18 | ipset_init_library() 19 | { 20 | return 0; 21 | } 22 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libipset/include/ipset/errors.h: -------------------------------------------------------------------------------- 1 | /* -*- coding: utf-8 -*- 2 | * ---------------------------------------------------------------------- 3 | * Copyright © 2012, RedJack, LLC. 4 | * All rights reserved. 5 | * 6 | * Please see the LICENSE.txt file in this distribution for license 7 | * details. 8 | * ---------------------------------------------------------------------- 9 | */ 10 | 11 | #ifndef IPSET_ERRORS_H 12 | #define IPSET_ERRORS_H 13 | 14 | 15 | #include 16 | 17 | 18 | /*----------------------------------------------------------------------- 19 | * Error reporting 20 | */ 21 | 22 | /* Hash of "ipset.h" */ 23 | #define IPSET_ERROR 0xf2000181 24 | 25 | enum ipset_error { 26 | IPSET_IO_ERROR, 27 | IPSET_PARSE_ERROR 28 | }; 29 | 30 | 31 | #endif /* IPSET_ERRORS_H */ 32 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libipset/include/ipset/logging.h: -------------------------------------------------------------------------------- 1 | /* -*- coding: utf-8 -*- 2 | * ---------------------------------------------------------------------- 3 | * Copyright © 2010-2012, RedJack, LLC. 4 | * All rights reserved. 5 | * 6 | * Please see the LICENSE.txt file in this distribution for license 7 | * details. 8 | * ---------------------------------------------------------------------- 9 | */ 10 | 11 | #ifndef IPSET_LOGGING_H 12 | #define IPSET_LOGGING_H 13 | 14 | 15 | #if !defined(IPSET_DEBUG) 16 | #define IPSET_DEBUG 0 17 | #endif 18 | 19 | #if IPSET_DEBUG 20 | #include 21 | #define DEBUG(...) \ 22 | do { \ 23 | fprintf(stderr, __VA_ARGS__); \ 24 | fprintf(stderr, "\n"); \ 25 | } while (0) 26 | #else 27 | #define DEBUG(...) /* no debug messages */ 28 | #endif 29 | 30 | 31 | #endif /* IPSET_LOGGING_H */ 32 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libipset/map/Makefile.am: -------------------------------------------------------------------------------- 1 | # This file is part of libasyncns. 2 | # 3 | # Copyright 2005-2008 Lennart Poettering 4 | # 5 | # libasyncns is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU Lesser General Public License as 7 | # published by the Free Software Foundation, either version 2.1 of the 8 | # License, or (at your option) any later version. 9 | # 10 | # libasyncns is distributed in the hope that it will be useful, but 11 | # WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | # Lesser General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU Lesser General Public 16 | # License along with libasyncns. If not, see 17 | # . 18 | 19 | noinst_LTLIBRARIES = libipset.la 20 | 21 | bdd_src = bdd/assignments.c bdd/basics.c bdd/bdd-iterator.c bdd/expanded.c \ 22 | bdd/reachable.c bdd/read.c bdd/write.c 23 | map_src = map/allocation.c map/inspection.c map/ipv4_map.c map/ipv6_map.c \ 24 | map/storage.c 25 | set_src = set/allocation.c set/inspection.c set/ipv4_set.c set/ipv6_set.c \ 26 | set/iterator.c set/storage.c 27 | 28 | libipset_la_SOURCES = ${bdd_src} ${map_src} ${set_src} 29 | 30 | libipset_la_LDFLAGS = -static 31 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libipset/map/Makefile.in: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qman9501/ShadowPath/51942d6b4cbacc056a33993a3aa4eb0db6afcd94/ShadowPath/shadowsocks-libev/libipset/map/Makefile.in -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libipset/map/allocation.c: -------------------------------------------------------------------------------- 1 | /* -*- coding: utf-8 -*- 2 | * ---------------------------------------------------------------------- 3 | * Copyright © 2009-2012, RedJack, LLC. 4 | * All rights reserved. 5 | * 6 | * Please see the LICENSE.txt file in this distribution for license 7 | * details. 8 | * ---------------------------------------------------------------------- 9 | */ 10 | 11 | #include 12 | 13 | #include "ipset/bdd/nodes.h" 14 | #include "ipset/ipset.h" 15 | 16 | 17 | void 18 | ipmap_init(struct ip_map *map, int default_value) 19 | { 20 | /* The map starts empty, so every value assignment should yield the 21 | * default. */ 22 | map->cache = ipset_node_cache_new(); 23 | map->default_bdd = ipset_terminal_node_id(default_value); 24 | map->map_bdd = map->default_bdd; 25 | } 26 | 27 | 28 | struct ip_map * 29 | ipmap_new(int default_value) 30 | { 31 | struct ip_map *result = cork_new(struct ip_map); 32 | ipmap_init(result, default_value); 33 | return result; 34 | } 35 | 36 | 37 | void 38 | ipmap_done(struct ip_map *map) 39 | { 40 | ipset_node_decref(map->cache, map->map_bdd); 41 | ipset_node_cache_free(map->cache); 42 | } 43 | 44 | 45 | void 46 | ipmap_free(struct ip_map *map) 47 | { 48 | ipmap_done(map); 49 | free(map); 50 | } 51 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libipset/set/Makefile.am: -------------------------------------------------------------------------------- 1 | # This file is part of libasyncns. 2 | # 3 | # Copyright 2005-2008 Lennart Poettering 4 | # 5 | # libasyncns is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU Lesser General Public License as 7 | # published by the Free Software Foundation, either version 2.1 of the 8 | # License, or (at your option) any later version. 9 | # 10 | # libasyncns is distributed in the hope that it will be useful, but 11 | # WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | # Lesser General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU Lesser General Public 16 | # License along with libasyncns. If not, see 17 | # . 18 | 19 | noinst_LTLIBRARIES = libipset.la 20 | 21 | bdd_src = bdd/assignments.c bdd/basics.c bdd/bdd-iterator.c bdd/expanded.c \ 22 | bdd/reachable.c bdd/read.c bdd/write.c 23 | map_src = map/allocation.c map/inspection.c map/ipv4_map.c map/ipv6_map.c \ 24 | map/storage.c 25 | set_src = set/allocation.c set/inspection.c set/ipv4_set.c set/ipv6_set.c \ 26 | set/iterator.c set/storage.c 27 | 28 | libipset_la_SOURCES = ${bdd_src} ${map_src} ${set_src} 29 | 30 | libipset_la_LDFLAGS = -static 31 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libipset/set/Makefile.in: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qman9501/ShadowPath/51942d6b4cbacc056a33993a3aa4eb0db6afcd94/ShadowPath/shadowsocks-libev/libipset/set/Makefile.in -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libipset/set/allocation.c: -------------------------------------------------------------------------------- 1 | /* -*- coding: utf-8 -*- 2 | * ---------------------------------------------------------------------- 3 | * Copyright © 2009-2012, RedJack, LLC. 4 | * All rights reserved. 5 | * 6 | * Please see the LICENSE.txt file in this distribution for license 7 | * details. 8 | * ---------------------------------------------------------------------- 9 | */ 10 | 11 | #include 12 | 13 | #include "ipset/bdd/nodes.h" 14 | #include "ipset/ipset.h" 15 | 16 | 17 | void 18 | ipset_init(struct ip_set *set) 19 | { 20 | /* The set starts empty, so every value assignment should yield 21 | * false. */ 22 | set->cache = ipset_node_cache_new(); 23 | set->set_bdd = ipset_terminal_node_id(false); 24 | } 25 | 26 | 27 | struct ip_set * 28 | ipset_new(void) 29 | { 30 | struct ip_set *result = cork_new(struct ip_set); 31 | ipset_init(result); 32 | return result; 33 | } 34 | 35 | 36 | void 37 | ipset_done(struct ip_set *set) 38 | { 39 | ipset_node_decref(set->cache, set->set_bdd); 40 | ipset_node_cache_free(set->cache); 41 | } 42 | 43 | 44 | void 45 | ipset_free(struct ip_set *set) 46 | { 47 | ipset_done(set); 48 | free(set); 49 | } 50 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/.travis.yml: -------------------------------------------------------------------------------- 1 | language: c 2 | 3 | os: 4 | - linux 5 | - osx 6 | 7 | compiler: 8 | - clang 9 | - gcc 10 | - g++ 11 | 12 | before_script: 13 | - ./autogen.sh 14 | 15 | script: 16 | - ./configure --disable-dependency-tracking 17 | - make distcheck 18 | - make distclean 19 | - ./configure --disable-dependency-tracking --enable-minimal 20 | - make distcheck 21 | 22 | env: 23 | global: 24 | - secure: "P4qv8aX+nogLlSy0lTMDIR6I5OLXq+qMijB4s+oCLME5BL2xPAn3v0QG5IoHdnU0ncRc1tEYZxN3F48Rp+Q7+wEVqSBLFS3oXzfNHJGEYoiaAcPNWO0R1kF8rcy8AuoAEomNeYS+5vhzQtaXklNtx/250p6MgGuMsdpMsRUKS/U=" 25 | 26 | addons: 27 | coverity_scan: 28 | project: 29 | name: "jedisct1/libsodium" 30 | description: "libsodium" 31 | notification_email: coverityscan@pureftpd.org 32 | build_command_prepend: "./autogen.sh ; ./configure" 33 | build_command: "make -j4" 34 | branch_pattern: coverity_scan 35 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/LICENSE: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2015 3 | * Frank Denis 4 | * 5 | * Permission to use, copy, modify, and/or distribute this software for any 6 | * purpose with or without fee is hereby granted, provided that the above 7 | * copyright notice and this permission notice appear in all copies. 8 | * 9 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 | */ 17 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/Makefile.am: -------------------------------------------------------------------------------- 1 | ACLOCAL_AMFLAGS = -I m4 2 | 3 | EXTRA_DIST = \ 4 | autogen.sh \ 5 | libsodium.sln \ 6 | libsodium.vcxproj \ 7 | libsodium.vcxproj.filters \ 8 | LICENSE \ 9 | README.markdown \ 10 | THANKS 11 | 12 | SUBDIRS = \ 13 | src 14 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/README: -------------------------------------------------------------------------------- 1 | See README.markdown 2 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/THANKS: -------------------------------------------------------------------------------- 1 | @alethia7 2 | @dnaq 3 | @harleqin 4 | @joshjdevl 5 | @jshahbazi 6 | @lvh 7 | @neheb 8 | Amit Murthy (@amitmurthy) 9 | Bruno Oliveira (@abstractj) 10 | Christian Wiese (@morfoh) 11 | Chris Rebert (@cvrebert) 12 | Colm MacCárthaigh (@colmmacc) 13 | Donald Stufft (@dstufft) 14 | Douglas Campos (@qmx) 15 | Drew Crawford (@drewcrawford) 16 | Eric Dong (@quantum1423) 17 | Eric Voskuil (@evoskuil) 18 | Frank Siebenlist (@franks42) 19 | Gabriel Handford (@gabriel) 20 | Jachym Holecek (@freza) 21 | Jan de Muijnck-Hughes (@jfdm) 22 | Jason McCampbell (@jasonmccampbell) 23 | Jeroen Habraken (@VeXocide) 24 | Jesper Louis Andersen (@jlouis) 25 | Joseph Abrahamson (@tel) 26 | Kenneth Ballenegger (@kballenegger) 27 | Loic Maury (@loicmaury) 28 | Michael Gorlick (@mgorlick) 29 | Michael Gregorowicz (@mgregoro) 30 | Omar Ayub (@electricFeel) 31 | Pedro Paixao (@paixaop) 32 | Project ArteMisc (@artemisc) 33 | Ruben De Visscher (@rubendv) 34 | Rudolf Von Krugstein (@rudolfvonkrugstein) 35 | Samuel Neves (@sneves) 36 | Scott Arciszewski (@paragonie-scott) 37 | Stefan Marsiske 38 | Stephan Touset (@stouset) 39 | Steve Gibson (@sggrc) 40 | Tony Arcieri (@bascule) 41 | Tony Garnock-Jones (@tonyg) 42 | Y. T. Chung (@zonyitoo) 43 | 44 | FSF France 45 | Coverity, Inc. 46 | OpenDNS, Inc. 47 | OVH 48 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/autogen.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | if glibtoolize --version > /dev/null 2>&1; then 4 | LIBTOOLIZE='glibtoolize' 5 | else 6 | LIBTOOLIZE='libtoolize' 7 | fi 8 | 9 | if [ ! -x "`which $LIBTOOLIZE 2>/dev/null`" ] ; then 10 | echo "libtool is required, but wasn't found on this system" 11 | exit 1 12 | fi 13 | 14 | if [ ! -x "`which autoconf 2>/dev/null`" ] ; then 15 | echo "autoconf is required, but wasn't found on this system" 16 | exit 1 17 | fi 18 | 19 | if [ ! -x "`which automake 2>/dev/null`" ] ; then 20 | echo "automake is required, but wasn't found on this system" 21 | exit 1 22 | fi 23 | 24 | if [ ! -x "`which pkg-config 2>/dev/null`" ] ; then 25 | echo "pkg-config is required, but wasn't found on this system" 26 | exit 1 27 | fi 28 | 29 | if [ -x "`which autoreconf 2>/dev/null`" ] ; then 30 | exec autoreconf -ivf 31 | fi 32 | 33 | $LIBTOOLIZE && \ 34 | aclocal && \ 35 | automake --add-missing --force-missing --include-deps && \ 36 | autoconf 37 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/libsodium.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: @PACKAGE_NAME@ 7 | Version: @PACKAGE_VERSION@ 8 | Description: A portable, cross-compilable, installable, packageable fork of NaCl, with a compatible API. 9 | 10 | Libs: -L${libdir} -lsodium 11 | Cflags: -I${includedir} 12 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qman9501/ShadowPath/51942d6b4cbacc056a33993a3aa4eb0db6afcd94/ShadowPath/shadowsocks-libev/libsodium/logo.png -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/m4/ld-output-def.m4: -------------------------------------------------------------------------------- 1 | # ld-output-def.m4 serial 2 2 | dnl Copyright (C) 2008-2013 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | dnl From Simon Josefsson 8 | 9 | # gl_LD_OUTPUT_DEF() 10 | # ------------- 11 | # Check if linker supports -Wl,--output-def and define automake 12 | # conditional HAVE_LD_OUTPUT_DEF if it is. 13 | AC_DEFUN([gl_LD_OUTPUT_DEF], 14 | [ 15 | AC_CACHE_CHECK([if gcc/ld supports -Wl,--output-def], 16 | [gl_cv_ld_output_def], 17 | [if test "$enable_shared" = no; then 18 | gl_cv_ld_output_def="not needed, shared libraries are disabled" 19 | else 20 | gl_ldflags_save=$LDFLAGS 21 | LDFLAGS="-Wl,--output-def,conftest.def" 22 | AC_LINK_IFELSE([AC_LANG_PROGRAM([])], 23 | [gl_cv_ld_output_def=yes], 24 | [gl_cv_ld_output_def=no]) 25 | rm -f conftest.def 26 | LDFLAGS="$gl_ldflags_save" 27 | fi]) 28 | AM_CONDITIONAL([HAVE_LD_OUTPUT_DEF], test "x$gl_cv_ld_output_def" = "xyes") 29 | ]) 30 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/packaging/nuget/.gitignore: -------------------------------------------------------------------------------- 1 | *.nupkg 2 | package.nuspec 3 | package.targets 4 | package.xml 5 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/packaging/nuget/package.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | ECHO Started nuget packaging build. 3 | ECHO. 4 | REM http://www.nuget.org/packages/gsl 5 | gsl -q -script:package.gsl package.config 6 | ECHO. 7 | REM http://nuget.codeplex.com/releases 8 | nuget pack package.nuspec -verbosity detailed 9 | ECHO. 10 | ECHO NOTE: Ignore warnings not applicable to native code: "Issue: Assembly outside lib folder." 11 | ECHO. 12 | ECHO Completed nuget packaging build. The package is in the following folder: 13 | CD -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/packaging/nuget/package.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | SUBDIRS = \ 3 | libsodium 4 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_auth/crypto_auth.c: -------------------------------------------------------------------------------- 1 | 2 | #include "crypto_auth.h" 3 | 4 | size_t 5 | crypto_auth_bytes(void) 6 | { 7 | return crypto_auth_BYTES; 8 | } 9 | 10 | size_t 11 | crypto_auth_keybytes(void) 12 | { 13 | return crypto_auth_KEYBYTES; 14 | } 15 | 16 | const char * 17 | crypto_auth_primitive(void) 18 | { 19 | return crypto_auth_PRIMITIVE; 20 | } 21 | 22 | int 23 | crypto_auth(unsigned char *out, const unsigned char *in, 24 | unsigned long long inlen, const unsigned char *k) 25 | { 26 | return crypto_auth_hmacsha512256(out, in, inlen, k); 27 | } 28 | 29 | int 30 | crypto_auth_verify(const unsigned char *h, const unsigned char *in, 31 | unsigned long long inlen,const unsigned char *k) 32 | { 33 | return crypto_auth_hmacsha512256_verify(h, in, inlen, k); 34 | } 35 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_auth/hmacsha256/auth_hmacsha256_api.c: -------------------------------------------------------------------------------- 1 | #include "crypto_auth_hmacsha256.h" 2 | 3 | size_t 4 | crypto_auth_hmacsha256_bytes(void) { 5 | return crypto_auth_hmacsha256_BYTES; 6 | } 7 | 8 | size_t 9 | crypto_auth_hmacsha256_keybytes(void) { 10 | return crypto_auth_hmacsha256_KEYBYTES; 11 | } 12 | 13 | size_t 14 | crypto_auth_hmacsha256_statebytes(void) { 15 | return sizeof(crypto_auth_hmacsha256_state); 16 | } 17 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_auth/hmacsha256/cp/verify_hmacsha256.c: -------------------------------------------------------------------------------- 1 | #include "crypto_auth_hmacsha256.h" 2 | #include "crypto_verify_32.h" 3 | #include "utils.h" 4 | 5 | int crypto_auth_hmacsha256_verify(const unsigned char *h,const unsigned char *in,unsigned long long inlen,const unsigned char *k) 6 | { 7 | unsigned char correct[32]; 8 | crypto_auth_hmacsha256(correct,in,inlen,k); 9 | return crypto_verify_32(h,correct) | (-(h == correct)) | 10 | sodium_memcmp(correct,h,32); 11 | } 12 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_auth/hmacsha512/auth_hmacsha512_api.c: -------------------------------------------------------------------------------- 1 | #include "crypto_auth_hmacsha512.h" 2 | 3 | size_t 4 | crypto_auth_hmacsha512_bytes(void) { 5 | return crypto_auth_hmacsha512_BYTES; 6 | } 7 | 8 | size_t 9 | crypto_auth_hmacsha512_keybytes(void) { 10 | return crypto_auth_hmacsha512_KEYBYTES; 11 | } 12 | 13 | size_t 14 | crypto_auth_hmacsha512_statebytes(void) { 15 | return sizeof(crypto_auth_hmacsha512_state); 16 | } 17 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_auth/hmacsha512/cp/verify_hmacsha512.c: -------------------------------------------------------------------------------- 1 | #include "crypto_auth_hmacsha512.h" 2 | #include "crypto_verify_64.h" 3 | #include "utils.h" 4 | 5 | int crypto_auth_hmacsha512_verify(const unsigned char *h, const unsigned char *in, 6 | unsigned long long inlen, const unsigned char *k) 7 | { 8 | unsigned char correct[64]; 9 | crypto_auth_hmacsha512(correct,in,inlen,k); 10 | return crypto_verify_64(h,correct) | (-(h == correct)) | 11 | sodium_memcmp(correct,h,64); 12 | } 13 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_auth/hmacsha512256/auth_hmacsha512256_api.c: -------------------------------------------------------------------------------- 1 | #include "crypto_auth_hmacsha512256.h" 2 | 3 | size_t 4 | crypto_auth_hmacsha512256_bytes(void) { 5 | return crypto_auth_hmacsha512256_BYTES; 6 | } 7 | 8 | size_t 9 | crypto_auth_hmacsha512256_keybytes(void) { 10 | return crypto_auth_hmacsha512256_KEYBYTES; 11 | } 12 | 13 | size_t 14 | crypto_auth_hmacsha512256_statebytes(void) { 15 | return sizeof(crypto_auth_hmacsha512256_state); 16 | } 17 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_auth/hmacsha512256/cp/verify_hmacsha512256.c: -------------------------------------------------------------------------------- 1 | #include "crypto_auth_hmacsha512256.h" 2 | #include "crypto_verify_32.h" 3 | #include "utils.h" 4 | 5 | int crypto_auth_hmacsha512256_verify(const unsigned char *h, 6 | const unsigned char *in, 7 | unsigned long long inlen, 8 | const unsigned char *k) 9 | { 10 | unsigned char correct[32]; 11 | crypto_auth_hmacsha512256(correct,in,inlen,k); 12 | return crypto_verify_32(h,correct) | (-(h == correct)) | 13 | sodium_memcmp(correct,h,32); 14 | } 15 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_box/curve25519xsalsa20poly1305/ref/after_curve25519xsalsa20poly1305.c: -------------------------------------------------------------------------------- 1 | #include "crypto_box_curve25519xsalsa20poly1305.h" 2 | #include "crypto_secretbox_xsalsa20poly1305.h" 3 | 4 | int crypto_box_curve25519xsalsa20poly1305_afternm( 5 | unsigned char *c, 6 | const unsigned char *m,unsigned long long mlen, 7 | const unsigned char *n, 8 | const unsigned char *k 9 | ) 10 | { 11 | return crypto_secretbox_xsalsa20poly1305(c,m,mlen,n,k); 12 | } 13 | 14 | int crypto_box_curve25519xsalsa20poly1305_open_afternm( 15 | unsigned char *m, 16 | const unsigned char *c,unsigned long long clen, 17 | const unsigned char *n, 18 | const unsigned char *k 19 | ) 20 | { 21 | return crypto_secretbox_xsalsa20poly1305_open(m,c,clen,n,k); 22 | } 23 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_box/curve25519xsalsa20poly1305/ref/before_curve25519xsalsa20poly1305.c: -------------------------------------------------------------------------------- 1 | #include "crypto_box_curve25519xsalsa20poly1305.h" 2 | #include "crypto_core_hsalsa20.h" 3 | #include "crypto_scalarmult_curve25519.h" 4 | 5 | static const unsigned char sigma[16] = { 6 | 'e', 'x', 'p', 'a', 'n', 'd', ' ', '3', '2', '-', 'b', 'y', 't', 'e', ' ', 'k' 7 | }; 8 | static const unsigned char n[16] = {0}; 9 | 10 | int crypto_box_curve25519xsalsa20poly1305_beforenm( 11 | unsigned char *k, 12 | const unsigned char *pk, 13 | const unsigned char *sk 14 | ) 15 | { 16 | unsigned char s[32]; 17 | if (crypto_scalarmult_curve25519(s,sk,pk) != 0) { 18 | return -1; 19 | } 20 | return crypto_core_hsalsa20(k,n,s,sigma); 21 | } 22 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_box/curve25519xsalsa20poly1305/ref/keypair_curve25519xsalsa20poly1305.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "crypto_box_curve25519xsalsa20poly1305.h" 4 | #include "crypto_hash_sha512.h" 5 | #include "crypto_scalarmult_curve25519.h" 6 | #include "randombytes.h" 7 | #include "utils.h" 8 | 9 | int crypto_box_curve25519xsalsa20poly1305_seed_keypair( 10 | unsigned char *pk, 11 | unsigned char *sk, 12 | const unsigned char *seed 13 | ) 14 | { 15 | unsigned char hash[64]; 16 | crypto_hash_sha512(hash,seed,32); 17 | memmove(sk,hash,32); 18 | sodium_memzero(hash, sizeof hash); 19 | return crypto_scalarmult_curve25519_base(pk,sk); 20 | } 21 | 22 | int crypto_box_curve25519xsalsa20poly1305_keypair( 23 | unsigned char *pk, 24 | unsigned char *sk 25 | ) 26 | { 27 | randombytes_buf(sk,32); 28 | return crypto_scalarmult_curve25519_base(pk,sk); 29 | } 30 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_core/hsalsa20/core_hsalsa20_api.c: -------------------------------------------------------------------------------- 1 | #include "crypto_core_hsalsa20.h" 2 | 3 | size_t 4 | crypto_core_hsalsa20_outputbytes(void) { 5 | return crypto_core_hsalsa20_OUTPUTBYTES; 6 | } 7 | 8 | size_t 9 | crypto_core_hsalsa20_inputbytes(void) { 10 | return crypto_core_hsalsa20_INPUTBYTES; 11 | } 12 | 13 | size_t 14 | crypto_core_hsalsa20_keybytes(void) { 15 | return crypto_core_hsalsa20_KEYBYTES; 16 | } 17 | 18 | size_t 19 | crypto_core_hsalsa20_constbytes(void) { 20 | return crypto_core_hsalsa20_CONSTBYTES; 21 | } 22 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_core/salsa20/core_salsa20_api.c: -------------------------------------------------------------------------------- 1 | #include "crypto_core_salsa20.h" 2 | 3 | size_t 4 | crypto_core_salsa20_outputbytes(void) { 5 | return crypto_core_salsa20_OUTPUTBYTES; 6 | } 7 | 8 | size_t 9 | crypto_core_salsa20_inputbytes(void) { 10 | return crypto_core_salsa20_INPUTBYTES; 11 | } 12 | 13 | size_t 14 | crypto_core_salsa20_keybytes(void) { 15 | return crypto_core_salsa20_KEYBYTES; 16 | } 17 | 18 | size_t 19 | crypto_core_salsa20_constbytes(void) { 20 | return crypto_core_salsa20_CONSTBYTES; 21 | } 22 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_core/salsa2012/core_salsa2012_api.c: -------------------------------------------------------------------------------- 1 | #include "crypto_core_salsa2012.h" 2 | 3 | size_t 4 | crypto_core_salsa2012_outputbytes(void) { 5 | return crypto_core_salsa2012_OUTPUTBYTES; 6 | } 7 | 8 | size_t 9 | crypto_core_salsa2012_inputbytes(void) { 10 | return crypto_core_salsa2012_INPUTBYTES; 11 | } 12 | 13 | size_t 14 | crypto_core_salsa2012_keybytes(void) { 15 | return crypto_core_salsa2012_KEYBYTES; 16 | } 17 | 18 | size_t 19 | crypto_core_salsa2012_constbytes(void) { 20 | return crypto_core_salsa2012_CONSTBYTES; 21 | } 22 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_core/salsa208/core_salsa208_api.c: -------------------------------------------------------------------------------- 1 | #include "crypto_core_salsa208.h" 2 | 3 | size_t 4 | crypto_core_salsa208_outputbytes(void) { 5 | return crypto_core_salsa208_OUTPUTBYTES; 6 | } 7 | 8 | size_t 9 | crypto_core_salsa208_inputbytes(void) { 10 | return crypto_core_salsa208_INPUTBYTES; 11 | } 12 | 13 | size_t 14 | crypto_core_salsa208_keybytes(void) { 15 | return crypto_core_salsa208_KEYBYTES; 16 | } 17 | 18 | size_t 19 | crypto_core_salsa208_constbytes(void) { 20 | return crypto_core_salsa208_CONSTBYTES; 21 | } 22 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_generichash/blake2/generichash_blake2_api.c: -------------------------------------------------------------------------------- 1 | #include "crypto_generichash_blake2b.h" 2 | 3 | size_t 4 | crypto_generichash_blake2b_bytes_min(void) { 5 | return crypto_generichash_blake2b_BYTES_MIN; 6 | } 7 | 8 | size_t 9 | crypto_generichash_blake2b_bytes_max(void) { 10 | return crypto_generichash_blake2b_BYTES_MAX; 11 | } 12 | 13 | size_t 14 | crypto_generichash_blake2b_bytes(void) { 15 | return crypto_generichash_blake2b_BYTES; 16 | } 17 | 18 | size_t 19 | crypto_generichash_blake2b_keybytes_min(void) { 20 | return crypto_generichash_blake2b_KEYBYTES_MIN; 21 | } 22 | 23 | size_t 24 | crypto_generichash_blake2b_keybytes_max(void) { 25 | return crypto_generichash_blake2b_KEYBYTES_MAX; 26 | } 27 | 28 | size_t 29 | crypto_generichash_blake2b_keybytes(void) { 30 | return crypto_generichash_blake2b_KEYBYTES; 31 | } 32 | 33 | size_t 34 | crypto_generichash_blake2b_saltbytes(void) { 35 | return crypto_generichash_blake2b_SALTBYTES; 36 | } 37 | 38 | size_t 39 | crypto_generichash_blake2b_personalbytes(void) { 40 | return crypto_generichash_blake2b_PERSONALBYTES; 41 | } 42 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_hash/crypto_hash.c: -------------------------------------------------------------------------------- 1 | 2 | #include "crypto_hash.h" 3 | 4 | size_t 5 | crypto_hash_bytes(void) 6 | { 7 | return crypto_hash_BYTES; 8 | } 9 | 10 | int 11 | crypto_hash(unsigned char *out, const unsigned char *in, 12 | unsigned long long inlen) 13 | { 14 | return crypto_hash_sha512(out, in, inlen); 15 | } 16 | 17 | const char * 18 | crypto_hash_primitive(void) { 19 | return crypto_hash_PRIMITIVE; 20 | } 21 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_hash/sha256/hash_sha256_api.c: -------------------------------------------------------------------------------- 1 | #include "crypto_hash_sha256.h" 2 | 3 | size_t 4 | crypto_hash_sha256_bytes(void) { 5 | return crypto_hash_sha256_BYTES; 6 | } 7 | 8 | size_t 9 | crypto_hash_sha256_statebytes(void) { 10 | return sizeof(crypto_hash_sha256_state); 11 | } 12 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_hash/sha512/hash_sha512_api.c: -------------------------------------------------------------------------------- 1 | #include "crypto_hash_sha512.h" 2 | 3 | size_t 4 | crypto_hash_sha512_bytes(void) { 5 | return crypto_hash_sha512_BYTES; 6 | } 7 | 8 | size_t 9 | crypto_hash_sha512_statebytes(void) { 10 | return sizeof(crypto_hash_sha512_state); 11 | } 12 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_onetimeauth/poly1305/onetimeauth_poly1305.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef onetimeauth_poly1305_H 3 | #define onetimeauth_poly1305_H 4 | 5 | typedef struct crypto_onetimeauth_poly1305_implementation { 6 | int (*onetimeauth)(unsigned char *out, 7 | const unsigned char *in, 8 | unsigned long long inlen, 9 | const unsigned char *k); 10 | int (*onetimeauth_verify)(const unsigned char *h, 11 | const unsigned char *in, 12 | unsigned long long inlen, 13 | const unsigned char *k); 14 | int (*onetimeauth_init)(crypto_onetimeauth_poly1305_state *state, 15 | const unsigned char *key); 16 | int (*onetimeauth_update)(crypto_onetimeauth_poly1305_state *state, 17 | const unsigned char *in, 18 | unsigned long long inlen); 19 | int (*onetimeauth_final)(crypto_onetimeauth_poly1305_state *state, 20 | unsigned char *out); 21 | } crypto_onetimeauth_poly1305_implementation; 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_scalarmult/crypto_scalarmult.c: -------------------------------------------------------------------------------- 1 | 2 | #include "crypto_scalarmult.h" 3 | 4 | const char * 5 | crypto_scalarmult_primitive(void) 6 | { 7 | return crypto_scalarmult_PRIMITIVE; 8 | } 9 | 10 | int 11 | crypto_scalarmult_base(unsigned char *q, const unsigned char *n) 12 | { 13 | return crypto_scalarmult_curve25519_base(q, n); 14 | } 15 | 16 | int 17 | crypto_scalarmult(unsigned char *q, const unsigned char *n, 18 | const unsigned char *p) 19 | { 20 | return crypto_scalarmult_curve25519(q, n, p); 21 | } 22 | 23 | size_t 24 | crypto_scalarmult_bytes(void) 25 | { 26 | return crypto_scalarmult_BYTES; 27 | } 28 | 29 | size_t 30 | crypto_scalarmult_scalarbytes(void) 31 | { 32 | return crypto_scalarmult_SCALARBYTES; 33 | } 34 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_scalarmult/curve25519/donna_c64/curve25519_donna_c64.h: -------------------------------------------------------------------------------- 1 | #ifndef curve25519_donna_c64_H 2 | #define curve25519_donna_c64_H 3 | 4 | #include "crypto_scalarmult_curve25519.h" 5 | 6 | extern struct crypto_scalarmult_curve25519_implementation 7 | crypto_scalarmult_curve25519_donna_c64_implementation; 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref10/curve25519_ref10.h: -------------------------------------------------------------------------------- 1 | #ifndef curve25519_ref10_H 2 | #define curve25519_ref10_H 3 | 4 | #include "crypto_scalarmult_curve25519.h" 5 | 6 | extern struct crypto_scalarmult_curve25519_implementation 7 | crypto_scalarmult_curve25519_ref10_implementation; 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref10/fe_0_curve25519_ref10.c: -------------------------------------------------------------------------------- 1 | #include "fe.h" 2 | 3 | #ifndef HAVE_TI_MODE 4 | 5 | /* 6 | h = 0 7 | */ 8 | 9 | void fe_0(fe h) 10 | { 11 | h[0] = 0; 12 | h[1] = 0; 13 | h[2] = 0; 14 | h[3] = 0; 15 | h[4] = 0; 16 | h[5] = 0; 17 | h[6] = 0; 18 | h[7] = 0; 19 | h[8] = 0; 20 | h[9] = 0; 21 | } 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref10/fe_1_curve25519_ref10.c: -------------------------------------------------------------------------------- 1 | #include "fe.h" 2 | 3 | #ifndef HAVE_TI_MODE 4 | 5 | /* 6 | h = 1 7 | */ 8 | 9 | void fe_1(fe h) 10 | { 11 | h[0] = 1; 12 | h[1] = 0; 13 | h[2] = 0; 14 | h[3] = 0; 15 | h[4] = 0; 16 | h[5] = 0; 17 | h[6] = 0; 18 | h[7] = 0; 19 | h[8] = 0; 20 | h[9] = 0; 21 | } 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref10/fe_copy_curve25519_ref10.c: -------------------------------------------------------------------------------- 1 | #include "fe.h" 2 | 3 | #ifndef HAVE_TI_MODE 4 | 5 | /* 6 | h = f 7 | */ 8 | 9 | void fe_copy(fe h,fe f) 10 | { 11 | crypto_int32 f0 = f[0]; 12 | crypto_int32 f1 = f[1]; 13 | crypto_int32 f2 = f[2]; 14 | crypto_int32 f3 = f[3]; 15 | crypto_int32 f4 = f[4]; 16 | crypto_int32 f5 = f[5]; 17 | crypto_int32 f6 = f[6]; 18 | crypto_int32 f7 = f[7]; 19 | crypto_int32 f8 = f[8]; 20 | crypto_int32 f9 = f[9]; 21 | h[0] = f0; 22 | h[1] = f1; 23 | h[2] = f2; 24 | h[3] = f3; 25 | h[4] = f4; 26 | h[5] = f5; 27 | h[6] = f6; 28 | h[7] = f7; 29 | h[8] = f8; 30 | h[9] = f9; 31 | } 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref10/fe_invert_curve25519_ref10.c: -------------------------------------------------------------------------------- 1 | #include "fe.h" 2 | 3 | #ifndef HAVE_TI_MODE 4 | 5 | void fe_invert(fe out,fe z) 6 | { 7 | fe t0; 8 | fe t1; 9 | fe t2; 10 | fe t3; 11 | int i; 12 | 13 | #include "pow225521.h" 14 | 15 | return; 16 | } 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/consts.S: -------------------------------------------------------------------------------- 1 | #ifdef IN_SANDY2X 2 | 3 | /* 4 | REDMASK51 is from amd64-51/consts.s. 5 | */ 6 | 7 | #include "consts_namespace.h" 8 | .data 9 | .p2align 4 10 | v0_0: .quad 0, 0 11 | v1_0: .quad 1, 0 12 | v2_1: .quad 2, 1 13 | v9_0: .quad 9, 0 14 | v9_9: .quad 9, 9 15 | v19_19: .quad 19, 19 16 | v38_1: .quad 38, 1 17 | v38_38: .quad 38, 38 18 | v121666_121666: .quad 121666, 121666 19 | m25: .quad 33554431, 33554431 20 | m26: .quad 67108863, 67108863 21 | subc0: .quad 0x07FFFFDA, 0x03FFFFFE 22 | subc2: .quad 0x07FFFFFE, 0x03FFFFFE 23 | REDMASK51: .quad 0x0007FFFFFFFFFFFF 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/consts_namespace.h: -------------------------------------------------------------------------------- 1 | #ifndef consts_namespace_H 2 | #define consts_namespace_H 3 | 4 | #define v0_0 crypto_scalarmult_curve25519_sandy2x_v0_0 5 | #define v1_0 crypto_scalarmult_curve25519_sandy2x_v1_0 6 | #define v2_1 crypto_scalarmult_curve25519_sandy2x_v2_1 7 | #define v9_0 crypto_scalarmult_curve25519_sandy2x_v9_0 8 | #define v9_9 crypto_scalarmult_curve25519_sandy2x_v9_9 9 | #define v19_19 crypto_scalarmult_curve25519_sandy2x_v19_19 10 | #define v38_1 crypto_scalarmult_curve25519_sandy2x_v38_1 11 | #define v38_38 crypto_scalarmult_curve25519_sandy2x_v38_38 12 | #define v121666_121666 crypto_scalarmult_curve25519_sandy2x_v121666_121666 13 | #define m25 crypto_scalarmult_curve25519_sandy2x_m25 14 | #define m26 crypto_scalarmult_curve25519_sandy2x_m26 15 | #define subc0 crypto_scalarmult_curve25519_sandy2x_subc0 16 | #define subc2 crypto_scalarmult_curve25519_sandy2x_subc2 17 | #define REDMASK51 crypto_scalarmult_curve25519_sandy2x_REDMASK51 18 | 19 | #endif //ifndef consts_namespace_H 20 | 21 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/curve25519_sandy2x.h: -------------------------------------------------------------------------------- 1 | #ifndef curve25519_sandy2x_H 2 | #define curve25519_sandy2x_H 3 | 4 | #include "crypto_scalarmult_curve25519.h" 5 | 6 | extern struct crypto_scalarmult_curve25519_implementation 7 | crypto_scalarmult_curve25519_sandy2x_implementation; 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe.h: -------------------------------------------------------------------------------- 1 | /* 2 | This file is adapted from ref10/fe.h: 3 | All the redundant functions are removed. 4 | */ 5 | 6 | #ifndef fe_H 7 | #define fe_H 8 | 9 | #include "crypto_uint64.h" 10 | 11 | typedef crypto_uint64 fe[10]; 12 | 13 | /* 14 | fe means field element. 15 | Here the field is \Z/(2^255-19). 16 | An element t, entries t[0]...t[9], represents the integer 17 | t[0]+2^26 t[1]+2^51 t[2]+2^77 t[3]+2^102 t[4]+...+2^230 t[9]. 18 | Bounds on each t[i] vary depending on context. 19 | */ 20 | 21 | #define fe_frombytes crypto_scalarmult_curve25519_sandy2x_fe_frombytes 22 | 23 | extern void fe_frombytes(fe, const unsigned char *); 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe51.h: -------------------------------------------------------------------------------- 1 | /* 2 | This file is adapted from amd64-51/fe25519.h: 3 | 'fe25519' is renamed as 'fe51'; 4 | All the redundant functions are removed; 5 | New function fe51_nsquare is introduced. 6 | */ 7 | 8 | #ifndef fe51_H 9 | #define fe51_H 10 | 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif 14 | 15 | #include "crypto_uint64.h" 16 | #include "fe51_namespace.h" 17 | 18 | typedef struct 19 | { 20 | crypto_uint64 v[5]; 21 | } 22 | fe51; 23 | 24 | extern void fe51_pack(unsigned char *, const fe51 *); 25 | extern void fe51_mul(fe51 *, const fe51 *, const fe51 *); 26 | extern void fe51_nsquare(fe51 *, const fe51 *, int); 27 | extern void fe51_invert(fe51 *, const fe51 *); 28 | 29 | #ifdef __cplusplus 30 | } 31 | #endif 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe51_namespace.h: -------------------------------------------------------------------------------- 1 | #ifndef fe51_namespace_H 2 | #define fe51_namespace_H 3 | 4 | #define fe51 crypto_scalarmult_curve25519_sandy2x_fe51 5 | #define _fe51 _crypto_scalarmult_curve25519_sandy2x_fe51 6 | #define fe51_pack crypto_scalarmult_curve25519_sandy2x_fe51_pack 7 | #define _fe51_pack _crypto_scalarmult_curve25519_sandy2x_fe51_pack 8 | #define fe51_mul crypto_scalarmult_curve25519_sandy2x_fe51_mul 9 | #define _fe51_mul _crypto_scalarmult_curve25519_sandy2x_fe51_mul 10 | #define fe51_nsquare crypto_scalarmult_curve25519_sandy2x_fe51_nsquare 11 | #define _fe51_nsquare _crypto_scalarmult_curve25519_sandy2x_fe51_nsquare 12 | 13 | #define fe51_invert crypto_scalarmult_curve25519_sandy2x_fe51_invert 14 | 15 | #endif //ifndef fe51_namespace_H 16 | 17 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/ladder.h: -------------------------------------------------------------------------------- 1 | #ifndef ladder_H 2 | #define ladder_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #include "fe.h" 9 | #include "ladder_namespace.h" 10 | 11 | extern void ladder(fe *, const unsigned char *); 12 | 13 | #ifdef __cplusplus 14 | } 15 | #endif 16 | 17 | #endif //ifndef ladder_H 18 | 19 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/ladder_base.h: -------------------------------------------------------------------------------- 1 | #ifndef ladder_base_H 2 | #define ladder_base_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #include "fe.h" 9 | #include "ladder_base_namespace.h" 10 | 11 | extern void ladder_base(fe *, const unsigned char *); 12 | 13 | #ifdef __cplusplus 14 | } 15 | #endif 16 | 17 | #endif //ifndef ladder_base_H 18 | 19 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/ladder_base_namespace.h: -------------------------------------------------------------------------------- 1 | #ifndef ladder_base_namespace_H 2 | #define ladder_base_namespace_H 3 | 4 | #define ladder_base crypto_scalarmult_curve25519_sandy2x_ladder_base 5 | #define _ladder_base _crypto_scalarmult_curve25519_sandy2x_ladder_base 6 | 7 | #endif //ifndef ladder_base_namespace_H 8 | 9 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/ladder_namespace.h: -------------------------------------------------------------------------------- 1 | #ifndef ladder_namespace_H 2 | #define ladder_namespace_H 3 | 4 | #define ladder crypto_scalarmult_curve25519_sandy2x_ladder 5 | #define _ladder _crypto_scalarmult_curve25519_sandy2x_ladder 6 | 7 | #endif //ifndef ladder_namespace_H 8 | 9 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/sandy2x.S: -------------------------------------------------------------------------------- 1 | 2 | #ifdef HAVE_AVX_ASM 3 | 4 | #define IN_SANDY2X 5 | 6 | #include "consts.S" 7 | #include "fe51_mul.S" 8 | #include "fe51_nsquare.S" 9 | #include "fe51_pack.S" 10 | #include "ladder.S" 11 | #include "ladder_base.S" 12 | 13 | #if defined(__linux__) && defined(__ELF__) 14 | .section .note.GNU-stack,"",%progbits 15 | #endif 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_scalarmult/curve25519/scalarmult_curve25519.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef scalarmult_poly1305_H 3 | #define scalarmult_poly1305_H 4 | 5 | typedef struct crypto_scalarmult_curve25519_implementation { 6 | int (*mult)(unsigned char *q, const unsigned char *n, 7 | const unsigned char *p); 8 | int (*mult_base)(unsigned char *q, const unsigned char *n); 9 | } crypto_scalarmult_curve25519_implementation; 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_secretbox/crypto_secretbox.c: -------------------------------------------------------------------------------- 1 | 2 | #include "crypto_secretbox.h" 3 | 4 | size_t 5 | crypto_secretbox_keybytes(void) 6 | { 7 | return crypto_secretbox_KEYBYTES; 8 | } 9 | 10 | size_t 11 | crypto_secretbox_noncebytes(void) 12 | { 13 | return crypto_secretbox_NONCEBYTES; 14 | } 15 | 16 | size_t 17 | crypto_secretbox_zerobytes(void) 18 | { 19 | return crypto_secretbox_ZEROBYTES; 20 | } 21 | 22 | size_t 23 | crypto_secretbox_boxzerobytes(void) 24 | { 25 | return crypto_secretbox_BOXZEROBYTES; 26 | } 27 | 28 | size_t 29 | crypto_secretbox_macbytes(void) 30 | { 31 | return crypto_secretbox_MACBYTES; 32 | } 33 | 34 | const char * 35 | crypto_secretbox_primitive(void) 36 | { 37 | return crypto_secretbox_PRIMITIVE; 38 | } 39 | 40 | int 41 | crypto_secretbox(unsigned char *c, const unsigned char *m, 42 | unsigned long long mlen, const unsigned char *n, 43 | const unsigned char *k) 44 | { 45 | return crypto_secretbox_xsalsa20poly1305(c, m, mlen, n, k); 46 | } 47 | 48 | int 49 | crypto_secretbox_open(unsigned char *m, const unsigned char *c, 50 | unsigned long long clen, const unsigned char *n, 51 | const unsigned char *k) 52 | { 53 | return crypto_secretbox_xsalsa20poly1305_open(m, c, clen, n, k); 54 | } 55 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_secretbox/xsalsa20poly1305/ref/box_xsalsa20poly1305.c: -------------------------------------------------------------------------------- 1 | #include "crypto_onetimeauth_poly1305.h" 2 | #include "crypto_secretbox_xsalsa20poly1305.h" 3 | #include "crypto_stream_xsalsa20.h" 4 | 5 | int crypto_secretbox_xsalsa20poly1305( 6 | unsigned char *c, 7 | const unsigned char *m,unsigned long long mlen, 8 | const unsigned char *n, 9 | const unsigned char *k 10 | ) 11 | { 12 | int i; 13 | if (mlen < 32) return -1; 14 | crypto_stream_xsalsa20_xor(c,m,mlen,n,k); 15 | crypto_onetimeauth_poly1305(c + 16,c + 32,mlen - 32,c); 16 | for (i = 0;i < 16;++i) c[i] = 0; 17 | return 0; 18 | } 19 | 20 | int crypto_secretbox_xsalsa20poly1305_open( 21 | unsigned char *m, 22 | const unsigned char *c,unsigned long long clen, 23 | const unsigned char *n, 24 | const unsigned char *k 25 | ) 26 | { 27 | int i; 28 | unsigned char subkey[32]; 29 | if (clen < 32) return -1; 30 | crypto_stream_xsalsa20(subkey,32,n,k); 31 | if (crypto_onetimeauth_poly1305_verify(c + 16,c + 32,clen - 32,subkey) != 0) return -1; 32 | crypto_stream_xsalsa20_xor(m,c,clen,n,k); 33 | for (i = 0;i < 32;++i) m[i] = 0; 34 | return 0; 35 | } 36 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_secretbox/xsalsa20poly1305/secretbox_xsalsa20poly1305_api.c: -------------------------------------------------------------------------------- 1 | #include "crypto_secretbox_xsalsa20poly1305.h" 2 | 3 | size_t 4 | crypto_secretbox_xsalsa20poly1305_keybytes(void) { 5 | return crypto_secretbox_xsalsa20poly1305_KEYBYTES; 6 | } 7 | 8 | size_t 9 | crypto_secretbox_xsalsa20poly1305_noncebytes(void) { 10 | return crypto_secretbox_xsalsa20poly1305_NONCEBYTES; 11 | } 12 | 13 | size_t 14 | crypto_secretbox_xsalsa20poly1305_zerobytes(void) { 15 | return crypto_secretbox_xsalsa20poly1305_ZEROBYTES; 16 | } 17 | 18 | size_t 19 | crypto_secretbox_xsalsa20poly1305_boxzerobytes(void) { 20 | return crypto_secretbox_xsalsa20poly1305_BOXZEROBYTES; 21 | } 22 | 23 | size_t 24 | crypto_secretbox_xsalsa20poly1305_macbytes(void) { 25 | return crypto_secretbox_xsalsa20poly1305_MACBYTES; 26 | } 27 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_shorthash/crypto_shorthash.c: -------------------------------------------------------------------------------- 1 | 2 | #include "crypto_shorthash.h" 3 | 4 | size_t 5 | crypto_shorthash_bytes(void) 6 | { 7 | return crypto_shorthash_BYTES; 8 | } 9 | 10 | size_t 11 | crypto_shorthash_keybytes(void) 12 | { 13 | return crypto_shorthash_KEYBYTES; 14 | } 15 | 16 | const char * 17 | crypto_shorthash_primitive(void) 18 | { 19 | return crypto_shorthash_PRIMITIVE; 20 | } 21 | 22 | int 23 | crypto_shorthash(unsigned char *out, const unsigned char *in, 24 | unsigned long long inlen, const unsigned char *k) 25 | { 26 | return crypto_shorthash_siphash24(out, in, inlen, k); 27 | } 28 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_shorthash/siphash24/shorthash_siphash24_api.c: -------------------------------------------------------------------------------- 1 | #include "crypto_shorthash_siphash24.h" 2 | 3 | size_t 4 | crypto_shorthash_siphash24_bytes(void) { 5 | return crypto_shorthash_siphash24_BYTES; 6 | } 7 | 8 | size_t 9 | crypto_shorthash_siphash24_keybytes(void) { 10 | return crypto_shorthash_siphash24_KEYBYTES; 11 | } 12 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_sign/ed25519/description: -------------------------------------------------------------------------------- 1 | EdDSA signatures using Curve25519 2 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_sign/ed25519/ref10/d.h: -------------------------------------------------------------------------------- 1 | -10913610,13857413,-15372611,6949391,114729,-8787816,-6275908,-3247719,-18696448,-12055116 2 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_sign/ed25519/ref10/d2.h: -------------------------------------------------------------------------------- 1 | -21827239,-5839606,-30745221,13898782,229458,15978800,-12551817,-6495438,29715968,9444199 2 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_sign/ed25519/ref10/fe_0.c: -------------------------------------------------------------------------------- 1 | #include "fe.h" 2 | 3 | /* 4 | h = 0 5 | */ 6 | 7 | void fe_0(fe h) 8 | { 9 | h[0] = 0; 10 | h[1] = 0; 11 | h[2] = 0; 12 | h[3] = 0; 13 | h[4] = 0; 14 | h[5] = 0; 15 | h[6] = 0; 16 | h[7] = 0; 17 | h[8] = 0; 18 | h[9] = 0; 19 | } 20 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_sign/ed25519/ref10/fe_1.c: -------------------------------------------------------------------------------- 1 | #include "fe.h" 2 | 3 | /* 4 | h = 1 5 | */ 6 | 7 | void fe_1(fe h) 8 | { 9 | h[0] = 1; 10 | h[1] = 0; 11 | h[2] = 0; 12 | h[3] = 0; 13 | h[4] = 0; 14 | h[5] = 0; 15 | h[6] = 0; 16 | h[7] = 0; 17 | h[8] = 0; 18 | h[9] = 0; 19 | } 20 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_sign/ed25519/ref10/fe_copy.c: -------------------------------------------------------------------------------- 1 | #include "fe.h" 2 | 3 | /* 4 | h = f 5 | */ 6 | 7 | void fe_copy(fe h,const fe f) 8 | { 9 | crypto_int32 f0 = f[0]; 10 | crypto_int32 f1 = f[1]; 11 | crypto_int32 f2 = f[2]; 12 | crypto_int32 f3 = f[3]; 13 | crypto_int32 f4 = f[4]; 14 | crypto_int32 f5 = f[5]; 15 | crypto_int32 f6 = f[6]; 16 | crypto_int32 f7 = f[7]; 17 | crypto_int32 f8 = f[8]; 18 | crypto_int32 f9 = f[9]; 19 | h[0] = f0; 20 | h[1] = f1; 21 | h[2] = f2; 22 | h[3] = f3; 23 | h[4] = f4; 24 | h[5] = f5; 25 | h[6] = f6; 26 | h[7] = f7; 27 | h[8] = f8; 28 | h[9] = f9; 29 | } 30 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_sign/ed25519/ref10/fe_invert.c: -------------------------------------------------------------------------------- 1 | #include "fe.h" 2 | 3 | void fe_invert(fe out,const fe z) 4 | { 5 | fe t0; 6 | fe t1; 7 | fe t2; 8 | fe t3; 9 | int i; 10 | 11 | #include "pow225521.h" 12 | 13 | return; 14 | } 15 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_sign/ed25519/ref10/fe_isnegative.c: -------------------------------------------------------------------------------- 1 | #include "fe.h" 2 | 3 | /* 4 | return 1 if f is in {1,3,5,...,q-2} 5 | return 0 if f is in {0,2,4,...,q-1} 6 | 7 | Preconditions: 8 | |f| bounded by 1.1*2^26,1.1*2^25,1.1*2^26,1.1*2^25,etc. 9 | */ 10 | 11 | int fe_isnegative(const fe f) 12 | { 13 | unsigned char s[32]; 14 | fe_tobytes(s,f); 15 | return s[0] & 1; 16 | } 17 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_sign/ed25519/ref10/fe_isnonzero.c: -------------------------------------------------------------------------------- 1 | #include "fe.h" 2 | #include "crypto_verify_32.h" 3 | 4 | /* 5 | return 1 if f == 0 6 | return 0 if f != 0 7 | 8 | Preconditions: 9 | |f| bounded by 1.1*2^26,1.1*2^25,1.1*2^26,1.1*2^25,etc. 10 | */ 11 | 12 | static unsigned char zero[32]; 13 | 14 | int fe_isnonzero(const fe f) 15 | { 16 | unsigned char s[32]; 17 | fe_tobytes(s,f); 18 | return crypto_verify_32(s,zero); 19 | } 20 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_sign/ed25519/ref10/fe_neg.c: -------------------------------------------------------------------------------- 1 | #include "fe.h" 2 | 3 | /* 4 | h = -f 5 | 6 | Preconditions: 7 | |f| bounded by 1.1*2^25,1.1*2^24,1.1*2^25,1.1*2^24,etc. 8 | 9 | Postconditions: 10 | |h| bounded by 1.1*2^25,1.1*2^24,1.1*2^25,1.1*2^24,etc. 11 | */ 12 | 13 | void fe_neg(fe h,const fe f) 14 | { 15 | crypto_int32 f0 = f[0]; 16 | crypto_int32 f1 = f[1]; 17 | crypto_int32 f2 = f[2]; 18 | crypto_int32 f3 = f[3]; 19 | crypto_int32 f4 = f[4]; 20 | crypto_int32 f5 = f[5]; 21 | crypto_int32 f6 = f[6]; 22 | crypto_int32 f7 = f[7]; 23 | crypto_int32 f8 = f[8]; 24 | crypto_int32 f9 = f[9]; 25 | crypto_int32 h0 = -f0; 26 | crypto_int32 h1 = -f1; 27 | crypto_int32 h2 = -f2; 28 | crypto_int32 h3 = -f3; 29 | crypto_int32 h4 = -f4; 30 | crypto_int32 h5 = -f5; 31 | crypto_int32 h6 = -f6; 32 | crypto_int32 h7 = -f7; 33 | crypto_int32 h8 = -f8; 34 | crypto_int32 h9 = -f9; 35 | h[0] = h0; 36 | h[1] = h1; 37 | h[2] = h2; 38 | h[3] = h3; 39 | h[4] = h4; 40 | h[5] = h5; 41 | h[6] = h6; 42 | h[7] = h7; 43 | h[8] = h8; 44 | h[9] = h9; 45 | } 46 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_sign/ed25519/ref10/fe_pow22523.c: -------------------------------------------------------------------------------- 1 | #include "fe.h" 2 | 3 | void fe_pow22523(fe out,const fe z) 4 | { 5 | fe t0; 6 | fe t1; 7 | fe t2; 8 | int i; 9 | 10 | #include "pow22523.h" 11 | 12 | return; 13 | } 14 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_add.c: -------------------------------------------------------------------------------- 1 | #include "ge.h" 2 | 3 | /* 4 | r = p + q 5 | */ 6 | 7 | void ge_add(ge_p1p1 *r,const ge_p3 *p,const ge_cached *q) 8 | { 9 | fe t0; 10 | #include "ge_add.h" 11 | } 12 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_frombytes.c: -------------------------------------------------------------------------------- 1 | #include "ge.h" 2 | 3 | static const fe d = { 4 | #include "d.h" 5 | } ; 6 | 7 | static const fe sqrtm1 = { 8 | #include "sqrtm1.h" 9 | } ; 10 | 11 | int ge_frombytes_negate_vartime(ge_p3 *h,const unsigned char *s) 12 | { 13 | fe u; 14 | fe v; 15 | fe v3; 16 | fe vxx; 17 | fe check; 18 | 19 | fe_frombytes(h->Y,s); 20 | fe_1(h->Z); 21 | fe_sq(u,h->Y); 22 | fe_mul(v,u,d); 23 | fe_sub(u,u,h->Z); /* u = y^2-1 */ 24 | fe_add(v,v,h->Z); /* v = dy^2+1 */ 25 | 26 | fe_sq(v3,v); 27 | fe_mul(v3,v3,v); /* v3 = v^3 */ 28 | fe_sq(h->X,v3); 29 | fe_mul(h->X,h->X,v); 30 | fe_mul(h->X,h->X,u); /* x = uv^7 */ 31 | 32 | fe_pow22523(h->X,h->X); /* x = (uv^7)^((q-5)/8) */ 33 | fe_mul(h->X,h->X,v3); 34 | fe_mul(h->X,h->X,u); /* x = uv^3(uv^7)^((q-5)/8) */ 35 | 36 | fe_sq(vxx,h->X); 37 | fe_mul(vxx,vxx,v); 38 | fe_sub(check,vxx,u); /* vx^2-u */ 39 | if (fe_isnonzero(check)) { 40 | fe_add(check,vxx,u); /* vx^2+u */ 41 | if (fe_isnonzero(check)) return -1; 42 | fe_mul(h->X,h->X,sqrtm1); 43 | } 44 | 45 | if (fe_isnegative(h->X) == (s[31] >> 7)) 46 | fe_neg(h->X,h->X); 47 | 48 | fe_mul(h->T,h->X,h->Y); 49 | return 0; 50 | } 51 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_madd.c: -------------------------------------------------------------------------------- 1 | #include "ge.h" 2 | 3 | /* 4 | r = p + q 5 | */ 6 | 7 | void ge_madd(ge_p1p1 *r,const ge_p3 *p,const ge_precomp *q) 8 | { 9 | fe t0; 10 | #include "ge_madd.h" 11 | } 12 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_msub.c: -------------------------------------------------------------------------------- 1 | #include "ge.h" 2 | 3 | /* 4 | r = p - q 5 | */ 6 | 7 | void ge_msub(ge_p1p1 *r,const ge_p3 *p,const ge_precomp *q) 8 | { 9 | fe t0; 10 | #include "ge_msub.h" 11 | } 12 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_p1p1_to_p2.c: -------------------------------------------------------------------------------- 1 | #include "ge.h" 2 | 3 | /* 4 | r = p 5 | */ 6 | 7 | extern void ge_p1p1_to_p2(ge_p2 *r,const ge_p1p1 *p) 8 | { 9 | fe_mul(r->X,p->X,p->T); 10 | fe_mul(r->Y,p->Y,p->Z); 11 | fe_mul(r->Z,p->Z,p->T); 12 | } 13 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_p1p1_to_p3.c: -------------------------------------------------------------------------------- 1 | #include "ge.h" 2 | 3 | /* 4 | r = p 5 | */ 6 | 7 | extern void ge_p1p1_to_p3(ge_p3 *r,const ge_p1p1 *p) 8 | { 9 | fe_mul(r->X,p->X,p->T); 10 | fe_mul(r->Y,p->Y,p->Z); 11 | fe_mul(r->Z,p->Z,p->T); 12 | fe_mul(r->T,p->X,p->Y); 13 | } 14 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_p2_0.c: -------------------------------------------------------------------------------- 1 | #include "ge.h" 2 | 3 | void ge_p2_0(ge_p2 *h) 4 | { 5 | fe_0(h->X); 6 | fe_1(h->Y); 7 | fe_1(h->Z); 8 | } 9 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_p2_dbl.c: -------------------------------------------------------------------------------- 1 | #include "ge.h" 2 | 3 | /* 4 | r = 2 * p 5 | */ 6 | 7 | void ge_p2_dbl(ge_p1p1 *r,const ge_p2 *p) 8 | { 9 | fe t0; 10 | #include "ge_p2_dbl.h" 11 | } 12 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_p3_0.c: -------------------------------------------------------------------------------- 1 | #include "ge.h" 2 | 3 | void ge_p3_0(ge_p3 *h) 4 | { 5 | fe_0(h->X); 6 | fe_1(h->Y); 7 | fe_1(h->Z); 8 | fe_0(h->T); 9 | } 10 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_p3_dbl.c: -------------------------------------------------------------------------------- 1 | #include "ge.h" 2 | 3 | /* 4 | r = 2 * p 5 | */ 6 | 7 | void ge_p3_dbl(ge_p1p1 *r,const ge_p3 *p) 8 | { 9 | ge_p2 q; 10 | ge_p3_to_p2(&q,p); 11 | ge_p2_dbl(r,&q); 12 | } 13 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_p3_to_cached.c: -------------------------------------------------------------------------------- 1 | #include "ge.h" 2 | 3 | /* 4 | r = p 5 | */ 6 | 7 | static const fe d2 = { 8 | #include "d2.h" 9 | } ; 10 | 11 | extern void ge_p3_to_cached(ge_cached *r,const ge_p3 *p) 12 | { 13 | fe_add(r->YplusX,p->Y,p->X); 14 | fe_sub(r->YminusX,p->Y,p->X); 15 | fe_copy(r->Z,p->Z); 16 | fe_mul(r->T2d,p->T,d2); 17 | } 18 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_p3_to_p2.c: -------------------------------------------------------------------------------- 1 | #include "ge.h" 2 | 3 | /* 4 | r = p 5 | */ 6 | 7 | extern void ge_p3_to_p2(ge_p2 *r,const ge_p3 *p) 8 | { 9 | fe_copy(r->X,p->X); 10 | fe_copy(r->Y,p->Y); 11 | fe_copy(r->Z,p->Z); 12 | } 13 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_p3_tobytes.c: -------------------------------------------------------------------------------- 1 | #include "ge.h" 2 | 3 | void ge_p3_tobytes(unsigned char *s,const ge_p3 *h) 4 | { 5 | fe recip; 6 | fe x; 7 | fe y; 8 | 9 | fe_invert(recip,h->Z); 10 | fe_mul(x,h->X,recip); 11 | fe_mul(y,h->Y,recip); 12 | fe_tobytes(s,y); 13 | s[31] ^= fe_isnegative(x) << 7; 14 | } 15 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_precomp_0.c: -------------------------------------------------------------------------------- 1 | #include "ge.h" 2 | 3 | void ge_precomp_0(ge_precomp *h) 4 | { 5 | fe_1(h->yplusx); 6 | fe_1(h->yminusx); 7 | fe_0(h->xy2d); 8 | } 9 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_sub.c: -------------------------------------------------------------------------------- 1 | #include "ge.h" 2 | 3 | /* 4 | r = p - q 5 | */ 6 | 7 | void ge_sub(ge_p1p1 *r,const ge_p3 *p,const ge_cached *q) 8 | { 9 | fe t0; 10 | #include "ge_sub.h" 11 | } 12 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_tobytes.c: -------------------------------------------------------------------------------- 1 | #include "ge.h" 2 | 3 | void ge_tobytes(unsigned char *s,const ge_p2 *h) 4 | { 5 | fe recip; 6 | fe x; 7 | fe y; 8 | 9 | fe_invert(recip,h->Z); 10 | fe_mul(x,h->X,recip); 11 | fe_mul(y,h->Y,recip); 12 | fe_tobytes(s,y); 13 | s[31] ^= fe_isnegative(x) << 7; 14 | } 15 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_sign/ed25519/ref10/sc.h: -------------------------------------------------------------------------------- 1 | #ifndef SC_H 2 | #define SC_H 3 | 4 | /* 5 | The set of scalars is \Z/l 6 | where l = 2^252 + 27742317777372353535851937790883648493. 7 | */ 8 | 9 | #define sc_reduce crypto_sign_ed25519_ref10_sc_reduce 10 | #define sc_muladd crypto_sign_ed25519_ref10_sc_muladd 11 | 12 | extern void sc_reduce(unsigned char *); 13 | extern void sc_muladd(unsigned char *,const unsigned char *,const unsigned char *,const unsigned char *); 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_sign/ed25519/ref10/sqrtm1.h: -------------------------------------------------------------------------------- 1 | -32595792,-7943725,9377950,3500415,12389472,-272473,-25146209,-2005654,326686,11406482 2 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_sign/ed25519/sign_ed25519_api.c: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | #include "crypto_sign_ed25519.h" 5 | 6 | size_t 7 | crypto_sign_ed25519_bytes(void) { 8 | return crypto_sign_ed25519_BYTES; 9 | } 10 | 11 | size_t 12 | crypto_sign_ed25519_seedbytes(void) { 13 | return crypto_sign_ed25519_SEEDBYTES; 14 | } 15 | 16 | size_t 17 | crypto_sign_ed25519_publickeybytes(void) { 18 | return crypto_sign_ed25519_PUBLICKEYBYTES; 19 | } 20 | 21 | size_t 22 | crypto_sign_ed25519_secretkeybytes(void) { 23 | return crypto_sign_ed25519_SECRETKEYBYTES; 24 | } 25 | 26 | int 27 | crypto_sign_ed25519_sk_to_seed(unsigned char *seed, const unsigned char *sk) 28 | { 29 | memmove(seed, sk, crypto_sign_ed25519_SEEDBYTES); 30 | return 0; 31 | } 32 | 33 | int 34 | crypto_sign_ed25519_sk_to_pk(unsigned char *pk, const unsigned char *sk) 35 | { 36 | memmove(pk, sk + crypto_sign_ed25519_SEEDBYTES, 37 | crypto_sign_ed25519_PUBLICKEYBYTES); 38 | return 0; 39 | } 40 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_stream/aes128ctr/portable/consts.h: -------------------------------------------------------------------------------- 1 | #ifndef CONSTS_H 2 | #define CONSTS_H 3 | 4 | #include "int128.h" 5 | 6 | #define ROTB crypto_stream_aes128ctr_portable_ROTB 7 | #define M0 crypto_stream_aes128ctr_portable_M0 8 | #define EXPB0 crypto_stream_aes128ctr_portable_EXPB0 9 | #define SWAP32 crypto_stream_aes128ctr_portable_SWAP32 10 | #define M0SWAP crypto_stream_aes128ctr_portable_M0SWAP 11 | #define SR crypto_stream_aes128ctr_portable_SR 12 | #define SRM0 crypto_stream_aes128ctr_portable_SRM0 13 | #define BS0 crypto_stream_aes128ctr_portable_BS0 14 | #define BS1 crypto_stream_aes128ctr_portable_BS1 15 | #define BS2 crypto_stream_aes128ctr_portable_BS2 16 | 17 | extern const unsigned char ROTB[16]; 18 | extern const unsigned char M0[16]; 19 | extern const unsigned char EXPB0[16]; 20 | extern const unsigned char SWAP32[16]; 21 | extern const unsigned char M0SWAP[16]; 22 | extern const unsigned char SR[16]; 23 | extern const unsigned char SRM0[16]; 24 | extern const int128 BS0; 25 | extern const int128 BS1; 26 | extern const int128 BS2; 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_stream/aes128ctr/portable/consts_aes128ctr.c: -------------------------------------------------------------------------------- 1 | #include "consts.h" 2 | 3 | const unsigned char ROTB[16] = {0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08}; 4 | const unsigned char M0[16] = {0x0f, 0x0b, 0x07, 0x03, 0x0e, 0x0a, 0x06, 0x02, 0x0d, 0x09, 0x05, 0x01, 0x0c, 0x08, 0x04, 0x00}; 5 | const unsigned char EXPB0[16] = {0x03, 0x03, 0x03, 0x03, 0x07, 0x07, 0x07, 0x07, 0x0b, 0x0b, 0x0b, 0x0b, 0x0f, 0x0f, 0x0f, 0x0f}; 6 | 7 | const unsigned char SWAP32[16] = {0x03, 0x02, 0x01, 0x00, 0x07, 0x06, 0x05, 0x04, 0x0b, 0x0a, 0x09, 0x08, 0x0f, 0x0e, 0x0d, 0x0c}; 8 | const unsigned char M0SWAP[16] = {0x0c, 0x08, 0x04, 0x00, 0x0d, 0x09, 0x05, 0x01, 0x0e, 0x0a, 0x06, 0x02, 0x0f, 0x0b, 0x07, 0x03}; 9 | const unsigned char SR[16] = {0x01, 0x02, 0x03, 0x00, 0x06, 0x07, 0x04, 0x05, 0x0b, 0x08, 0x09, 0x0a, 0x0c, 0x0d, 0x0e, 0x0f}; 10 | const unsigned char SRM0[16] = {0x0f, 0x0a, 0x05, 0x00, 0x0e, 0x09, 0x04, 0x03, 0x0d, 0x08, 0x07, 0x02, 0x0c, 0x0b, 0x06, 0x01}; 11 | 12 | const int128 BS0 = {{0x5555555555555555ULL, 0x5555555555555555ULL}}; 13 | const int128 BS1 = {{0x3333333333333333ULL, 0x3333333333333333ULL}}; 14 | const int128 BS2 = {{0x0f0f0f0f0f0f0f0fULL, 0x0f0f0f0f0f0f0f0fULL}}; 15 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_stream/aes128ctr/portable/stream_aes128ctr.c: -------------------------------------------------------------------------------- 1 | 2 | #include "crypto_stream_aes128ctr.h" 3 | 4 | int crypto_stream_aes128ctr( 5 | unsigned char *out, 6 | unsigned long long outlen, 7 | const unsigned char *n, 8 | const unsigned char *k 9 | ) 10 | { 11 | unsigned char d[crypto_stream_aes128ctr_BEFORENMBYTES]; 12 | crypto_stream_aes128ctr_beforenm(d, k); 13 | crypto_stream_aes128ctr_afternm(out, outlen, n, d); 14 | return 0; 15 | } 16 | 17 | int crypto_stream_aes128ctr_xor( 18 | unsigned char *out, 19 | const unsigned char *in, 20 | unsigned long long inlen, 21 | const unsigned char *n, 22 | const unsigned char *k 23 | ) 24 | { 25 | unsigned char d[crypto_stream_aes128ctr_BEFORENMBYTES]; 26 | crypto_stream_aes128ctr_beforenm(d, k); 27 | crypto_stream_aes128ctr_xor_afternm(out, in, inlen, n, d); 28 | return 0; 29 | } 30 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_stream/aes128ctr/portable/types.h: -------------------------------------------------------------------------------- 1 | #ifndef TYPES_H 2 | #define TYPES_H 3 | 4 | #include "crypto_uint32.h" 5 | typedef crypto_uint32 uint32; 6 | 7 | #include "crypto_uint64.h" 8 | typedef crypto_uint64 uint64; 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_stream/aes128ctr/stream_aes128ctr_api.c: -------------------------------------------------------------------------------- 1 | #include "crypto_stream_aes128ctr.h" 2 | 3 | size_t 4 | crypto_stream_aes128ctr_keybytes(void) { 5 | return crypto_stream_aes128ctr_KEYBYTES; 6 | } 7 | 8 | size_t 9 | crypto_stream_aes128ctr_noncebytes(void) { 10 | return crypto_stream_aes128ctr_NONCEBYTES; 11 | } 12 | 13 | size_t 14 | crypto_stream_aes128ctr_beforenmbytes(void) { 15 | return crypto_stream_aes128ctr_BEFORENMBYTES; 16 | } 17 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_stream/chacha20/ref/stream_chacha20_ref.h: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | #include "crypto_stream_chacha20.h" 5 | 6 | extern struct crypto_stream_chacha20_implementation 7 | crypto_stream_chacha20_ref_implementation; 8 | 9 | int 10 | crypto_stream_chacha20_ref(unsigned char *c, unsigned long long clen, 11 | const unsigned char *n, const unsigned char *k); 12 | 13 | int 14 | crypto_stream_chacha20_ref_xor_ic(unsigned char *c, const unsigned char *m, 15 | unsigned long long mlen, 16 | const unsigned char *n, uint64_t ic, 17 | const unsigned char *k); 18 | 19 | int 20 | crypto_stream_chacha20_ietf_ref(unsigned char *c, unsigned long long clen, 21 | const unsigned char *n, const unsigned char *k); 22 | 23 | int 24 | crypto_stream_chacha20_ietf_ref_xor_ic(unsigned char *c, const unsigned char *m, 25 | unsigned long long mlen, 26 | const unsigned char *n, uint32_t ic, 27 | const unsigned char *k); 28 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_stream/chacha20/stream_chacha20.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef stream_chacha20_H 3 | #define stream_chacha20_H 4 | 5 | #include 6 | 7 | typedef struct crypto_stream_chacha20_implementation { 8 | int (*stream)(unsigned char *c, unsigned long long clen, 9 | const unsigned char *n, const unsigned char *k); 10 | int (*stream_ietf)(unsigned char *c, unsigned long long clen, 11 | const unsigned char *n, const unsigned char *k); 12 | int (*stream_xor_ic)(unsigned char *c, const unsigned char *m, 13 | unsigned long long mlen, 14 | const unsigned char *n, uint64_t ic, 15 | const unsigned char *k); 16 | int (*stream_ietf_xor_ic)(unsigned char *c, const unsigned char *m, 17 | unsigned long long mlen, 18 | const unsigned char *n, uint32_t ic, 19 | const unsigned char *k); 20 | } crypto_stream_chacha20_implementation; 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_stream/chacha20/vec/stream_chacha20_vec.h: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | #include "crypto_stream_chacha20.h" 5 | 6 | extern struct crypto_stream_chacha20_implementation 7 | crypto_stream_chacha20_vec_implementation; 8 | 9 | int 10 | crypto_stream_chacha20_vec(unsigned char *c, unsigned long long clen, 11 | const unsigned char *n, const unsigned char *k); 12 | 13 | int 14 | crypto_stream_chacha20_vec_xor_ic(unsigned char *c, const unsigned char *m, 15 | unsigned long long mlen, 16 | const unsigned char *n, uint64_t ic, 17 | const unsigned char *k); 18 | 19 | int 20 | crypto_stream_chacha20_ietf_vec(unsigned char *c, unsigned long long clen, 21 | const unsigned char *n, const unsigned char *k); 22 | 23 | int 24 | crypto_stream_chacha20_ietf_vec_xor_ic(unsigned char *c, const unsigned char *m, 25 | unsigned long long mlen, 26 | const unsigned char *n, uint32_t ic, 27 | const unsigned char *k); 28 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_stream/crypto_stream.c: -------------------------------------------------------------------------------- 1 | 2 | #include "crypto_stream.h" 3 | 4 | size_t 5 | crypto_stream_keybytes(void) 6 | { 7 | return crypto_stream_KEYBYTES; 8 | } 9 | 10 | size_t 11 | crypto_stream_noncebytes(void) 12 | { 13 | return crypto_stream_NONCEBYTES; 14 | } 15 | 16 | const char * 17 | crypto_stream_primitive(void) 18 | { 19 | return crypto_stream_PRIMITIVE; 20 | } 21 | 22 | int 23 | crypto_stream(unsigned char *c, unsigned long long clen, 24 | const unsigned char *n, const unsigned char *k) 25 | { 26 | return crypto_stream_xsalsa20(c, clen, n, k); 27 | } 28 | 29 | 30 | int 31 | crypto_stream_xor(unsigned char *c, const unsigned char *m, 32 | unsigned long long mlen, const unsigned char *n, 33 | const unsigned char *k) 34 | { 35 | return crypto_stream_xsalsa20_xor(c, m, mlen, n, k); 36 | } 37 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_stream/salsa20/stream_salsa20_api.c: -------------------------------------------------------------------------------- 1 | #include "crypto_stream_salsa20.h" 2 | 3 | size_t 4 | crypto_stream_salsa20_keybytes(void) { 5 | return crypto_stream_salsa20_KEYBYTES; 6 | } 7 | 8 | size_t 9 | crypto_stream_salsa20_noncebytes(void) { 10 | return crypto_stream_salsa20_NONCEBYTES; 11 | } 12 | 13 | int 14 | crypto_stream_salsa20_xor(unsigned char *c, const unsigned char *m, 15 | unsigned long long mlen, const unsigned char *n, 16 | const unsigned char *k) 17 | { 18 | return crypto_stream_salsa20_xor_ic(c, m, mlen, n, 0U, k); 19 | } 20 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_stream/salsa2012/stream_salsa2012_api.c: -------------------------------------------------------------------------------- 1 | #include "crypto_stream_salsa2012.h" 2 | 3 | size_t 4 | crypto_stream_salsa2012_keybytes(void) { 5 | return crypto_stream_salsa2012_KEYBYTES; 6 | } 7 | 8 | size_t 9 | crypto_stream_salsa2012_noncebytes(void) { 10 | return crypto_stream_salsa2012_NONCEBYTES; 11 | } 12 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_stream/salsa208/stream_salsa208_api.c: -------------------------------------------------------------------------------- 1 | #include "crypto_stream_salsa208.h" 2 | 3 | size_t 4 | crypto_stream_salsa208_keybytes(void) { 5 | return crypto_stream_salsa208_KEYBYTES; 6 | } 7 | 8 | size_t 9 | crypto_stream_salsa208_noncebytes(void) { 10 | return crypto_stream_salsa208_NONCEBYTES; 11 | } 12 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_stream/xsalsa20/ref/stream_xsalsa20.c: -------------------------------------------------------------------------------- 1 | /* 2 | version 20080914 3 | D. J. Bernstein 4 | Public domain. 5 | */ 6 | 7 | #include "crypto_core_hsalsa20.h" 8 | #include "crypto_stream_salsa20.h" 9 | #include "crypto_stream_xsalsa20.h" 10 | #include "utils.h" 11 | 12 | static const unsigned char sigma[16] = { 13 | 'e', 'x', 'p', 'a', 'n', 'd', ' ', '3', '2', '-', 'b', 'y', 't', 'e', ' ', 'k' 14 | }; 15 | 16 | int crypto_stream_xsalsa20( 17 | unsigned char *c,unsigned long long clen, 18 | const unsigned char *n, 19 | const unsigned char *k 20 | ) 21 | { 22 | unsigned char subkey[32]; 23 | int ret; 24 | crypto_core_hsalsa20(subkey,n,k,sigma); 25 | ret = crypto_stream_salsa20(c,clen,n + 16,subkey); 26 | sodium_memzero(subkey, sizeof subkey); 27 | return ret; 28 | } 29 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_stream/xsalsa20/ref/xor_xsalsa20.c: -------------------------------------------------------------------------------- 1 | /* 2 | version 20080913 3 | D. J. Bernstein 4 | Public domain. 5 | */ 6 | 7 | #include "crypto_core_hsalsa20.h" 8 | #include "crypto_stream_salsa20.h" 9 | #include "crypto_stream_xsalsa20.h" 10 | #include "utils.h" 11 | 12 | static const unsigned char sigma[16] = { 13 | 'e', 'x', 'p', 'a', 'n', 'd', ' ', '3', '2', '-', 'b', 'y', 't', 'e', ' ', 'k' 14 | }; 15 | 16 | int crypto_stream_xsalsa20_xor_ic( 17 | unsigned char *c, 18 | const unsigned char *m,unsigned long long mlen, 19 | const unsigned char *n,uint64_t ic, 20 | const unsigned char *k 21 | ) 22 | { 23 | unsigned char subkey[32]; 24 | int ret; 25 | crypto_core_hsalsa20(subkey,n,k,sigma); 26 | ret = crypto_stream_salsa20_xor_ic(c,m,mlen,n + 16,ic,subkey); 27 | sodium_memzero(subkey, sizeof subkey); 28 | return ret; 29 | } 30 | 31 | int crypto_stream_xsalsa20_xor( 32 | unsigned char *c, 33 | const unsigned char *m,unsigned long long mlen, 34 | const unsigned char *n, 35 | const unsigned char *k 36 | ) 37 | { 38 | return crypto_stream_xsalsa20_xor_ic(c, m, mlen, n, 0ULL, k); 39 | } 40 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_stream/xsalsa20/stream_xsalsa20_api.c: -------------------------------------------------------------------------------- 1 | #include "crypto_stream_xsalsa20.h" 2 | 3 | size_t 4 | crypto_stream_xsalsa20_keybytes(void) { 5 | return crypto_stream_xsalsa20_KEYBYTES; 6 | } 7 | 8 | size_t 9 | crypto_stream_xsalsa20_noncebytes(void) { 10 | return crypto_stream_xsalsa20_NONCEBYTES; 11 | } 12 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_verify/16/ref/verify_16.c: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | 5 | #include "crypto_verify_16.h" 6 | 7 | int 8 | crypto_verify_16(const unsigned char *x, const unsigned char *y) 9 | { 10 | uint_fast16_t d = 0U; 11 | int i; 12 | 13 | for (i = 0; i < 16; i++) { 14 | d |= x[i] ^ y[i]; 15 | } 16 | return (1 & ((d - 1) >> 8)) - 1; 17 | } 18 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_verify/16/verify_16_api.c: -------------------------------------------------------------------------------- 1 | #include "crypto_verify_16.h" 2 | 3 | size_t 4 | crypto_verify_16_bytes(void) { 5 | return crypto_verify_16_BYTES; 6 | } 7 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_verify/32/ref/verify_32.c: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | 5 | #include "crypto_verify_32.h" 6 | 7 | int 8 | crypto_verify_32(const unsigned char *x, const unsigned char *y) 9 | { 10 | uint_fast16_t d = 0U; 11 | int i; 12 | 13 | for (i = 0; i < 32; i++) { 14 | d |= x[i] ^ y[i]; 15 | } 16 | return (1 & ((d - 1) >> 8)) - 1; 17 | } 18 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_verify/32/verify_32_api.c: -------------------------------------------------------------------------------- 1 | #include "crypto_verify_32.h" 2 | 3 | size_t 4 | crypto_verify_32_bytes(void) { 5 | return crypto_verify_32_BYTES; 6 | } 7 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_verify/64/ref/verify_64.c: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | 5 | #include "crypto_verify_64.h" 6 | 7 | int 8 | crypto_verify_64(const unsigned char *x, const unsigned char *y) 9 | { 10 | uint_fast16_t d = 0U; 11 | int i; 12 | 13 | for (i = 0; i < 64; i++) { 14 | d |= x[i] ^ y[i]; 15 | } 16 | return (1 & ((d - 1) >> 8)) - 1; 17 | } 18 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/crypto_verify/64/verify_64_api.c: -------------------------------------------------------------------------------- 1 | #include "crypto_verify_64.h" 2 | 3 | size_t 4 | crypto_verify_64_bytes(void) { 5 | return crypto_verify_64_BYTES; 6 | } 7 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/include/sodium/core.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef sodium_core_H 3 | #define sodium_core_H 4 | 5 | #include "export.h" 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | SODIUM_EXPORT 12 | int sodium_init(void) 13 | __attribute__ ((warn_unused_result)); 14 | 15 | #ifdef __cplusplus 16 | } 17 | #endif 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/include/sodium/crypto_auth.h: -------------------------------------------------------------------------------- 1 | #ifndef crypto_auth_H 2 | #define crypto_auth_H 3 | 4 | #include 5 | 6 | #include "crypto_auth_hmacsha512256.h" 7 | #include "export.h" 8 | 9 | #ifdef __cplusplus 10 | # if __GNUC__ 11 | # pragma GCC diagnostic ignored "-Wlong-long" 12 | # endif 13 | extern "C" { 14 | #endif 15 | 16 | #define crypto_auth_BYTES crypto_auth_hmacsha512256_BYTES 17 | SODIUM_EXPORT 18 | size_t crypto_auth_bytes(void); 19 | 20 | #define crypto_auth_KEYBYTES crypto_auth_hmacsha512256_KEYBYTES 21 | SODIUM_EXPORT 22 | size_t crypto_auth_keybytes(void); 23 | 24 | #define crypto_auth_PRIMITIVE "hmacsha512256" 25 | SODIUM_EXPORT 26 | const char *crypto_auth_primitive(void); 27 | 28 | SODIUM_EXPORT 29 | int crypto_auth(unsigned char *out, const unsigned char *in, 30 | unsigned long long inlen, const unsigned char *k); 31 | 32 | SODIUM_EXPORT 33 | int crypto_auth_verify(const unsigned char *h, const unsigned char *in, 34 | unsigned long long inlen, const unsigned char *k) 35 | __attribute__ ((warn_unused_result)); 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/include/sodium/crypto_core_hsalsa20.h: -------------------------------------------------------------------------------- 1 | #ifndef crypto_core_hsalsa20_H 2 | #define crypto_core_hsalsa20_H 3 | 4 | #include 5 | #include "export.h" 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | #define crypto_core_hsalsa20_OUTPUTBYTES 32U 12 | SODIUM_EXPORT 13 | size_t crypto_core_hsalsa20_outputbytes(void); 14 | 15 | #define crypto_core_hsalsa20_INPUTBYTES 16U 16 | SODIUM_EXPORT 17 | size_t crypto_core_hsalsa20_inputbytes(void); 18 | 19 | #define crypto_core_hsalsa20_KEYBYTES 32U 20 | SODIUM_EXPORT 21 | size_t crypto_core_hsalsa20_keybytes(void); 22 | 23 | #define crypto_core_hsalsa20_CONSTBYTES 16U 24 | SODIUM_EXPORT 25 | size_t crypto_core_hsalsa20_constbytes(void); 26 | 27 | SODIUM_EXPORT 28 | int crypto_core_hsalsa20(unsigned char *out, const unsigned char *in, 29 | const unsigned char *k, const unsigned char *c); 30 | 31 | #ifdef __cplusplus 32 | } 33 | #endif 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/include/sodium/crypto_core_salsa20.h: -------------------------------------------------------------------------------- 1 | #ifndef crypto_core_salsa20_H 2 | #define crypto_core_salsa20_H 3 | 4 | #include 5 | #include "export.h" 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | #define crypto_core_salsa20_OUTPUTBYTES 64U 12 | SODIUM_EXPORT 13 | size_t crypto_core_salsa20_outputbytes(void); 14 | 15 | #define crypto_core_salsa20_INPUTBYTES 16U 16 | SODIUM_EXPORT 17 | size_t crypto_core_salsa20_inputbytes(void); 18 | 19 | #define crypto_core_salsa20_KEYBYTES 32U 20 | SODIUM_EXPORT 21 | size_t crypto_core_salsa20_keybytes(void); 22 | 23 | #define crypto_core_salsa20_CONSTBYTES 16U 24 | SODIUM_EXPORT 25 | size_t crypto_core_salsa20_constbytes(void); 26 | 27 | SODIUM_EXPORT 28 | int crypto_core_salsa20(unsigned char *out, const unsigned char *in, 29 | const unsigned char *k, const unsigned char *c); 30 | 31 | #ifdef __cplusplus 32 | } 33 | #endif 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/include/sodium/crypto_core_salsa2012.h: -------------------------------------------------------------------------------- 1 | #ifndef crypto_core_salsa2012_H 2 | #define crypto_core_salsa2012_H 3 | 4 | #include 5 | #include "export.h" 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | #define crypto_core_salsa2012_OUTPUTBYTES 64U 12 | SODIUM_EXPORT 13 | size_t crypto_core_salsa2012_outputbytes(void); 14 | 15 | #define crypto_core_salsa2012_INPUTBYTES 16U 16 | SODIUM_EXPORT 17 | size_t crypto_core_salsa2012_inputbytes(void); 18 | 19 | #define crypto_core_salsa2012_KEYBYTES 32U 20 | SODIUM_EXPORT 21 | size_t crypto_core_salsa2012_keybytes(void); 22 | 23 | #define crypto_core_salsa2012_CONSTBYTES 16U 24 | SODIUM_EXPORT 25 | size_t crypto_core_salsa2012_constbytes(void); 26 | 27 | SODIUM_EXPORT 28 | int crypto_core_salsa2012(unsigned char *out, const unsigned char *in, 29 | const unsigned char *k, const unsigned char *c); 30 | 31 | #ifdef __cplusplus 32 | } 33 | #endif 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/include/sodium/crypto_core_salsa208.h: -------------------------------------------------------------------------------- 1 | #ifndef crypto_core_salsa208_H 2 | #define crypto_core_salsa208_H 3 | 4 | #include 5 | #include "export.h" 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | #define crypto_core_salsa208_OUTPUTBYTES 64U 12 | SODIUM_EXPORT 13 | size_t crypto_core_salsa208_outputbytes(void); 14 | 15 | #define crypto_core_salsa208_INPUTBYTES 16U 16 | SODIUM_EXPORT 17 | size_t crypto_core_salsa208_inputbytes(void); 18 | 19 | #define crypto_core_salsa208_KEYBYTES 32U 20 | SODIUM_EXPORT 21 | size_t crypto_core_salsa208_keybytes(void); 22 | 23 | #define crypto_core_salsa208_CONSTBYTES 16U 24 | SODIUM_EXPORT 25 | size_t crypto_core_salsa208_constbytes(void); 26 | 27 | SODIUM_EXPORT 28 | int crypto_core_salsa208(unsigned char *out, const unsigned char *in, 29 | const unsigned char *k, const unsigned char *c); 30 | 31 | #ifdef __cplusplus 32 | } 33 | #endif 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/include/sodium/crypto_hash.h: -------------------------------------------------------------------------------- 1 | #ifndef crypto_hash_H 2 | #define crypto_hash_H 3 | 4 | /* 5 | * WARNING: Unless you absolutely need to use SHA512 for interoperatibility, 6 | * purposes, you might want to consider crypto_generichash() instead. 7 | * Unlike SHA512, crypto_generichash() is not vulnerable to length 8 | * extension attacks. 9 | */ 10 | 11 | #include 12 | 13 | #include "crypto_hash_sha512.h" 14 | #include "export.h" 15 | 16 | #ifdef __cplusplus 17 | # if __GNUC__ 18 | # pragma GCC diagnostic ignored "-Wlong-long" 19 | # endif 20 | extern "C" { 21 | #endif 22 | 23 | #define crypto_hash_BYTES crypto_hash_sha512_BYTES 24 | SODIUM_EXPORT 25 | size_t crypto_hash_bytes(void); 26 | 27 | SODIUM_EXPORT 28 | int crypto_hash(unsigned char *out, const unsigned char *in, 29 | unsigned long long inlen); 30 | 31 | #define crypto_hash_PRIMITIVE "sha512" 32 | SODIUM_EXPORT 33 | const char *crypto_hash_primitive(void) 34 | __attribute__ ((warn_unused_result)); 35 | 36 | #ifdef __cplusplus 37 | } 38 | #endif 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/include/sodium/crypto_int32.h: -------------------------------------------------------------------------------- 1 | #ifndef crypto_int32_H 2 | #define crypto_int32_H 3 | 4 | #include 5 | 6 | typedef int32_t crypto_int32; 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/include/sodium/crypto_int64.h: -------------------------------------------------------------------------------- 1 | #ifndef crypto_int64_H 2 | #define crypto_int64_H 3 | 4 | #include 5 | 6 | typedef int64_t crypto_int64; 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/include/sodium/crypto_scalarmult.h: -------------------------------------------------------------------------------- 1 | #ifndef crypto_scalarmult_H 2 | #define crypto_scalarmult_H 3 | 4 | #include 5 | 6 | #include "crypto_scalarmult_curve25519.h" 7 | #include "export.h" 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | #define crypto_scalarmult_BYTES crypto_scalarmult_curve25519_BYTES 14 | SODIUM_EXPORT 15 | size_t crypto_scalarmult_bytes(void); 16 | 17 | #define crypto_scalarmult_SCALARBYTES crypto_scalarmult_curve25519_SCALARBYTES 18 | SODIUM_EXPORT 19 | size_t crypto_scalarmult_scalarbytes(void); 20 | 21 | #define crypto_scalarmult_PRIMITIVE "curve25519" 22 | SODIUM_EXPORT 23 | const char *crypto_scalarmult_primitive(void); 24 | 25 | SODIUM_EXPORT 26 | int crypto_scalarmult_base(unsigned char *q, const unsigned char *n); 27 | 28 | SODIUM_EXPORT 29 | int crypto_scalarmult(unsigned char *q, const unsigned char *n, 30 | const unsigned char *p) 31 | __attribute__ ((warn_unused_result)); 32 | 33 | #ifdef __cplusplus 34 | } 35 | #endif 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/include/sodium/crypto_scalarmult_curve25519.h: -------------------------------------------------------------------------------- 1 | #ifndef crypto_scalarmult_curve25519_H 2 | #define crypto_scalarmult_curve25519_H 3 | 4 | #include 5 | 6 | #include "export.h" 7 | 8 | #ifdef __cplusplus 9 | extern "C" { 10 | #endif 11 | 12 | #define crypto_scalarmult_curve25519_BYTES 32U 13 | SODIUM_EXPORT 14 | size_t crypto_scalarmult_curve25519_bytes(void); 15 | 16 | #define crypto_scalarmult_curve25519_SCALARBYTES 32U 17 | SODIUM_EXPORT 18 | size_t crypto_scalarmult_curve25519_scalarbytes(void); 19 | 20 | SODIUM_EXPORT 21 | int crypto_scalarmult_curve25519(unsigned char *q, const unsigned char *n, 22 | const unsigned char *p) 23 | __attribute__ ((warn_unused_result)); 24 | 25 | SODIUM_EXPORT 26 | int crypto_scalarmult_curve25519_base(unsigned char *q, const unsigned char *n); 27 | 28 | /* ------------------------------------------------------------------------- */ 29 | 30 | int _crypto_scalarmult_curve25519_pick_best_implementation(void); 31 | 32 | #ifdef __cplusplus 33 | } 34 | #endif 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/include/sodium/crypto_shorthash.h: -------------------------------------------------------------------------------- 1 | #ifndef crypto_shorthash_H 2 | #define crypto_shorthash_H 3 | 4 | #include 5 | 6 | #include "crypto_shorthash_siphash24.h" 7 | #include "export.h" 8 | 9 | #ifdef __cplusplus 10 | # if __GNUC__ 11 | # pragma GCC diagnostic ignored "-Wlong-long" 12 | # endif 13 | extern "C" { 14 | #endif 15 | 16 | #define crypto_shorthash_BYTES crypto_shorthash_siphash24_BYTES 17 | SODIUM_EXPORT 18 | size_t crypto_shorthash_bytes(void); 19 | 20 | #define crypto_shorthash_KEYBYTES crypto_shorthash_siphash24_KEYBYTES 21 | SODIUM_EXPORT 22 | size_t crypto_shorthash_keybytes(void); 23 | 24 | #define crypto_shorthash_PRIMITIVE "siphash24" 25 | SODIUM_EXPORT 26 | const char *crypto_shorthash_primitive(void); 27 | 28 | SODIUM_EXPORT 29 | int crypto_shorthash(unsigned char *out, const unsigned char *in, 30 | unsigned long long inlen, const unsigned char *k); 31 | 32 | #ifdef __cplusplus 33 | } 34 | #endif 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/include/sodium/crypto_shorthash_siphash24.h: -------------------------------------------------------------------------------- 1 | #ifndef crypto_shorthash_siphash24_H 2 | #define crypto_shorthash_siphash24_H 3 | 4 | #include 5 | #include "export.h" 6 | 7 | #ifdef __cplusplus 8 | # if __GNUC__ 9 | # pragma GCC diagnostic ignored "-Wlong-long" 10 | # endif 11 | extern "C" { 12 | #endif 13 | 14 | #define crypto_shorthash_siphash24_BYTES 8U 15 | SODIUM_EXPORT 16 | size_t crypto_shorthash_siphash24_bytes(void); 17 | 18 | #define crypto_shorthash_siphash24_KEYBYTES 16U 19 | SODIUM_EXPORT 20 | size_t crypto_shorthash_siphash24_keybytes(void); 21 | 22 | SODIUM_EXPORT 23 | int crypto_shorthash_siphash24(unsigned char *out, const unsigned char *in, 24 | unsigned long long inlen, const unsigned char *k); 25 | 26 | #ifdef __cplusplus 27 | } 28 | #endif 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/include/sodium/crypto_uint16.h: -------------------------------------------------------------------------------- 1 | #ifndef crypto_uint16_H 2 | #define crypto_uint16_H 3 | 4 | #include 5 | 6 | typedef uint16_t crypto_uint16; 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/include/sodium/crypto_uint32.h: -------------------------------------------------------------------------------- 1 | #ifndef crypto_uint32_H 2 | #define crypto_uint32_H 3 | 4 | #include 5 | 6 | typedef uint32_t crypto_uint32; 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/include/sodium/crypto_uint64.h: -------------------------------------------------------------------------------- 1 | #ifndef crypto_uint64_H 2 | #define crypto_uint64_H 3 | 4 | #include 5 | 6 | typedef uint64_t crypto_uint64; 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/include/sodium/crypto_uint8.h: -------------------------------------------------------------------------------- 1 | #ifndef crypto_uint8_H 2 | #define crypto_uint8_H 3 | 4 | #include 5 | 6 | typedef uint8_t crypto_uint8; 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/include/sodium/crypto_verify_16.h: -------------------------------------------------------------------------------- 1 | #ifndef crypto_verify_16_H 2 | #define crypto_verify_16_H 3 | 4 | #include 5 | #include "export.h" 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | #define crypto_verify_16_BYTES 16U 12 | SODIUM_EXPORT 13 | size_t crypto_verify_16_bytes(void); 14 | 15 | SODIUM_EXPORT 16 | int crypto_verify_16(const unsigned char *x, const unsigned char *y) 17 | __attribute__ ((warn_unused_result)); 18 | 19 | #ifdef __cplusplus 20 | } 21 | #endif 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/include/sodium/crypto_verify_32.h: -------------------------------------------------------------------------------- 1 | #ifndef crypto_verify_32_H 2 | #define crypto_verify_32_H 3 | 4 | #include 5 | #include "export.h" 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | #define crypto_verify_32_BYTES 32U 12 | SODIUM_EXPORT 13 | size_t crypto_verify_32_bytes(void); 14 | 15 | SODIUM_EXPORT 16 | int crypto_verify_32(const unsigned char *x, const unsigned char *y) 17 | __attribute__ ((warn_unused_result)); 18 | 19 | #ifdef __cplusplus 20 | } 21 | #endif 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/include/sodium/crypto_verify_64.h: -------------------------------------------------------------------------------- 1 | #ifndef crypto_verify_64_H 2 | #define crypto_verify_64_H 3 | 4 | #include 5 | #include "export.h" 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | #define crypto_verify_64_BYTES 64U 12 | SODIUM_EXPORT 13 | size_t crypto_verify_64_bytes(void); 14 | 15 | SODIUM_EXPORT 16 | int crypto_verify_64(const unsigned char *x, const unsigned char *y) 17 | __attribute__ ((warn_unused_result)); 18 | 19 | #ifdef __cplusplus 20 | } 21 | #endif 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/include/sodium/export.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef sodium_export_H 3 | #define sodium_export_H 4 | 5 | #ifndef __GNUC__ 6 | # ifdef __attribute__ 7 | # undef __attribute__ 8 | # endif 9 | # define __attribute__(a) 10 | #endif 11 | 12 | #ifdef SODIUM_STATIC 13 | # define SODIUM_EXPORT 14 | #else 15 | # if defined(_MSC_VER) 16 | # ifdef SODIUM_DLL_EXPORT 17 | # define SODIUM_EXPORT __declspec(dllexport) 18 | # else 19 | # define SODIUM_EXPORT __declspec(dllimport) 20 | # endif 21 | # else 22 | # if defined(__SUNPRO_C) 23 | # ifndef __GNU_C__ 24 | # define SODIUM_EXPORT __attribute__(visibility(__global)) 25 | # else 26 | # define SODIUM_EXPORT __attribute__ __global 27 | # endif 28 | # elif defined(_MSG_VER) 29 | # define SODIUM_EXPORT extern __declspec(dllexport) 30 | # else 31 | # define SODIUM_EXPORT __attribute__ ((visibility ("default"))) 32 | # endif 33 | # endif 34 | #endif 35 | 36 | #ifndef CRYPTO_ALIGN 37 | # if defined(__INTEL_COMPILER) || defined(_MSC_VER) 38 | # define CRYPTO_ALIGN(x) __declspec(align(x)) 39 | # else 40 | # define CRYPTO_ALIGN(x) __attribute__((aligned(x))) 41 | # endif 42 | #endif 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/include/sodium/randombytes_nativeclient.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef randombytes_nativeclient_H 3 | #define randombytes_nativeclient_H 4 | 5 | #ifdef __native_client__ 6 | 7 | # include "export.h" 8 | # include "randombytes.h" 9 | 10 | # ifdef __cplusplus 11 | extern "C" { 12 | # endif 13 | 14 | SODIUM_EXPORT 15 | extern struct randombytes_implementation randombytes_nativeclient_implementation; 16 | 17 | # ifdef __cplusplus 18 | } 19 | # endif 20 | 21 | #endif 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/include/sodium/randombytes_salsa20_random.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef randombytes_salsa20_random_H 3 | #define randombytes_salsa20_random_H 4 | 5 | #include "export.h" 6 | #include "randombytes.h" 7 | 8 | #ifdef __cplusplus 9 | extern "C" { 10 | #endif 11 | 12 | SODIUM_EXPORT 13 | extern struct randombytes_implementation randombytes_salsa20_implementation; 14 | 15 | #ifdef __cplusplus 16 | } 17 | #endif 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/include/sodium/randombytes_sysrandom.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef randombytes_sysrandom_H 3 | #define randombytes_sysrandom_H 4 | 5 | #include "export.h" 6 | #include "randombytes.h" 7 | 8 | #ifdef __cplusplus 9 | extern "C" { 10 | #endif 11 | 12 | SODIUM_EXPORT 13 | extern struct randombytes_implementation randombytes_sysrandom_implementation; 14 | 15 | #ifdef __cplusplus 16 | } 17 | #endif 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/include/sodium/runtime.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef sodium_runtime_H 3 | #define sodium_runtime_H 4 | 5 | #include "export.h" 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | SODIUM_EXPORT 12 | int sodium_runtime_has_neon(void); 13 | 14 | SODIUM_EXPORT 15 | int sodium_runtime_has_sse2(void); 16 | 17 | SODIUM_EXPORT 18 | int sodium_runtime_has_sse3(void); 19 | 20 | SODIUM_EXPORT 21 | int sodium_runtime_has_ssse3(void); 22 | 23 | SODIUM_EXPORT 24 | int sodium_runtime_has_sse41(void); 25 | 26 | SODIUM_EXPORT 27 | int sodium_runtime_has_avx(void); 28 | 29 | SODIUM_EXPORT 30 | int sodium_runtime_has_pclmul(void); 31 | 32 | SODIUM_EXPORT 33 | int sodium_runtime_has_aesni(void); 34 | 35 | /* ------------------------------------------------------------------------- */ 36 | 37 | int _sodium_runtime_get_cpu_features(void); 38 | 39 | #ifdef __cplusplus 40 | } 41 | #endif 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/include/sodium/version.h.in: -------------------------------------------------------------------------------- 1 | 2 | #ifndef sodium_version_H 3 | #define sodium_version_H 4 | 5 | #include "export.h" 6 | 7 | #define SODIUM_VERSION_STRING "@VERSION@" 8 | 9 | #define SODIUM_LIBRARY_VERSION_MAJOR @SODIUM_LIBRARY_VERSION_MAJOR@ 10 | #define SODIUM_LIBRARY_VERSION_MINOR @SODIUM_LIBRARY_VERSION_MINOR@ 11 | 12 | #ifdef __cplusplus 13 | extern "C" { 14 | #endif 15 | 16 | SODIUM_EXPORT 17 | const char *sodium_version_string(void); 18 | 19 | SODIUM_EXPORT 20 | int sodium_library_version_major(void); 21 | 22 | SODIUM_EXPORT 23 | int sodium_library_version_minor(void); 24 | 25 | #ifdef __cplusplus 26 | } 27 | #endif 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/randombytes/nativeclient/randombytes_nativeclient.c: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | #include 5 | 6 | #ifdef __native_client__ 7 | # include 8 | 9 | # include "utils.h" 10 | # include "randombytes.h" 11 | # include "randombytes_nativeclient.h" 12 | 13 | static void 14 | randombytes_nativeclient_buf(void * const buf, const size_t size) 15 | { 16 | size_t readnb; 17 | 18 | if (nacl_secure_random(buf, size, &readnb) != 0) { 19 | abort(); 20 | } 21 | assert(readnb == size); 22 | } 23 | 24 | static uint32_t 25 | randombytes_nativeclient_random(void) 26 | { 27 | uint32_t r; 28 | 29 | randombytes_nativeclient_buf(&r, sizeof r); 30 | 31 | return r; 32 | } 33 | 34 | static const char * 35 | randombytes_nativeclient_implementation_name(void) 36 | { 37 | return "nativeclient"; 38 | } 39 | 40 | struct randombytes_implementation randombytes_nativeclient_implementation = { 41 | SODIUM_C99(.implementation_name =) randombytes_nativeclient_implementation_name, 42 | SODIUM_C99(.random =) randombytes_nativeclient_random, 43 | SODIUM_C99(.stir =) NULL, 44 | SODIUM_C99(.uniform =) NULL, 45 | SODIUM_C99(.buf =) randombytes_nativeclient_buf, 46 | SODIUM_C99(.close =) NULL 47 | }; 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/sodium/core.c: -------------------------------------------------------------------------------- 1 | 2 | #include "core.h" 3 | #include "crypto_generichash.h" 4 | #include "crypto_onetimeauth.h" 5 | #include "crypto_scalarmult.h" 6 | #include "crypto_stream_chacha20.h" 7 | #include "randombytes.h" 8 | #include "runtime.h" 9 | #include "utils.h" 10 | 11 | static int initialized; 12 | 13 | int 14 | sodium_init(void) 15 | { 16 | if (initialized != 0) { 17 | return 1; 18 | } 19 | _sodium_runtime_get_cpu_features(); 20 | randombytes_stir(); 21 | _sodium_alloc_init(); 22 | _crypto_generichash_blake2b_pick_best_implementation(); 23 | _crypto_onetimeauth_poly1305_pick_best_implementation(); 24 | _crypto_scalarmult_curve25519_pick_best_implementation(); 25 | _crypto_stream_chacha20_pick_best_implementation(); 26 | initialized = 1; 27 | 28 | return 0; 29 | } 30 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libsodium/src/libsodium/sodium/version.c: -------------------------------------------------------------------------------- 1 | 2 | #include "version.h" 3 | 4 | const char * 5 | sodium_version_string(void) 6 | { 7 | return SODIUM_VERSION_STRING; 8 | } 9 | 10 | int 11 | sodium_library_version_major(void) 12 | { 13 | return SODIUM_LIBRARY_VERSION_MAJOR; 14 | } 15 | 16 | int 17 | sodium_library_version_minor(void) 18 | { 19 | return SODIUM_LIBRARY_VERSION_MINOR; 20 | } 21 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libudns/Makefile.am: -------------------------------------------------------------------------------- 1 | # This file is part of libasyncns. 2 | # 3 | # Copyright 2005-2008 Lennart Poettering 4 | # 5 | # libasyncns is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU Lesser General Public License as 7 | # published by the Free Software Foundation, either version 2.1 of the 8 | # License, or (at your option) any later version. 9 | # 10 | # libasyncns is distributed in the hope that it will be useful, but 11 | # WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | # Lesser General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU Lesser General Public 16 | # License along with libasyncns. If not, see 17 | # . 18 | 19 | SRCS = udns_dn.c udns_dntosp.c udns_parse.c udns_resolver.c udns_init.c \ 20 | udns_misc.c udns_XtoX.c \ 21 | udns_rr_a.c udns_rr_ptr.c udns_rr_mx.c udns_rr_txt.c udns_bl.c \ 22 | udns_rr_srv.c udns_rr_naptr.c udns_codes.c udns_jran.c 23 | noinst_LTLIBRARIES=libudns.la 24 | libudns_la_SOURCES= ${SRCS} 25 | libudns_la_LDFLAGS= -static 26 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/libudns/udns_dntosp.c: -------------------------------------------------------------------------------- 1 | /* udns_dntosp.c 2 | dns_dntosp() = convert DN to asciiz string using static buffer 3 | 4 | Copyright (C) 2005 Michael Tokarev 5 | This file is part of UDNS library, an async DNS stub resolver. 6 | 7 | This library is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU Lesser General Public 9 | License as published by the Free Software Foundation; either 10 | version 2.1 of the License, or (at your option) any later version. 11 | 12 | This library is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | Lesser General Public License for more details. 16 | 17 | You should have received a copy of the GNU Lesser General Public 18 | License along with this library, in file named COPYING.LGPL; if not, 19 | write to the Free Software Foundation, Inc., 59 Temple Place, 20 | Suite 330, Boston, MA 02111-1307 USA 21 | 22 | */ 23 | 24 | #include "udns.h" 25 | 26 | static char name[DNS_MAXNAME]; 27 | 28 | const char *dns_dntosp(dnscc_t *dn) { 29 | return dns_dntop(dn, name, sizeof(name)) > 0 ? name : 0; 30 | } 31 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/m4/ltversion.m4: -------------------------------------------------------------------------------- 1 | # ltversion.m4 -- version numbers -*- Autoconf -*- 2 | # 3 | # Copyright (C) 2004 Free Software Foundation, Inc. 4 | # Written by Scott James Remnant, 2004 5 | # 6 | # This file is free software; the Free Software Foundation gives 7 | # unlimited permission to copy and/or distribute it, with or without 8 | # modifications, as long as this notice is preserved. 9 | 10 | # @configure_input@ 11 | 12 | # serial 3337 ltversion.m4 13 | # This file is part of GNU Libtool 14 | 15 | m4_define([LT_PACKAGE_VERSION], [2.4.2]) 16 | m4_define([LT_PACKAGE_REVISION], [1.3337]) 17 | 18 | AC_DEFUN([LTVERSION_VERSION], 19 | [macro_version='2.4.2' 20 | macro_revision='1.3337' 21 | _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) 22 | _LT_DECL(, macro_revision, 0) 23 | ]) 24 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/m4/polarssl.m4: -------------------------------------------------------------------------------- 1 | dnl Check to find the PolarSSL headers/libraries 2 | 3 | AC_DEFUN([ss_POLARSSL], 4 | [ 5 | 6 | AC_ARG_WITH(polarssl, 7 | AS_HELP_STRING([--with-polarssl=DIR], [PolarSSL base directory, or:]), 8 | [polarssl="$withval" 9 | CFLAGS="$CFLAGS -I$withval/include" 10 | LDFLAGS="$LDFLAGS -L$withval/lib"] 11 | ) 12 | 13 | AC_ARG_WITH(polarssl-include, 14 | AS_HELP_STRING([--with-polarssl-include=DIR], [PolarSSL headers directory (without trailing /polarssl)]), 15 | [polarssl_include="$withval" 16 | CFLAGS="$CFLAGS -I$withval"] 17 | ) 18 | 19 | AC_ARG_WITH(polarssl-lib, 20 | AS_HELP_STRING([--with-polarssl-lib=DIR], [PolarSSL library directory]), 21 | [polarssl_lib="$withval" 22 | LDFLAGS="$LDFLAGS -L$withval"] 23 | ) 24 | 25 | AC_CHECK_LIB(polarssl, cipher_init_ctx, 26 | [LIBS="-lpolarssl $LIBS"], 27 | [AC_MSG_ERROR([PolarSSL libraries not found.])] 28 | ) 29 | 30 | AC_MSG_CHECKING([polarssl version]) 31 | AC_COMPILE_IFELSE( 32 | [AC_LANG_PROGRAM( 33 | [[ 34 | #include 35 | ]], 36 | [[ 37 | #if POLARSSL_VERSION_NUMBER < 0x01020500 38 | #error invalid version 39 | #endif 40 | ]] 41 | )], 42 | [AC_MSG_RESULT([ok])], 43 | [AC_MSG_ERROR([PolarSSL 1.2.5 or newer required])] 44 | ) 45 | ]) 46 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/m4/zlib.m4: -------------------------------------------------------------------------------- 1 | dnl Check to find the zlib headers/libraries 2 | 3 | AC_DEFUN([ss_ZLIB], 4 | [ 5 | AC_ARG_ENABLE([zlib], 6 | AS_HELP_STRING([--disable-zlib], [disable zlib compression support])) 7 | AS_IF([test "x$enable_zlib" != "xno"], [ 8 | AC_DEFINE(HAVE_ZLIB, 1, [have zlib compression support]) 9 | AC_ARG_WITH(zlib, 10 | AS_HELP_STRING([--with-zlib=DIR], [zlib base directory, or:]), 11 | [zlib="$withval" 12 | CPPFLAGS="$CPPFLAGS -I$withval/include" 13 | LDFLAGS="$LDFLAGS -L$withval/lib"] 14 | ) 15 | 16 | AC_ARG_WITH(zlib-include, 17 | AS_HELP_STRING([--with-zlib-include=DIR], [zlib headers directory]), 18 | [zlib_include="$withval" 19 | CPPFLAGS="$CPPFLAGS -I$withval"] 20 | ) 21 | 22 | AC_ARG_WITH(zlib-lib, 23 | AS_HELP_STRING([--with-zlib-lib=DIR], [zlib library directory]), 24 | [zlib_lib="$withval" 25 | LDFLAGS="$LDFLAGS -L$withval"] 26 | ) 27 | 28 | AC_CHECK_HEADERS(zlib.h, 29 | [], 30 | [AC_MSG_ERROR("zlib header files not found."); break] 31 | ) 32 | 33 | AC_CHECK_LIB(z, compress2, 34 | [LIBS="$LIBS -lz"], 35 | [AC_MSG_ERROR("zlib libraries not found.")] 36 | ) 37 | ]) 38 | ]) 39 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/openwrt/files/shadowsocks.init: -------------------------------------------------------------------------------- 1 | #!/bin/sh /etc/rc.common 2 | # Copyright (C) 2006-2011 OpenWrt.org 3 | 4 | START=95 5 | 6 | SERVICE_USE_PID=1 7 | SERVICE_WRITE_PID=1 8 | SERVICE_DAEMONIZE=1 9 | 10 | start() { 11 | service_start /usr/bin/ss-local -b 0.0.0.0 -c /etc/shadowsocks.json 12 | } 13 | 14 | stop() { 15 | service_stop /usr/bin/ss-local 16 | } 17 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/openwrt/files/shadowsocks.json: -------------------------------------------------------------------------------- 1 | { 2 | "server":"127.0.0.1", 3 | "server_port":8388, 4 | "local_port":1080, 5 | "password":"barfoo!", 6 | "timeout":60, 7 | "method":null 8 | } 9 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/shadowsocks-libev.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: shadowsocks-libev 7 | Description: a lightweight secured socks5 proxy 8 | URL: http://shadowsocks.org 9 | Version: @VERSION@ 10 | Requires: 11 | Cflags: -I${includedir} 12 | Libs: -L${libdir} -lshadowsocks-libev -lcrypto 13 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/src/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qman9501/ShadowPath/51942d6b4cbacc056a33993a3aa4eb0db6afcd94/ShadowPath/shadowsocks-libev/src/.DS_Store -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/src/includeobfs.h: -------------------------------------------------------------------------------- 1 | #ifndef _INCLUDEOBFSOBFS_H 2 | #define _INCLUDEOBFSOBFS_H 3 | 4 | #include "obfs/auth_chain.h" 5 | #include "obfs/auth.h" 6 | #include "obfs/tls1.2_ticket.h" 7 | #include "obfs/verify.h" 8 | #include "obfs/http_simple.h" 9 | #include "obfs/obfsutil.h" 10 | #include "obfs/base64.h" 11 | #include "obfs/crc32.h" 12 | #include "obfs/obfs.h" 13 | 14 | #endif // _INCLUDEOBFSOBFS_H 15 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/src/obfs/auth_chain.h: -------------------------------------------------------------------------------- 1 | /* 2 | * auth.h - Define shadowsocksR server's buffers and callbacks 3 | * 4 | * Copyright (C) 2015 - 2016, Break Wa11 5 | */ 6 | 7 | #ifndef _OBFS_AUTH_CHAIN_H 8 | #define _OBFS_AUTH_CHAIN_H 9 | 10 | #include "obfs.h" 11 | 12 | void * auth_chain_a_init_data(); 13 | obfs * auth_chain_a_new_obfs(); 14 | void auth_chain_a_dispose(obfs *self); 15 | 16 | 17 | int auth_chain_a_client_pre_encrypt(obfs *self, char **pplaindata, int datalength, size_t* capacity); 18 | int auth_chain_a_client_post_decrypt(obfs *self, char **pplaindata, int datalength, size_t* capacity); 19 | 20 | int auth_chain_a_client_udp_pre_encrypt(obfs *self, char **pplaindata, int datalength, size_t* capacity); 21 | int auth_chain_a_client_udp_post_decrypt(obfs *self, char **pplaindata, int datalength, size_t* capacity); 22 | 23 | int auth_chain_a_get_overhead(obfs *self); 24 | #endif // _OBFS_AUTH_CHAIN_H 25 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/src/obfs/base64.h: -------------------------------------------------------------------------------- 1 | #ifndef _OBFS_BASE64_H 2 | #define _OBFS_BASE64_H 3 | 4 | enum {BASE64_OK = 0, BASE64_INVALID}; 5 | 6 | #define BASE64_ENCODE_OUT_SIZE(s) (((s) + 2) / 3 * 4) 7 | #define BASE64_DECODE_OUT_SIZE(s) (((s)) / 4 * 3) 8 | 9 | int 10 | base64_encode(const unsigned char *in, unsigned int inlen, char *out); 11 | 12 | int 13 | base64_decode(const char *in, unsigned int inlen, unsigned char *out); 14 | 15 | 16 | #endif // _OBFS_BASE64_H 17 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/src/obfs/crc32.h: -------------------------------------------------------------------------------- 1 | #ifndef _OBFS_CRC32_H 2 | #define _OBFS_CRC32_H 3 | 4 | void init_crc32_table(void); 5 | 6 | uint32_t crc32(unsigned char *buffer, unsigned int size); 7 | 8 | void fillcrc32to(unsigned char *buffer, unsigned int size, unsigned char *outbuffer); 9 | 10 | void fillcrc32(unsigned char *buffer, unsigned int size); 11 | 12 | void filladler32(unsigned char *buffer, unsigned int size); 13 | 14 | int checkadler32(unsigned char *buffer, unsigned int size); 15 | 16 | #endif // _OBFS_CRC32_H 17 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/src/obfs/http_simple.h: -------------------------------------------------------------------------------- 1 | /* 2 | * http_simple.h - Define shadowsocksR server's buffers and callbacks 3 | * 4 | * Copyright (C) 2015 - 2016, Break Wa11 5 | */ 6 | 7 | #ifndef _OBFS_HTTP_SIMPLE_H 8 | #define _OBFS_HTTP_SIMPLE_H 9 | 10 | #include "obfs.h" 11 | 12 | obfs * http_simple_new_obfs(); 13 | void http_simple_dispose(obfs *self); 14 | 15 | int http_simple_client_encode(obfs *self, char **pencryptdata, int datalength, size_t* capacity); 16 | int http_simple_client_decode(obfs *self, char **pencryptdata, int datalength, size_t* capacity, int *needsendback); 17 | 18 | int http_post_client_encode(obfs *self, char **pencryptdata, int datalength, size_t* capacity); 19 | 20 | #endif // _OBFS_HTTP_SIMPLE_H 21 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/src/obfs/obfsutil.h: -------------------------------------------------------------------------------- 1 | #ifndef _OBFS_OBFSUTIL_H 2 | #define _OBFS_OBFSUTIL_H 3 | 4 | int get_head_size(char *plaindata, int size, int def_size); 5 | 6 | void init_shift128plus(void); 7 | 8 | uint64_t xorshift128plus(void); 9 | 10 | int ss_md5_hmac(char *auth, char *msg, int msg_len, uint8_t *iv, int enc_iv_len, uint8_t *enc_key, int enc_key_len); 11 | 12 | int ss_sha1_hmac(char *auth, char *msg, int msg_len, uint8_t *iv, int enc_iv_len, uint8_t *enc_key, int enc_key_len); 13 | 14 | void memintcopy_lt(void *mem, uint32_t val); 15 | 16 | #endif // _OBFS_OBFSUTIL_H 17 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/src/obfs/tls1.2_ticket.h: -------------------------------------------------------------------------------- 1 | /* 2 | * tls1.2_ticket.h - Define shadowsocksR server's buffers and callbacks 3 | * 4 | * Copyright (C) 2015 - 2017, Break Wa11 5 | */ 6 | 7 | #ifndef _OBFS_TLS1_2_TICKET_H 8 | #define _OBFS_TLS1_2_TICKET_H 9 | 10 | #include "obfs.h" 11 | 12 | void * tls12_ticket_auth_init_data(); 13 | obfs * tls12_ticket_auth_new_obfs(); 14 | void tls12_ticket_auth_dispose(obfs *self); 15 | 16 | int tls12_ticket_auth_client_encode(obfs *self, char **pencryptdata, int datalength, size_t* capacity); 17 | int tls12_ticket_auth_client_decode(obfs *self, char **pencryptdata, int datalength, size_t* capacity, int *needsendback); 18 | 19 | int tls12_ticket_auth_get_overhead(obfs *self); 20 | #endif // _OBFS_TLS1_2_TICKET_H 21 | -------------------------------------------------------------------------------- /ShadowPath/shadowsocks-libev/src/obfs/verify.h: -------------------------------------------------------------------------------- 1 | /* 2 | * verify.h - Define shadowsocksR server's buffers and callbacks 3 | * 4 | * Copyright (C) 2015 - 2016, Break Wa11 5 | */ 6 | 7 | #ifndef _OBFS_VERIFY_H 8 | #define _OBFS_VERIFY_H 9 | 10 | #include "obfs.h" 11 | 12 | obfs * verify_simple_new_obfs(); 13 | void verify_simple_dispose(obfs *self); 14 | 15 | int verify_simple_client_pre_encrypt(obfs *self, char **pplaindata, int datalength, size_t* capacity); 16 | int verify_simple_client_post_decrypt(obfs *self, char **pplaindata, int datalength, size_t* capacity); 17 | 18 | #endif // _OBFS_VERIFY_H 19 | -------------------------------------------------------------------------------- /ShadowPathDemo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // ShadowPathDemo 4 | // 5 | // Created by LEI on 5/17/16. 6 | // Copyright © 2016 TouchingApp. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /ShadowPathDemo/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /ShadowPathDemo/Supporting Files/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // ShadowPathDemo 4 | // 5 | // Created by LEI on 5/17/16. 6 | // Copyright © 2016 TouchingApp. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /ShadowPathDemo/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // ShadowPathDemo 4 | // 5 | // Created by LEI on 5/17/16. 6 | // Copyright © 2016 TouchingApp. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /ShadowPathDemo/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // ShadowPathDemo 4 | // 5 | // Created by LEI on 5/17/16. 6 | // Copyright © 2016 TouchingApp. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "ShadowPath.h" 11 | 12 | @interface ViewController () 13 | 14 | @end 15 | 16 | @implementation ViewController 17 | 18 | - (void)viewDidLoad { 19 | [super viewDidLoad]; 20 | // Do any additional setup after loading the view, typically from a nib. 21 | // char *path = strdup([[[NSBundle mainBundle] pathForResource:@"config" ofType:@""] UTF8String]); 22 | // shadowpath_main(path); 23 | profile_t t; 24 | start_ss_local_server(t); 25 | } 26 | 27 | - (void)didReceiveMemoryWarning { 28 | [super didReceiveMemoryWarning]; 29 | // Dispose of any resources that can be recreated. 30 | } 31 | 32 | @end 33 | --------------------------------------------------------------------------------