From 054f563b0a82c8f7700b32eddc0b1e23373a42f5 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Mon, 21 Mar 2016 21:00:56 +0100 Subject: [PATCH] Add the script to generate the emscripten symbols --- dist-build/emscripten-symbols.def | 372 ++++++++++++++++++++++ dist-build/generate-emscripten-symbols.sh | 43 +++ 2 files changed, 415 insertions(+) create mode 100644 dist-build/emscripten-symbols.def create mode 100755 dist-build/generate-emscripten-symbols.sh diff --git a/dist-build/emscripten-symbols.def b/dist-build/emscripten-symbols.def new file mode 100644 index 00000000..44a0a84a --- /dev/null +++ b/dist-build/emscripten-symbols.def @@ -0,0 +1,372 @@ +_crypto_aead_aes256gcm_abytes 0 0 +_crypto_aead_aes256gcm_beforenm 0 0 +_crypto_aead_aes256gcm_decrypt 0 0 +_crypto_aead_aes256gcm_decrypt_afternm 0 0 +_crypto_aead_aes256gcm_decrypt_detached 0 0 +_crypto_aead_aes256gcm_decrypt_detached_afternm 0 0 +_crypto_aead_aes256gcm_encrypt 0 0 +_crypto_aead_aes256gcm_encrypt_afternm 0 0 +_crypto_aead_aes256gcm_encrypt_detached 0 0 +_crypto_aead_aes256gcm_encrypt_detached_afternm 0 0 +_crypto_aead_aes256gcm_is_available 0 0 +_crypto_aead_aes256gcm_keybytes 0 0 +_crypto_aead_aes256gcm_npubbytes 0 0 +_crypto_aead_aes256gcm_nsecbytes 0 0 +_crypto_aead_aes256gcm_statebytes 0 0 +_crypto_aead_chacha20poly1305_abytes 1 1 +_crypto_aead_chacha20poly1305_decrypt 1 1 +_crypto_aead_chacha20poly1305_decrypt_detached 1 1 +_crypto_aead_chacha20poly1305_encrypt 1 1 +_crypto_aead_chacha20poly1305_encrypt_detached 1 1 +_crypto_aead_chacha20poly1305_ietf_abytes 1 1 +_crypto_aead_chacha20poly1305_ietf_decrypt 1 1 +_crypto_aead_chacha20poly1305_ietf_decrypt_detached 1 1 +_crypto_aead_chacha20poly1305_ietf_encrypt 1 1 +_crypto_aead_chacha20poly1305_ietf_encrypt_detached 1 1 +_crypto_aead_chacha20poly1305_ietf_keybytes 1 1 +_crypto_aead_chacha20poly1305_ietf_npubbytes 1 1 +_crypto_aead_chacha20poly1305_ietf_nsecbytes 1 1 +_crypto_aead_chacha20poly1305_keybytes 1 1 +_crypto_aead_chacha20poly1305_npubbytes 1 1 +_crypto_aead_chacha20poly1305_nsecbytes 1 1 +_crypto_auth 1 1 +_crypto_auth_bytes 1 1 +_crypto_auth_hmacsha256 0 1 +_crypto_auth_hmacsha256_bytes 0 1 +_crypto_auth_hmacsha256_final 0 1 +_crypto_auth_hmacsha256_init 0 1 +_crypto_auth_hmacsha256_keybytes 0 1 +_crypto_auth_hmacsha256_statebytes 0 1 +_crypto_auth_hmacsha256_update 0 1 +_crypto_auth_hmacsha256_verify 0 1 +_crypto_auth_hmacsha512 0 1 +_crypto_auth_hmacsha512256 0 1 +_crypto_auth_hmacsha512256_bytes 0 1 +_crypto_auth_hmacsha512256_final 0 1 +_crypto_auth_hmacsha512256_init 0 1 +_crypto_auth_hmacsha512256_keybytes 0 1 +_crypto_auth_hmacsha512256_statebytes 0 1 +_crypto_auth_hmacsha512256_update 0 1 +_crypto_auth_hmacsha512256_verify 0 1 +_crypto_auth_hmacsha512_bytes 0 1 +_crypto_auth_hmacsha512_final 0 1 +_crypto_auth_hmacsha512_init 0 1 +_crypto_auth_hmacsha512_keybytes 0 1 +_crypto_auth_hmacsha512_statebytes 0 1 +_crypto_auth_hmacsha512_update 0 1 +_crypto_auth_hmacsha512_verify 0 1 +_crypto_auth_keybytes 1 1 +_crypto_auth_primitive 0 0 +_crypto_auth_verify 1 1 +_crypto_box 0 1 +_crypto_box_afternm 0 1 +_crypto_box_beforenm 1 1 +_crypto_box_beforenmbytes 1 1 +_crypto_box_boxzerobytes 0 1 +_crypto_box_curve25519xsalsa20poly1305 0 1 +_crypto_box_curve25519xsalsa20poly1305_afternm 0 1 +_crypto_box_curve25519xsalsa20poly1305_beforenm 0 1 +_crypto_box_curve25519xsalsa20poly1305_beforenmbytes 0 1 +_crypto_box_curve25519xsalsa20poly1305_boxzerobytes 0 1 +_crypto_box_curve25519xsalsa20poly1305_keypair 0 1 +_crypto_box_curve25519xsalsa20poly1305_macbytes 0 1 +_crypto_box_curve25519xsalsa20poly1305_noncebytes 0 1 +_crypto_box_curve25519xsalsa20poly1305_open 0 1 +_crypto_box_curve25519xsalsa20poly1305_open_afternm 0 1 +_crypto_box_curve25519xsalsa20poly1305_publickeybytes 0 1 +_crypto_box_curve25519xsalsa20poly1305_secretkeybytes 0 1 +_crypto_box_curve25519xsalsa20poly1305_seed_keypair 0 1 +_crypto_box_curve25519xsalsa20poly1305_seedbytes 0 1 +_crypto_box_curve25519xsalsa20poly1305_zerobytes 0 1 +_crypto_box_detached 1 1 +_crypto_box_detached_afternm 1 1 +_crypto_box_easy 1 1 +_crypto_box_easy_afternm 1 1 +_crypto_box_keypair 1 1 +_crypto_box_macbytes 1 1 +_crypto_box_noncebytes 1 1 +_crypto_box_open 0 1 +_crypto_box_open_afternm 0 1 +_crypto_box_open_detached 1 1 +_crypto_box_open_detached_afternm 1 1 +_crypto_box_open_easy 1 1 +_crypto_box_open_easy_afternm 1 1 +_crypto_box_primitive 0 1 +_crypto_box_publickeybytes 1 1 +_crypto_box_seal 1 1 +_crypto_box_seal_open 1 1 +_crypto_box_sealbytes 1 1 +_crypto_box_secretkeybytes 1 1 +_crypto_box_seed_keypair 1 1 +_crypto_box_seedbytes 1 1 +_crypto_box_zerobytes 0 1 +_crypto_core_hchacha20 1 1 +_crypto_core_hchacha20_constbytes 1 1 +_crypto_core_hchacha20_inputbytes 1 1 +_crypto_core_hchacha20_keybytes 1 1 +_crypto_core_hchacha20_outputbytes 1 1 +_crypto_core_hsalsa20 0 1 +_crypto_core_hsalsa20_constbytes 0 1 +_crypto_core_hsalsa20_inputbytes 0 1 +_crypto_core_hsalsa20_keybytes 0 1 +_crypto_core_hsalsa20_outputbytes 0 1 +_crypto_core_salsa20 0 1 +_crypto_core_salsa2012 0 1 +_crypto_core_salsa2012_constbytes 0 1 +_crypto_core_salsa2012_inputbytes 0 1 +_crypto_core_salsa2012_keybytes 0 1 +_crypto_core_salsa2012_outputbytes 0 1 +_crypto_core_salsa208 0 1 +_crypto_core_salsa208_constbytes 0 1 +_crypto_core_salsa208_inputbytes 0 1 +_crypto_core_salsa208_keybytes 0 1 +_crypto_core_salsa208_outputbytes 0 1 +_crypto_core_salsa20_constbytes 0 1 +_crypto_core_salsa20_inputbytes 0 1 +_crypto_core_salsa20_keybytes 0 1 +_crypto_core_salsa20_outputbytes 0 1 +_crypto_generichash 1 1 +_crypto_generichash_blake2b 0 1 +_crypto_generichash_blake2b_bytes 0 1 +_crypto_generichash_blake2b_bytes_max 0 1 +_crypto_generichash_blake2b_bytes_min 0 1 +_crypto_generichash_blake2b_final 0 1 +_crypto_generichash_blake2b_init 0 1 +_crypto_generichash_blake2b_init_salt_personal 0 1 +_crypto_generichash_blake2b_keybytes 0 1 +_crypto_generichash_blake2b_keybytes_max 0 1 +_crypto_generichash_blake2b_keybytes_min 0 1 +_crypto_generichash_blake2b_personalbytes 0 1 +_crypto_generichash_blake2b_salt_personal 0 1 +_crypto_generichash_blake2b_saltbytes 0 1 +_crypto_generichash_blake2b_statebytes 0 1 +_crypto_generichash_blake2b_update 0 1 +_crypto_generichash_bytes 1 1 +_crypto_generichash_bytes_max 1 1 +_crypto_generichash_bytes_min 1 1 +_crypto_generichash_final 1 1 +_crypto_generichash_init 1 1 +_crypto_generichash_keybytes 1 1 +_crypto_generichash_keybytes_max 1 1 +_crypto_generichash_keybytes_min 1 1 +_crypto_generichash_primitive 1 1 +_crypto_generichash_statebytes 1 1 +_crypto_generichash_update 1 1 +_crypto_hash 1 1 +_crypto_hash_bytes 1 1 +_crypto_hash_primitive 0 1 +_crypto_hash_sha256 0 1 +_crypto_hash_sha256_bytes 0 1 +_crypto_hash_sha256_final 0 1 +_crypto_hash_sha256_init 0 1 +_crypto_hash_sha256_statebytes 0 1 +_crypto_hash_sha256_update 0 1 +_crypto_hash_sha512 0 1 +_crypto_hash_sha512_bytes 0 1 +_crypto_hash_sha512_final 0 1 +_crypto_hash_sha512_init 0 1 +_crypto_hash_sha512_statebytes 0 1 +_crypto_hash_sha512_update 0 1 +_crypto_onetimeauth 0 1 +_crypto_onetimeauth_bytes 0 1 +_crypto_onetimeauth_final 0 1 +_crypto_onetimeauth_init 0 1 +_crypto_onetimeauth_keybytes 0 1 +_crypto_onetimeauth_poly1305 0 1 +_crypto_onetimeauth_poly1305_bytes 0 1 +_crypto_onetimeauth_poly1305_final 0 1 +_crypto_onetimeauth_poly1305_init 0 1 +_crypto_onetimeauth_poly1305_keybytes 0 1 +_crypto_onetimeauth_poly1305_update 0 1 +_crypto_onetimeauth_poly1305_verify 0 1 +_crypto_onetimeauth_primitive 0 1 +_crypto_onetimeauth_statebytes 0 1 +_crypto_onetimeauth_update 0 1 +_crypto_onetimeauth_verify 0 1 +_crypto_pwhash 1 1 +_crypto_pwhash_argon2i 0 1 +_crypto_pwhash_argon2i_memlimit_interactive 0 1 +_crypto_pwhash_argon2i_memlimit_moderate 0 1 +_crypto_pwhash_argon2i_memlimit_sensitive 0 1 +_crypto_pwhash_argon2i_opslimit_interactive 0 1 +_crypto_pwhash_argon2i_opslimit_moderate 0 1 +_crypto_pwhash_argon2i_opslimit_sensitive 0 1 +_crypto_pwhash_argon2i_saltbytes 0 1 +_crypto_pwhash_argon2i_str 0 1 +_crypto_pwhash_argon2i_str_verify 0 1 +_crypto_pwhash_argon2i_strbytes 0 1 +_crypto_pwhash_argon2i_strprefix 0 1 +_crypto_pwhash_memlimit_interactive 1 1 +_crypto_pwhash_memlimit_moderate 1 1 +_crypto_pwhash_memlimit_sensitive 1 1 +_crypto_pwhash_opslimit_interactive 1 1 +_crypto_pwhash_opslimit_moderate 1 1 +_crypto_pwhash_opslimit_sensitive 1 1 +_crypto_pwhash_primitive 0 1 +_crypto_pwhash_saltbytes 1 1 +_crypto_pwhash_scryptsalsa208sha256 1 1 +_crypto_pwhash_scryptsalsa208sha256_ll 1 1 +_crypto_pwhash_scryptsalsa208sha256_memlimit_interactive 1 1 +_crypto_pwhash_scryptsalsa208sha256_memlimit_sensitive 1 1 +_crypto_pwhash_scryptsalsa208sha256_opslimit_interactive 1 1 +_crypto_pwhash_scryptsalsa208sha256_opslimit_sensitive 1 1 +_crypto_pwhash_scryptsalsa208sha256_saltbytes 1 1 +_crypto_pwhash_scryptsalsa208sha256_str 1 1 +_crypto_pwhash_scryptsalsa208sha256_str_verify 1 1 +_crypto_pwhash_scryptsalsa208sha256_strbytes 1 1 +_crypto_pwhash_scryptsalsa208sha256_strprefix 1 1 +_crypto_pwhash_str 1 1 +_crypto_pwhash_str_verify 1 1 +_crypto_pwhash_strbytes 1 1 +_crypto_pwhash_strprefix 1 1 +_crypto_scalarmult 1 1 +_crypto_scalarmult_base 1 1 +_crypto_scalarmult_bytes 1 1 +_crypto_scalarmult_curve25519 0 1 +_crypto_scalarmult_curve25519_base 0 1 +_crypto_scalarmult_curve25519_bytes 0 1 +_crypto_scalarmult_curve25519_sandy2x_fe51_mul 0 0 +_crypto_scalarmult_curve25519_sandy2x_fe51_nsquare 0 0 +_crypto_scalarmult_curve25519_sandy2x_fe51_pack 0 0 +_crypto_scalarmult_curve25519_sandy2x_ladder 0 0 +_crypto_scalarmult_curve25519_sandy2x_ladder_base 0 0 +_crypto_scalarmult_curve25519_scalarbytes 0 1 +_crypto_scalarmult_primitive 0 1 +_crypto_scalarmult_scalarbytes 1 1 +_crypto_secretbox 0 1 +_crypto_secretbox_boxzerobytes 0 1 +_crypto_secretbox_detached 1 1 +_crypto_secretbox_easy 1 1 +_crypto_secretbox_keybytes 1 1 +_crypto_secretbox_macbytes 1 1 +_crypto_secretbox_noncebytes 1 1 +_crypto_secretbox_open 0 1 +_crypto_secretbox_open_detached 1 1 +_crypto_secretbox_open_easy 1 1 +_crypto_secretbox_primitive 0 1 +_crypto_secretbox_xsalsa20poly1305 0 1 +_crypto_secretbox_xsalsa20poly1305_boxzerobytes 0 1 +_crypto_secretbox_xsalsa20poly1305_keybytes 0 1 +_crypto_secretbox_xsalsa20poly1305_macbytes 0 1 +_crypto_secretbox_xsalsa20poly1305_noncebytes 0 1 +_crypto_secretbox_xsalsa20poly1305_open 0 1 +_crypto_secretbox_xsalsa20poly1305_zerobytes 0 1 +_crypto_secretbox_zerobytes 0 1 +_crypto_shorthash 1 1 +_crypto_shorthash_bytes 1 1 +_crypto_shorthash_keybytes 1 1 +_crypto_shorthash_primitive 0 1 +_crypto_shorthash_siphash24 0 1 +_crypto_shorthash_siphash24_bytes 0 1 +_crypto_shorthash_siphash24_keybytes 0 1 +_crypto_sign 1 1 +_crypto_sign_bytes 1 1 +_crypto_sign_detached 1 1 +_crypto_sign_ed25519 0 1 +_crypto_sign_ed25519_bytes 0 1 +_crypto_sign_ed25519_detached 0 1 +_crypto_sign_ed25519_keypair 0 1 +_crypto_sign_ed25519_open 0 1 +_crypto_sign_ed25519_pk_to_curve25519 1 1 +_crypto_sign_ed25519_publickeybytes 0 1 +_crypto_sign_ed25519_secretkeybytes 0 1 +_crypto_sign_ed25519_seed_keypair 0 1 +_crypto_sign_ed25519_seedbytes 0 1 +_crypto_sign_ed25519_sk_to_curve25519 1 1 +_crypto_sign_ed25519_sk_to_pk 0 1 +_crypto_sign_ed25519_sk_to_seed 0 1 +_crypto_sign_ed25519_verify_detached 0 1 +_crypto_sign_edwards25519sha512batch 0 0 +_crypto_sign_edwards25519sha512batch_keypair 0 0 +_crypto_sign_edwards25519sha512batch_open 0 0 +_crypto_sign_keypair 1 1 +_crypto_sign_open 1 1 +_crypto_sign_primitive 0 1 +_crypto_sign_publickeybytes 1 1 +_crypto_sign_secretkeybytes 1 1 +_crypto_sign_seed_keypair 1 1 +_crypto_sign_seedbytes 1 1 +_crypto_sign_verify_detached 1 1 +_crypto_stream 0 1 +_crypto_stream_aes128ctr 0 1 +_crypto_stream_aes128ctr_afternm 0 1 +_crypto_stream_aes128ctr_beforenm 0 1 +_crypto_stream_aes128ctr_beforenmbytes 0 1 +_crypto_stream_aes128ctr_keybytes 0 1 +_crypto_stream_aes128ctr_noncebytes 0 1 +_crypto_stream_aes128ctr_xor 0 1 +_crypto_stream_aes128ctr_xor_afternm 0 1 +_crypto_stream_chacha20 0 1 +_crypto_stream_chacha20_ietf 0 1 +_crypto_stream_chacha20_ietf_noncebytes 0 1 +_crypto_stream_chacha20_ietf_xor 0 1 +_crypto_stream_chacha20_ietf_xor_ic 0 1 +_crypto_stream_chacha20_keybytes 0 1 +_crypto_stream_chacha20_noncebytes 0 1 +_crypto_stream_chacha20_xor 0 1 +_crypto_stream_chacha20_xor_ic 0 1 +_crypto_stream_keybytes 0 1 +_crypto_stream_noncebytes 0 1 +_crypto_stream_primitive 0 1 +_crypto_stream_salsa20 0 1 +_crypto_stream_salsa2012 0 1 +_crypto_stream_salsa2012_keybytes 0 1 +_crypto_stream_salsa2012_noncebytes 0 1 +_crypto_stream_salsa2012_xor 0 1 +_crypto_stream_salsa208 0 1 +_crypto_stream_salsa208_keybytes 0 1 +_crypto_stream_salsa208_noncebytes 0 1 +_crypto_stream_salsa208_xor 0 1 +_crypto_stream_salsa20_keybytes 0 1 +_crypto_stream_salsa20_noncebytes 0 1 +_crypto_stream_salsa20_xor 0 1 +_crypto_stream_salsa20_xor_ic 0 1 +_crypto_stream_xor 0 1 +_crypto_stream_xsalsa20 0 1 +_crypto_stream_xsalsa20_keybytes 0 1 +_crypto_stream_xsalsa20_noncebytes 0 1 +_crypto_stream_xsalsa20_xor 0 1 +_crypto_stream_xsalsa20_xor_ic 0 1 +_crypto_verify_16 0 1 +_crypto_verify_16_bytes 0 1 +_crypto_verify_32 0 1 +_crypto_verify_32_bytes 0 1 +_crypto_verify_64 0 1 +_crypto_verify_64_bytes 0 1 +_randombytes 1 1 +_randombytes_buf 1 1 +_randombytes_close 1 1 +_randombytes_implementation_name 0 1 +_randombytes_random 1 1 +_randombytes_set_implementation 0 0 +_randombytes_stir 1 1 +_randombytes_uniform 1 1 +_sodium_add 0 0 +_sodium_allocarray 0 0 +_sodium_bin2hex 1 1 +_sodium_compare 0 0 +_sodium_free 0 0 +_sodium_hex2bin 1 1 +_sodium_increment 0 0 +_sodium_init 1 1 +_sodium_is_zero 0 0 +_sodium_library_version_major 1 1 +_sodium_library_version_minor 1 1 +_sodium_malloc 0 0 +_sodium_memcmp 0 0 +_sodium_memzero 0 0 +_sodium_mlock 0 0 +_sodium_mprotect_noaccess 0 0 +_sodium_mprotect_readonly 0 0 +_sodium_mprotect_readwrite 0 0 +_sodium_munlock 0 0 +_sodium_runtime_has_aesni 0 0 +_sodium_runtime_has_avx 0 0 +_sodium_runtime_has_avx2 0 0 +_sodium_runtime_has_neon 0 0 +_sodium_runtime_has_pclmul 0 0 +_sodium_runtime_has_sse2 0 0 +_sodium_runtime_has_sse3 0 0 +_sodium_runtime_has_sse41 0 0 +_sodium_runtime_has_ssse3 0 0 +_sodium_version_string 1 1 diff --git a/dist-build/generate-emscripten-symbols.sh b/dist-build/generate-emscripten-symbols.sh new file mode 100755 index 00000000..b81556d2 --- /dev/null +++ b/dist-build/generate-emscripten-symbols.sh @@ -0,0 +1,43 @@ +#! /bin/sh + +if [ "x$1" = "x--sumo" ]; then + SUMO=yes +fi + +{ +while read symbol standard sumo; do + found="$standard" + if [ "x$SUMO" != "x" ]; then + found="$sumo" + fi + if [ "$found" = "1" ]; then + eval "defined_${symbol}=yes" + else + eval "defined_${symbol}=no" + fi +done < emscripten-symbols.def + +nm /usr/local/lib/libsodium.18.dylib | \ +fgrep ' T _' | \ +cut -d' ' -f3 | { + while read symbol; do + eval "found=\$defined_${symbol}" + if [ "$found" = "yes" ]; then + echo "$symbol" + elif [ "$found" != "no" ]; then + echo >&2 + echo "*** [$symbol] was not expected ***" >&2 + echo >&2 + exit 1 + fi + done + } +} | \ +sort | \ +{ +out='' +while read symbol ; do + out="${out},\"${symbol}\"" +done +echo $out +}