diff options
author | Kim Alvefur <zash@zash.se> | 2024-02-23 16:33:08 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2024-02-23 16:33:08 +0100 |
commit | c333519fb273bbc4208d8e19acf207af763a9627 (patch) | |
tree | fdfe8e0344f05ceec2e0f8b1931f34140d45e142 /teal-src/prosody | |
parent | 961b764d10ef0b03798e6bb0ae3bfdbd74212005 (diff) | |
download | prosody-c333519fb273bbc4208d8e19acf207af763a9627.tar.gz prosody-c333519fb273bbc4208d8e19acf207af763a9627.zip |
util.crypto: Update Teal interface description to match C sources
Was missing some entries.
Rearranged to match order of entries in the C source Reg table.
Diffstat (limited to 'teal-src/prosody')
-rw-r--r-- | teal-src/prosody/util/crypto.d.tl | 52 |
1 files changed, 40 insertions, 12 deletions
diff --git a/teal-src/prosody/util/crypto.d.tl b/teal-src/prosody/util/crypto.d.tl index cf0b0d1b..866185d0 100644 --- a/teal-src/prosody/util/crypto.d.tl +++ b/teal-src/prosody/util/crypto.d.tl @@ -5,23 +5,51 @@ local record lib get_type : function (key) : string end - generate_ed25519_keypair : function () : key - ed25519_sign : function (key, string) : string - ed25519_verify : function (key, string, string) : boolean + type base_evp_sign = function (key, message : string) : string + type base_evp_verify = function (key, message : string, signature : string) : boolean + + ed25519_sign : base_evp_sign + ed25519_verify : base_evp_verify + + ecdsa_sha256_sign : base_evp_sign + ecdsa_sha256_verify : base_evp_verify + ecdsa_sha384_sign : base_evp_sign + ecdsa_sha384_verify : base_evp_verify + ecdsa_sha512_sign : base_evp_sign + ecdsa_sha512_verify : base_evp_verify + + rsassa_pkcs1_sha256_sign : base_evp_sign + rsassa_pkcs1_sha256_verify : base_evp_verify + rsassa_pkcs1_sha384_sign : base_evp_sign + rsassa_pkcs1_sha384_verify : base_evp_verify + rsassa_pkcs1_sha512_sign : base_evp_sign + rsassa_pkcs1_sha512_verify : base_evp_verify + + rsassa_pss_sha256_sign : base_evp_sign + rsassa_pss_sha256_verify : base_evp_verify + rsassa_pss_sha384_sign : base_evp_sign + rsassa_pss_sha384_verify : base_evp_verify + rsassa_pss_sha512_sign : base_evp_sign + rsassa_pss_sha512_verify : base_evp_verify - ecdsa_sha256_sign : function (key, string) : string - ecdsa_sha256_verify : function (key, string, string) : boolean - parse_ecdsa_signature : function (string) : string, string - build_ecdsa_signature : function (string, string) : string + type Levp_encrypt = function (key : string, iv : string, plaintext : string) : string + type Levp_decrypt = function (key : string, iv : string, ciphertext : string) : string, string + + aes_128_gcm_encrypt : Levp_encrypt + aes_128_gcm_decrypt : Levp_decrypt + aes_256_gcm_encrypt : Levp_encrypt + aes_256_gcm_decrypt : Levp_decrypt + + aes_256_ctr_encrypt : Levp_encrypt + aes_256_ctr_decrypt : Levp_decrypt + + generate_ed25519_keypair : function () : key import_private_pem : function (string) : key import_public_pem : function (string) : key - aes_128_gcm_encrypt : function (key, string, string) : string - aes_128_gcm_decrypt : function (key, string, string) : string - aes_256_gcm_encrypt : function (key, string, string) : string - aes_256_gcm_decrypt : function (key, string, string) : string - + parse_ecdsa_signature : function (string, integer) : string, string + build_ecdsa_signature : function (r : string, s : string) : string version : string _LIBCRYPTO_VERSION : string |