From 0d14720a2bf8ff49955b0fce2b2e4040bf194e5f Mon Sep 17 00:00:00 2001 From: Ugljesa Jovanovic Date: Mon, 12 Oct 2020 20:04:18 +0200 Subject: [PATCH] Update implemented list --- libsodium_js_debug_list.txt | 395 ------------------------------------ supported_bindings_list.md | 30 ++- 2 files changed, 20 insertions(+), 405 deletions(-) delete mode 100644 libsodium_js_debug_list.txt diff --git a/libsodium_js_debug_list.txt b/libsodium_js_debug_list.txt deleted file mode 100644 index 01d4ff7..0000000 --- a/libsodium_js_debug_list.txt +++ /dev/null @@ -1,395 +0,0 @@ -add = function(e,t){if(!(e instanceof Uint8Array&&t instanceof Uint8Array))throw new TypeError("Only Uint8Array instances can added");var r=e.length,a=0,_=0;if(t.length!=e.length)throw new TypeError("Arguments must have the same length");for(_=0;_>=8,a+=e[_]+t[_],e[_]=255&a} -base64_variants = Object {ORIGINAL: 1, -ORIGINAL_NO_PADDING: 3, -URLSAFE: 5, -URLSAFE_NO_PADDING: 7} -compare = function(e,t){if(!(e instanceof Uint8Array&&t instanceof Uint8Array))throw new TypeError("Only Uint8Array instances can be compared");if(e.length!==t.length)throw new TypeError("Only instances of identical length can be compared");for(var r=0,a=1,_=e.length;_-- >0;)r|=t[_]-e[_]>>8&a,a&=(t[_]^e[_])-1>>8;return r+r+a-1} -from_base64 = function(e,t){t=o(t);var a,_=[],n=new l(3*(e=m(_,e,"input")).length/4),s=u(e),c=d(4),h=d(4);return _.push(s),_.push(n.address),_.push(n.result_bin_len_p),_.push(n.b64_end_p),0!==r._sodium_base642bin(n.address,n.length,s,e.length,0,c,h,t)&&g(_,"invalid input"),r.getValue(h,"i32")-s!==e.length&&g(_,"incomplete input"),n.length=r.getValue(c,"i32"),a=n.to_Uint8Array(),v(_),a} -from_hex = function(e){var t,a=[],_=new l((e=m(a,e,"input")).length/2),n=u(e),s=d(4);return a.push(n),a.push(_.address),a.push(_.hex_end_p),0!==r._sodium_hex2bin(_.address,_.length,n,e.length,0,0,s)&&g(a,"invalid input"),r.getValue(s,"i32")-n!==e.length&&g(a,"incomplete input"),t=_.to_Uint8Array(),v(a),t} -from_string = function _(e){if("function"==typeof TextEncoder)return(new TextEncoder).encode(e);e=unescape(encodeURIComponent(e));for(var t=new Uint8Array(e.length),r=0,a=e.length;r>=8,t+=e[r],e[r]=255&t} -is_zero = function(e){if(!(e instanceof Uint8Array))throw new TypeError("Only Uint8Array instances can be checked");for(var t=0,r=0,a=e.length;r 0");var a,_=[],n=d(4),s=1,c=0,o=0|e.length,h=new l(o+t);_.push(n),_.push(h.address);for(var p=h.address,y=h.address+o+t;p>>48|o>>>32|o>>>16|o))-1>>16);return 0!==r._sodium_pad(n,h.address,e.length,t,h.length)&&g(_,"internal error"),h.length=r.getValue(n,"i32"),a=h.to_Uint8Array(),v(_),a} -unpad = function(e,t){if(!(e instanceof Uint8Array))throw new TypeError("buffer must be a Uint8Array");if((t|=0)<=0)throw new Error("block size must be > 0");var a=[],_=u(e),n=d(4);return a.push(_),a.push(n),0!==r._sodium_unpad(n,_,e.length,t)&&g(a,"unsupported/invalid padding"),e=(e=new Uint8Array(e)).subarray(0,r.getValue(n,"i32")),v(a),e} -ready = Promise {[[PromiseStatus]]: "resolved", -[[PromiseValue]]: undefined} -symbols = function(){return Object.keys(e).sort()} -to_base64 = function h(e,t){t=o(t),e=m(_,e,"input");var a,_=[],s=0|Math.floor(e.length/3),c=e.length-3*s,h=4*s+(0!==c?0==(2&t)?4:2+(c>>>1):0),p=new l(h+1),y=u(e);return _.push(y),_.push(p.address),0===r._sodium_bin2base64(p.address,p.length,y,e.length,t)&&g(_,"conversion failed"),p.length=h,a=n(p.to_Uint8Array()),v(_),a} -to_hex = function s(e){e=m(null,e,"input");for(var t,r,a,_="",n=0;n>8&-39)<<8|87+(t=e[n]>>>4)+(t-10>>8&-39),_+=String.fromCharCode(255&a)+String.fromCharCode(a>>>8);return _} -to_string = function n(e){if("function"==typeof TextDecoder)return new TextDecoder("utf-8",{fatal:!0}).decode(e);var t=Math.ceil(e.length/8192);if(t<=1)try{return decodeURIComponent(escape(String.fromCharCode.apply(null,e)))}catch(e){throw new TypeError("The encoded data was not valid.")}for(var r="",a=0,_=0;_=240?(h=4,c=!0):p>=224?(h=3,c=!0):p>=192?(h=2,c=!0):p<128&&(h=1,c=!0)}while(!c);for(var y=h-(s.length-o),i=0;i>>24>>>8,o,y);var x=p(g,s);return v(c),x} -crypto_kdf_keygen = function Le(e){var t=[];i(e);var a=new l(0|r._crypto_kdf_keybytes()),_=a.address;t.push(_),r._crypto_kdf_keygen(_);var n=p(a,e);return v(t),n} -crypto_kx_client_session_keys = function Ue(e,t,a,_){var n=[];i(_),e=m(n,e,"clientPublicKey");var s,c=0|r._crypto_kx_publickeybytes();e.length!==c&&b(n,"invalid clientPublicKey length"),s=u(e),n.push(s),t=m(n,t,"clientSecretKey");var o,h=0|r._crypto_kx_secretkeybytes();t.length!==h&&b(n,"invalid clientSecretKey length"),o=u(t),n.push(o),a=m(n,a,"serverPublicKey");var y,d=0|r._crypto_kx_publickeybytes();a.length!==d&&b(n,"invalid serverPublicKey length"),y=u(a),n.push(y);var f=new l(0|r._crypto_kx_sessionkeybytes()),E=f.address;n.push(E);var x=new l(0|r._crypto_kx_sessionkeybytes()),k=x.address;if(n.push(k),0==(0|r._crypto_kx_client_session_keys(E,k,s,o,y))){var S=p({sharedRx:f,sharedTx:x},_);return v(n),S}g(n,"invalid usage")} -crypto_kx_keypair = function Oe(e){var t=[];i(e);var a=new l(0|r._crypto_kx_publickeybytes()),_=a.address;t.push(_);var n=new l(0|r._crypto_kx_secretkeybytes()),s=n.address;if(t.push(s),0==(0|r._crypto_kx_keypair(_,s))){var c={publicKey:p(a,e),privateKey:p(n,e),keyType:"x25519"};return v(t),c}g(t,"internal error")} -crypto_kx_seed_keypair = function Ce(e,t){var a=[];i(t),e=m(a,e,"seed");var _,n=0|r._crypto_kx_seedbytes();e.length!==n&&b(a,"invalid seed length"),_=u(e),a.push(_);var s=new l(0|r._crypto_kx_publickeybytes()),c=s.address;a.push(c);var o=new l(0|r._crypto_kx_secretkeybytes()),h=o.address;if(a.push(h),0==(0|r._crypto_kx_seed_keypair(c,h,_))){var y={publicKey:p(s,t),privateKey:p(o,t),keyType:"x25519"};return v(a),y}g(a,"internal error")} -crypto_kx_server_session_keys = function Re(e,t,a,_){var n=[];i(_),e=m(n,e,"serverPublicKey");var s,c=0|r._crypto_kx_publickeybytes();e.length!==c&&b(n,"invalid serverPublicKey length"),s=u(e),n.push(s),t=m(n,t,"serverSecretKey");var o,h=0|r._crypto_kx_secretkeybytes();t.length!==h&&b(n,"invalid serverSecretKey length"),o=u(t),n.push(o),a=m(n,a,"clientPublicKey");var y,d=0|r._crypto_kx_publickeybytes();a.length!==d&&b(n,"invalid clientPublicKey length"),y=u(a),n.push(y);var f=new l(0|r._crypto_kx_sessionkeybytes()),E=f.address;n.push(E);var x=new l(0|r._crypto_kx_sessionkeybytes()),k=x.address;if(n.push(k),0==(0|r._crypto_kx_server_session_keys(E,k,s,o,y))){var S=p({sharedRx:f,sharedTx:x},_);return v(n),S}g(n,"invalid usage")} -crypto_onetimeauth = function Pe(e,t,a){var _=[];i(a);var n=u(e=m(_,e,"message")),s=e.length;_.push(n),t=m(_,t,"key");var c,o=0|r._crypto_onetimeauth_keybytes();t.length!==o&&b(_,"invalid key length"),c=u(t),_.push(c);var h=new l(0|r._crypto_onetimeauth_bytes()),y=h.address;if(_.push(y),0==(0|r._crypto_onetimeauth(y,n,s,0,c))){var d=p(h,a);return v(_),d}g(_,"invalid usage")} -crypto_onetimeauth_final = function Ge(e,t){var a=[];i(t),f(a,e,"state_address");var _=new l(0|r._crypto_onetimeauth_bytes()),n=_.address;if(a.push(n),0==(0|r._crypto_onetimeauth_final(e,n))){var s=(r._free(e),p(_,t));return v(a),s}g(a,"invalid usage")} -crypto_onetimeauth_init = function Xe(e,t){var a=[];i(t);var _=null;null!=e&&(_=u(e=m(a,e,"key")),e.length,a.push(_));var n=new l(144).address;if(0==(0|r._crypto_onetimeauth_init(n,_))){var s=n;return v(a),s}g(a,"invalid usage")} -crypto_onetimeauth_keygen = function De(e){var t=[];i(e);var a=new l(0|r._crypto_onetimeauth_keybytes()),_=a.address;t.push(_),r._crypto_onetimeauth_keygen(_);var n=p(a,e);return v(t),n} -crypto_onetimeauth_update = function Fe(e,t,a){var _=[];i(a),f(_,e,"state_address");var n=u(t=m(_,t,"message_chunk")),s=t.length;_.push(n),0!=(0|r._crypto_onetimeauth_update(e,n,s))&&g(_,"invalid usage"),v(_)} -crypto_onetimeauth_verify = function Ve(e,t,a){var _=[];e=m(_,e,"hash");var n,s=0|r._crypto_onetimeauth_bytes();e.length!==s&&b(_,"invalid hash length"),n=u(e),_.push(n);var c=u(t=m(_,t,"message")),o=t.length;_.push(c),a=m(_,a,"key");var h,p=0|r._crypto_onetimeauth_keybytes();a.length!==p&&b(_,"invalid key length"),h=u(a),_.push(h);var y=0==(0|r._crypto_onetimeauth_verify(n,c,o,0,h));return v(_),y} -crypto_pwhash = function He(e,t,a,_,n,s,c){var o=[];i(c),f(o,e,"keyLength"),("number"!=typeof e||(0|e)!==e||e<0)&&b(o,"keyLength must be an unsigned integer");var h=u(t=m(o,t,"password")),y=t.length;o.push(h),a=m(o,a,"salt");var d,E=0|r._crypto_pwhash_saltbytes();a.length!==E&&b(o,"invalid salt length"),d=u(a),o.push(d),f(o,_,"opsLimit"),("number"!=typeof _||(0|_)!==_||_<0)&&b(o,"opsLimit must be an unsigned integer"),f(o,n,"memLimit"),("number"!=typeof n||(0|n)!==n||n<0)&&b(o,"memLimit must be an unsigned integer"),f(o,s,"algorithm"),("number"!=typeof s||(0|s)!==s||s<0)&&b(o,"algorithm must be an unsigned integer");var x=new l(0|e),k=x.address;if(o.push(k),0==(0|r._crypto_pwhash(k,e,0,h,y,0,d,_,0,n,s))){var S=p(x,c);return v(o),S}g(o,"invalid usage")} -crypto_pwhash_scryptsalsa208sha256 = function ze(e,t,a,_,n,s){var c=[];i(s),f(c,e,"keyLength"),("number"!=typeof e||(0|e)!==e||e<0)&&b(c,"keyLength must be an unsigned integer");var o=u(t=m(c,t,"password")),h=t.length;c.push(o),a=m(c,a,"salt");var y,d=0|r._crypto_pwhash_scryptsalsa208sha256_saltbytes();a.length!==d&&b(c,"invalid salt length"),y=u(a),c.push(y),f(c,_,"opsLimit"),("number"!=typeof _||(0|_)!==_||_<0)&&b(c,"opsLimit must be an unsigned integer"),f(c,n,"memLimit"),("number"!=typeof n||(0|n)!==n||n<0)&&b(c,"memLimit must be an unsigned integer");var E=new l(0|e),x=E.address;if(c.push(x),0==(0|r._crypto_pwhash_scryptsalsa208sha256(x,e,0,o,h,0,y,_,0,n))){var k=p(E,s);return v(c),k}g(c,"invalid usage")} -crypto_pwhash_scryptsalsa208sha256_ll = function je(e,t,a,_,n,s,c){var o=[];i(c);var h=u(e=m(o,e,"password")),y=e.length;o.push(h);var d=u(t=m(o,t,"salt")),E=t.length;o.push(d),f(o,a,"opsLimit"),("number"!=typeof a||(0|a)!==a||a<0)&&b(o,"opsLimit must be an unsigned integer"),f(o,_,"r"),("number"!=typeof _||(0|_)!==_||_<0)&&b(o,"r must be an unsigned integer"),f(o,n,"p"),("number"!=typeof n||(0|n)!==n||n<0)&&b(o,"p must be an unsigned integer"),f(o,s,"keyLength"),("number"!=typeof s||(0|s)!==s||s<0)&&b(o,"keyLength must be an unsigned integer");var x=new l(0|s),k=x.address;if(o.push(k),0==(0|r._crypto_pwhash_scryptsalsa208sha256_ll(h,y,d,E,a,0,_,n,k,s))){var S=p(x,c);return v(o),S}g(o,"invalid usage")} -crypto_pwhash_scryptsalsa208sha256_str = function qe(e,t,a,_){var n=[];i(_);var s=u(e=m(n,e,"password")),c=e.length;n.push(s),f(n,t,"opsLimit"),("number"!=typeof t||(0|t)!==t||t<0)&&b(n,"opsLimit must be an unsigned integer"),f(n,a,"memLimit"),("number"!=typeof a||(0|a)!==a||a<0)&&b(n,"memLimit must be an unsigned integer");var o=new l(0|r._crypto_pwhash_scryptsalsa208sha256_strbytes()).address;if(n.push(o),0==(0|r._crypto_pwhash_scryptsalsa208sha256_str(o,s,c,0,t,0,a))){var h=r.UTF8ToString(o);return v(n),h}g(n,"invalid usage")} -crypto_pwhash_scryptsalsa208sha256_str_verify = function We(e,t,a){var n=[];i(a),"string"!=typeof e&&b(n,"hashed_password must be a string"),e=_(e+"\0"),null!=c&&e.length-1!==c&&b(n,"invalid hashed_password length");var s=u(e),c=e.length-1;n.push(s);var o=u(t=m(n,t,"password")),h=t.length;n.push(o);var p=0==(0|r._crypto_pwhash_scryptsalsa208sha256_str_verify(s,o,h,0));return v(n),p} -crypto_pwhash_str = function Je(e,t,a,_){var n=[];i(_);var s=u(e=m(n,e,"password")),c=e.length;n.push(s),f(n,t,"opsLimit"),("number"!=typeof t||(0|t)!==t||t<0)&&b(n,"opsLimit must be an unsigned integer"),f(n,a,"memLimit"),("number"!=typeof a||(0|a)!==a||a<0)&&b(n,"memLimit must be an unsigned integer");var o=new l(0|r._crypto_pwhash_strbytes()).address;if(n.push(o),0==(0|r._crypto_pwhash_str(o,s,c,0,t,0,a))){var h=r.UTF8ToString(o);return v(n),h}g(n,"invalid usage")} -crypto_pwhash_str_needs_rehash = function Qe(e,t,a,n){var s=[];i(n),"string"!=typeof e&&b(s,"hashed_password must be a string"),e=_(e+"\0"),null!=o&&e.length-1!==o&&b(s,"invalid hashed_password length");var c=u(e),o=e.length-1;s.push(c),f(s,t,"opsLimit"),("number"!=typeof t||(0|t)!==t||t<0)&&b(s,"opsLimit must be an unsigned integer"),f(s,a,"memLimit"),("number"!=typeof a||(0|a)!==a||a<0)&&b(s,"memLimit must be an unsigned integer");var h=0!=(0|r._crypto_pwhash_str_needs_rehash(c,t,0,a));return v(s),h} -crypto_pwhash_str_verify = function Ze(e,t,a){var n=[];i(a),"string"!=typeof e&&b(n,"hashed_password must be a string"),e=_(e+"\0"),null!=c&&e.length-1!==c&&b(n,"invalid hashed_password length");var s=u(e),c=e.length-1;n.push(s);var o=u(t=m(n,t,"password")),h=t.length;n.push(o);var p=0==(0|r._crypto_pwhash_str_verify(s,o,h,0));return v(n),p} -crypto_scalarmult = function $e(e,t,a){var _=[];i(a),e=m(_,e,"privateKey");var n,s=0|r._crypto_scalarmult_scalarbytes();e.length!==s&&b(_,"invalid privateKey length"),n=u(e),_.push(n),t=m(_,t,"publicKey");var c,o=0|r._crypto_scalarmult_scalarbytes();t.length!==o&&b(_,"invalid publicKey length"),c=u(t),_.push(c);var h=new l(0|r._crypto_scalarmult_bytes()),y=h.address;if(_.push(y),0==(0|r._crypto_scalarmult(y,n,c))){var d=p(h,a);return v(_),d}g(_,"weak public key")} -crypto_scalarmult_base = function et(e,t){var a=[];i(t),e=m(a,e,"privateKey");var _,n=0|r._crypto_scalarmult_scalarbytes();e.length!==n&&b(a,"invalid privateKey length"),_=u(e),a.push(_);var s=new l(0|r._crypto_scalarmult_scalarbytes()),c=s.address;if(a.push(c),0==(0|r._crypto_scalarmult_base(c,_))){var o=p(s,t);return v(a),o}g(a,"insecure scalar")} -crypto_scalarmult_ristretto255 = function tt(e,t,a){var _=[];i(a),e=m(_,e,"scalar");var n,s=0|r._crypto_scalarmult_ristretto255_scalarbytes();e.length!==s&&b(_,"invalid scalar length"),n=u(e),_.push(n),t=m(_,t,"privateKey");var c,o=0|r._crypto_scalarmult_ristretto255_bytes();t.length!==o&&b(_,"invalid privateKey length"),c=u(t),_.push(c);var h=new l(0|r._crypto_scalarmult_ristretto255_bytes()),y=h.address;if(_.push(y),0==(0|r._crypto_scalarmult_ristretto255(y,n,c))){var d=p(h,a);return v(_),d}g(_,"input is zero element")} -crypto_scalarmult_ristretto255_base = function rt(e,t){var a=[];i(t);var _=u(e=m(a,e,"scalar"));e.length,a.push(_);var n=new l(0|r._crypto_core_ristretto255_bytes()),s=n.address;if(a.push(s),0==(0|r._crypto_scalarmult_ristretto255_base(s,_))){var c=p(n,t);return v(a),c}g(a,"scalar is 0")} -crypto_secretbox_detached = function at(e,t,a,_){var n=[];i(_);var s=u(e=m(n,e,"message")),c=e.length;n.push(s),t=m(n,t,"nonce");var o,h=0|r._crypto_secretbox_noncebytes();t.length!==h&&b(n,"invalid nonce length"),o=u(t),n.push(o),a=m(n,a,"key");var y,d=0|r._crypto_secretbox_keybytes();a.length!==d&&b(n,"invalid key length"),y=u(a),n.push(y);var f=new l(0|c),E=f.address;n.push(E);var x=new l(0|r._crypto_secretbox_macbytes()),k=x.address;if(n.push(k),0==(0|r._crypto_secretbox_detached(E,k,s,c,0,o,y))){var S=p({mac:x,cipher:f},_);return v(n),S}g(n,"invalid usage")} -crypto_secretbox_easy = function _t(e,t,a,_){var n=[];i(_);var s=u(e=m(n,e,"message")),c=e.length;n.push(s),t=m(n,t,"nonce");var o,h=0|r._crypto_secretbox_noncebytes();t.length!==h&&b(n,"invalid nonce length"),o=u(t),n.push(o),a=m(n,a,"key");var y,d=0|r._crypto_secretbox_keybytes();a.length!==d&&b(n,"invalid key length"),y=u(a),n.push(y);var f=new l(c+r._crypto_secretbox_macbytes()|0),E=f.address;if(n.push(E),0==(0|r._crypto_secretbox_easy(E,s,c,0,o,y))){var x=p(f,_);return v(n),x}g(n,"invalid usage")} -crypto_secretbox_keygen = function nt(e){var t=[];i(e);var a=new l(0|r._crypto_secretbox_keybytes()),_=a.address;t.push(_),r._crypto_secretbox_keygen(_);var n=p(a,e);return v(t),n} -crypto_secretbox_open_detached = function st(e,t,a,_,n){var s=[];i(n);var c=u(e=m(s,e,"ciphertext")),o=e.length;s.push(c),t=m(s,t,"mac");var h,y=0|r._crypto_secretbox_macbytes();t.length!==y&&b(s,"invalid mac length"),h=u(t),s.push(h),a=m(s,a,"nonce");var d,f=0|r._crypto_secretbox_noncebytes();a.length!==f&&b(s,"invalid nonce length"),d=u(a),s.push(d),_=m(s,_,"key");var E,x=0|r._crypto_secretbox_keybytes();_.length!==x&&b(s,"invalid key length"),E=u(_),s.push(E);var k=new l(0|o),S=k.address;if(s.push(S),0==(0|r._crypto_secretbox_open_detached(S,c,h,o,0,d,E))){var T=p(k,n);return v(s),T}g(s,"wrong secret key for the given ciphertext")} -crypto_secretbox_open_easy = function ct(e,t,a,_){var n=[];i(_),e=m(n,e,"ciphertext");var s,c=r._crypto_secretbox_macbytes(),o=e.length;o>>0;return v([]),t} -randombytes_stir = function zt(e){i(e),r._randombytes_stir()} -randombytes_uniform = function jt(e,t){var a=[];i(t),f(a,e,"upper_bound"),("number"!=typeof e||(0|e)!==e||e<0)&&b(a,"upper_bound must be an unsigned integer");var _=r._randombytes_uniform(e)>>>0;return v(a),_} -sodium_version_string = function qt(){var e=r._sodium_version_string(),t=r.UTF8ToString(e);return v([]),t} -SODIUM_LIBRARY_VERSION_MAJOR = 10 -SODIUM_LIBRARY_VERSION_MINOR = 3 -crypto_aead_chacha20poly1305_ABYTES = 16 -crypto_aead_chacha20poly1305_IETF_ABYTES = 16 -crypto_aead_chacha20poly1305_IETF_KEYBYTES = 32 -crypto_aead_chacha20poly1305_IETF_MESSAGEBYTES_MAX = -17 -crypto_aead_chacha20poly1305_IETF_NPUBBYTES = 12 -crypto_aead_chacha20poly1305_IETF_NSECBYTES = 0 -crypto_aead_chacha20poly1305_KEYBYTES = 32 -crypto_aead_chacha20poly1305_MESSAGEBYTES_MAX = -17 -crypto_aead_chacha20poly1305_NPUBBYTES = 8 -crypto_aead_chacha20poly1305_NSECBYTES = 0 -crypto_aead_chacha20poly1305_ietf_ABYTES = 16 -crypto_aead_chacha20poly1305_ietf_KEYBYTES = 32 -crypto_aead_chacha20poly1305_ietf_MESSAGEBYTES_MAX = -17 -crypto_aead_chacha20poly1305_ietf_NPUBBYTES = 12 -crypto_aead_chacha20poly1305_ietf_NSECBYTES = 0 -crypto_aead_xchacha20poly1305_IETF_ABYTES = 16 -crypto_aead_xchacha20poly1305_IETF_KEYBYTES = 32 -crypto_aead_xchacha20poly1305_IETF_MESSAGEBYTES_MAX = -17 -crypto_aead_xchacha20poly1305_IETF_NPUBBYTES = 24 -crypto_aead_xchacha20poly1305_IETF_NSECBYTES = 0 -crypto_aead_xchacha20poly1305_ietf_ABYTES = 16 -crypto_aead_xchacha20poly1305_ietf_KEYBYTES = 32 -crypto_aead_xchacha20poly1305_ietf_MESSAGEBYTES_MAX = -17 -crypto_aead_xchacha20poly1305_ietf_NPUBBYTES = 24 -crypto_aead_xchacha20poly1305_ietf_NSECBYTES = 0 -crypto_auth_BYTES = 32 -crypto_auth_KEYBYTES = 32 -crypto_auth_hmacsha256_BYTES = 32 -crypto_auth_hmacsha256_KEYBYTES = 32 -crypto_auth_hmacsha512256_BYTES = 32 -crypto_auth_hmacsha512256_KEYBYTES = 32 -crypto_auth_hmacsha512_BYTES = 64 -crypto_auth_hmacsha512_KEYBYTES = 32 -crypto_box_BEFORENMBYTES = 32 -crypto_box_MACBYTES = 16 -crypto_box_MESSAGEBYTES_MAX = -17 -crypto_box_NONCEBYTES = 24 -crypto_box_PUBLICKEYBYTES = 32 -crypto_box_SEALBYTES = 48 -crypto_box_SECRETKEYBYTES = 32 -crypto_box_SEEDBYTES = 32 -crypto_box_curve25519xchacha20poly1305_BEFORENMBYTES = 32 -crypto_box_curve25519xchacha20poly1305_MACBYTES = 16 -crypto_box_curve25519xchacha20poly1305_MESSAGEBYTES_MAX = -17 -crypto_box_curve25519xchacha20poly1305_NONCEBYTES = 24 -crypto_box_curve25519xchacha20poly1305_PUBLICKEYBYTES = 32 -crypto_box_curve25519xchacha20poly1305_SEALBYTES = 48 -crypto_box_curve25519xchacha20poly1305_SECRETKEYBYTES = 32 -crypto_box_curve25519xchacha20poly1305_SEEDBYTES = 32 -crypto_box_curve25519xsalsa20poly1305_BEFORENMBYTES = 32 -crypto_box_curve25519xsalsa20poly1305_MACBYTES = 16 -crypto_box_curve25519xsalsa20poly1305_MESSAGEBYTES_MAX = -17 -crypto_box_curve25519xsalsa20poly1305_NONCEBYTES = 24 -crypto_box_curve25519xsalsa20poly1305_PUBLICKEYBYTES = 32 -crypto_box_curve25519xsalsa20poly1305_SECRETKEYBYTES = 32 -crypto_box_curve25519xsalsa20poly1305_SEEDBYTES = 32 -crypto_core_ed25519_BYTES = 32 -crypto_core_ed25519_HASHBYTES = 64 -crypto_core_ed25519_NONREDUCEDSCALARBYTES = 64 -crypto_core_ed25519_SCALARBYTES = 32 -crypto_core_ed25519_UNIFORMBYTES = 32 -crypto_core_hchacha20_CONSTBYTES = 16 -crypto_core_hchacha20_INPUTBYTES = 16 -crypto_core_hchacha20_KEYBYTES = 32 -crypto_core_hchacha20_OUTPUTBYTES = 32 -crypto_core_hsalsa20_CONSTBYTES = 16 -crypto_core_hsalsa20_INPUTBYTES = 16 -crypto_core_hsalsa20_KEYBYTES = 32 -crypto_core_hsalsa20_OUTPUTBYTES = 32 -crypto_core_ristretto255_BYTES = 32 -crypto_core_ristretto255_HASHBYTES = 64 -crypto_core_ristretto255_NONREDUCEDSCALARBYTES = 64 -crypto_core_ristretto255_SCALARBYTES = 32 -crypto_core_salsa2012_CONSTBYTES = 16 -crypto_core_salsa2012_INPUTBYTES = 16 -crypto_core_salsa2012_KEYBYTES = 32 -crypto_core_salsa2012_OUTPUTBYTES = 64 -crypto_core_salsa20_CONSTBYTES = 16 -crypto_core_salsa20_INPUTBYTES = 16 -crypto_core_salsa20_KEYBYTES = 32 -crypto_core_salsa20_OUTPUTBYTES = 64 -crypto_generichash_BYTES = 32 -crypto_generichash_BYTES_MAX = 64 -crypto_generichash_BYTES_MIN = 16 -crypto_generichash_KEYBYTES = 32 -crypto_generichash_KEYBYTES_MAX = 64 -crypto_generichash_KEYBYTES_MIN = 16 -crypto_generichash_blake2b_BYTES = 32 -crypto_generichash_blake2b_BYTES_MAX = 64 -crypto_generichash_blake2b_BYTES_MIN = 16 -crypto_generichash_blake2b_KEYBYTES = 32 -crypto_generichash_blake2b_KEYBYTES_MAX = 64 -crypto_generichash_blake2b_KEYBYTES_MIN = 16 -crypto_generichash_blake2b_PERSONALBYTES = 16 -crypto_generichash_blake2b_SALTBYTES = 16 -crypto_hash_BYTES = 64 -crypto_hash_sha256_BYTES = 32 -crypto_hash_sha512_BYTES = 64 -crypto_kdf_BYTES_MAX = 64 -crypto_kdf_BYTES_MIN = 16 -crypto_kdf_CONTEXTBYTES = 8 -crypto_kdf_KEYBYTES = 32 -crypto_kdf_blake2b_BYTES_MAX = 64 -crypto_kdf_blake2b_BYTES_MIN = 16 -crypto_kdf_blake2b_CONTEXTBYTES = 8 -crypto_kdf_blake2b_KEYBYTES = 32 -crypto_kx_PUBLICKEYBYTES = 32 -crypto_kx_SECRETKEYBYTES = 32 -crypto_kx_SEEDBYTES = 32 -crypto_kx_SESSIONKEYBYTES = 32 -crypto_onetimeauth_BYTES = 16 -crypto_onetimeauth_KEYBYTES = 32 -crypto_onetimeauth_poly1305_BYTES = 16 -crypto_onetimeauth_poly1305_KEYBYTES = 32 -crypto_pwhash_ALG_ARGON2I13 = 1 -crypto_pwhash_ALG_ARGON2ID13 = 2 -crypto_pwhash_ALG_DEFAULT = 2 -crypto_pwhash_BYTES_MAX = -1 -crypto_pwhash_BYTES_MIN = 16 -crypto_pwhash_MEMLIMIT_INTERACTIVE = 67108864 -crypto_pwhash_MEMLIMIT_MAX = -2147483648 -crypto_pwhash_MEMLIMIT_MIN = 8192 -crypto_pwhash_MEMLIMIT_MODERATE = 268435456 -crypto_pwhash_MEMLIMIT_SENSITIVE = 1073741824 -crypto_pwhash_OPSLIMIT_INTERACTIVE = 2 -crypto_pwhash_OPSLIMIT_MAX = -1 -crypto_pwhash_OPSLIMIT_MIN = 1 -crypto_pwhash_OPSLIMIT_MODERATE = 3 -crypto_pwhash_OPSLIMIT_SENSITIVE = 4 -crypto_pwhash_PASSWD_MAX = -1 -crypto_pwhash_PASSWD_MIN = 0 -crypto_pwhash_SALTBYTES = 16 -crypto_pwhash_STRBYTES = 128 -crypto_pwhash_argon2i_BYTES_MAX = -1 -crypto_pwhash_argon2i_BYTES_MIN = 16 -crypto_pwhash_argon2i_SALTBYTES = 16 -crypto_pwhash_argon2i_STRBYTES = 128 -crypto_pwhash_argon2id_BYTES_MAX = -1 -crypto_pwhash_argon2id_BYTES_MIN = 16 -crypto_pwhash_argon2id_SALTBYTES = 16 -crypto_pwhash_argon2id_STRBYTES = 128 -crypto_pwhash_scryptsalsa208sha256_BYTES_MAX = -1 -crypto_pwhash_scryptsalsa208sha256_BYTES_MIN = 16 -crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_INTERACTIVE = 16777216 -crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_MAX = -1 -crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_MIN = 16777216 -crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_SENSITIVE = 1073741824 -crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_INTERACTIVE = 524288 -crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_MAX = -1 -crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_MIN = 32768 -crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_SENSITIVE = 33554432 -crypto_pwhash_scryptsalsa208sha256_SALTBYTES = 32 -crypto_pwhash_scryptsalsa208sha256_STRBYTES = 102 -crypto_scalarmult_BYTES = 32 -crypto_scalarmult_SCALARBYTES = 32 -crypto_scalarmult_curve25519_BYTES = 32 -crypto_scalarmult_curve25519_SCALARBYTES = 32 -crypto_scalarmult_ed25519_BYTES = 32 -crypto_scalarmult_ed25519_SCALARBYTES = 32 -crypto_scalarmult_ristretto255_BYTES = 32 -crypto_scalarmult_ristretto255_SCALARBYTES = 32 -crypto_secretbox_KEYBYTES = 32 -crypto_secretbox_MACBYTES = 16 -crypto_secretbox_MESSAGEBYTES_MAX = -17 -crypto_secretbox_NONCEBYTES = 24 -crypto_secretbox_xchacha20poly1305_KEYBYTES = 32 -crypto_secretbox_xchacha20poly1305_MACBYTES = 16 -crypto_secretbox_xchacha20poly1305_MESSAGEBYTES_MAX = -17 -crypto_secretbox_xchacha20poly1305_NONCEBYTES = 24 -crypto_secretbox_xsalsa20poly1305_KEYBYTES = 32 -crypto_secretbox_xsalsa20poly1305_MACBYTES = 16 -crypto_secretbox_xsalsa20poly1305_MESSAGEBYTES_MAX = -17 -crypto_secretbox_xsalsa20poly1305_NONCEBYTES = 24 -crypto_secretstream_xchacha20poly1305_ABYTES = 17 -crypto_secretstream_xchacha20poly1305_HEADERBYTES = 24 -crypto_secretstream_xchacha20poly1305_KEYBYTES = 32 -crypto_secretstream_xchacha20poly1305_MESSAGEBYTES_MAX = -18 -crypto_secretstream_xchacha20poly1305_TAG_FINAL = 3 -crypto_secretstream_xchacha20poly1305_TAG_MESSAGE = 0 -crypto_secretstream_xchacha20poly1305_TAG_PUSH = 1 -crypto_secretstream_xchacha20poly1305_TAG_REKEY = 2 -crypto_shorthash_BYTES = 8 -crypto_shorthash_KEYBYTES = 16 -crypto_shorthash_siphash24_BYTES = 8 -crypto_shorthash_siphash24_KEYBYTES = 16 -crypto_shorthash_siphashx24_BYTES = 16 -crypto_shorthash_siphashx24_KEYBYTES = 16 -crypto_sign_BYTES = 64 -crypto_sign_MESSAGEBYTES_MAX = -65 -crypto_sign_PUBLICKEYBYTES = 32 -crypto_sign_SECRETKEYBYTES = 64 -crypto_sign_SEEDBYTES = 32 -crypto_sign_ed25519_BYTES = 64 -crypto_sign_ed25519_MESSAGEBYTES_MAX = -65 -crypto_sign_ed25519_PUBLICKEYBYTES = 32 -crypto_sign_ed25519_SECRETKEYBYTES = 64 -crypto_sign_ed25519_SEEDBYTES = 32 -crypto_stream_KEYBYTES = 32 -crypto_stream_MESSAGEBYTES_MAX = -1 -crypto_stream_NONCEBYTES = 24 -crypto_stream_chacha20_IETF_KEYBYTES = 32 -crypto_stream_chacha20_IETF_MESSAGEBYTES_MAX = -1 -crypto_stream_chacha20_IETF_NONCEBYTES = 12 -crypto_stream_chacha20_KEYBYTES = 32 -crypto_stream_chacha20_MESSAGEBYTES_MAX = -1 -crypto_stream_chacha20_NONCEBYTES = 8 -crypto_stream_chacha20_ietf_KEYBYTES = 32 -crypto_stream_chacha20_ietf_MESSAGEBYTES_MAX = -1 -crypto_stream_chacha20_ietf_NONCEBYTES = 12 -crypto_stream_salsa2012_KEYBYTES = 32 -crypto_stream_salsa2012_MESSAGEBYTES_MAX = -1 -crypto_stream_salsa2012_NONCEBYTES = 8 -crypto_stream_salsa208_KEYBYTES = 32 -crypto_stream_salsa208_MESSAGEBYTES_MAX = -1 -crypto_stream_salsa208_NONCEBYTES = 8 -crypto_stream_salsa20_KEYBYTES = 32 -crypto_stream_salsa20_MESSAGEBYTES_MAX = -1 -crypto_stream_salsa20_NONCEBYTES = 8 -crypto_stream_xchacha20_KEYBYTES = 32 -crypto_stream_xchacha20_MESSAGEBYTES_MAX = -1 -crypto_stream_xchacha20_NONCEBYTES = 24 -crypto_stream_xsalsa20_KEYBYTES = 32 -crypto_stream_xsalsa20_MESSAGEBYTES_MAX = -1 -crypto_stream_xsalsa20_NONCEBYTES = 24 -crypto_verify_16_BYTES = 16 -crypto_verify_32_BYTES = 32 -crypto_verify_64_BYTES = 64 -SODIUM_VERSION_STRING = "1.0.18" -crypto_pwhash_STRPREFIX = "$argon2id$" -crypto_pwhash_scryptsalsa208sha256_STRPREFIX = "$7$" diff --git a/supported_bindings_list.md b/supported_bindings_list.md index 6847dcc..976beb2 100644 --- a/supported_bindings_list.md +++ b/supported_bindings_list.md @@ -1,3 +1,10 @@ +# Supported functions and constants Libsodium wrapper + +Here is a list of supported functions and constants, This list is extracted from the libsodium.js library as which is misleading, as the comparison should be done from the +native libsodium library. + +## Functions + |Function name| Implemented | |-------------|-------------| | add | | @@ -129,12 +136,12 @@ | crypto_sign_seed_keypair | :heavy_check_mark: | | crypto_sign_update | :heavy_check_mark: | | crypto_sign_verify_detached | :heavy_check_mark: | -| crypto_stream_chacha20 | | -| crypto_stream_chacha20_ietf_xor | | -| crypto_stream_chacha20_ietf_xor_ic | | -| crypto_stream_chacha20_keygen | | -| crypto_stream_chacha20_xor | | -| crypto_stream_chacha20_xor_ic | | +| crypto_stream_chacha20 | :heavy_check_mark: | +| crypto_stream_chacha20_ietf_xor | :heavy_check_mark: | +| crypto_stream_chacha20_ietf_xor_ic | :heavy_check_mark: | +| crypto_stream_chacha20_keygen | :heavy_check_mark: | +| crypto_stream_chacha20_xor | :heavy_check_mark: | +| crypto_stream_chacha20_xor_ic | :heavy_check_mark: | | crypto_stream_keygen | Other XSalsa20 primitives are not available, so I'm leaving this out as well| | crypto_stream_xchacha20_keygen | not present in LazySodium Android | | crypto_stream_xchacha20_xor | not present in LazySodium Android| @@ -146,6 +153,9 @@ | randombytes_stir | not present in LazySodium | | randombytes_uniform | :heavy_check_mark: | | sodium_version_string | | + +## Constants +| Constant name| Implemented | | SODIUM_LIBRARY_VERSION_MAJOR | | | SODIUM_LIBRARY_VERSION_MINOR | | | crypto_aead_chacha20poly1305_ABYTES | | @@ -351,12 +361,12 @@ | crypto_stream_chacha20_IETF_KEYBYTES | | | crypto_stream_chacha20_IETF_MESSAGEBYTES_MAX | | | crypto_stream_chacha20_IETF_NONCEBYTES | | -| crypto_stream_chacha20_KEYBYTES | | +| crypto_stream_chacha20_KEYBYTES | stream_chacha20| | crypto_stream_chacha20_MESSAGEBYTES_MAX | | -| crypto_stream_chacha20_NONCEBYTES | | -| crypto_stream_chacha20_ietf_KEYBYTES | | +| crypto_stream_chacha20_NONCEBYTES | stream_chacha20| +| crypto_stream_chacha20_ietf_KEYBYTES | stream_chacha20| | crypto_stream_chacha20_ietf_MESSAGEBYTES_MAX | | -| crypto_stream_chacha20_ietf_NONCEBYTES | | +| crypto_stream_chacha20_ietf_NONCEBYTES | stream_chacha20| | crypto_stream_salsa2012_KEYBYTES | | | crypto_stream_salsa2012_MESSAGEBYTES_MAX | | | crypto_stream_salsa2012_NONCEBYTES | |