From c333519fb273bbc4208d8e19acf207af763a9627 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Fri, 23 Feb 2024 16:33:08 +0100 Subject: 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. --- teal-src/prosody/util/crypto.d.tl | 52 ++++++++++++++++++++++++++++++--------- 1 file changed, 40 insertions(+), 12 deletions(-) (limited to 'teal-src') 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 -- cgit v1.2.3