aboutsummaryrefslogtreecommitdiffstats
path: root/teal-src
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2022-06-30 15:38:22 +0200
committerKim Alvefur <zash@zash.se>2022-06-30 15:38:22 +0200
commitd9ce2d5e4e6ebc7a09d71a590b1243ca5f4d5f85 (patch)
tree296e330e60ee510ed902a594235d5edb6ca1e174 /teal-src
parent4122acf8c8e80d7654e9ba7e1297a38e834f49de (diff)
downloadprosody-d9ce2d5e4e6ebc7a09d71a590b1243ca5f4d5f85.tar.gz
prosody-d9ce2d5e4e6ebc7a09d71a590b1243ca5f4d5f85.zip
util.crypto: Add Teal type specification
Diffstat (limited to 'teal-src')
-rw-r--r--teal-src/util/crypto.d.tl29
1 files changed, 29 insertions, 0 deletions
diff --git a/teal-src/util/crypto.d.tl b/teal-src/util/crypto.d.tl
new file mode 100644
index 00000000..cf0b0d1b
--- /dev/null
+++ b/teal-src/util/crypto.d.tl
@@ -0,0 +1,29 @@
+local record lib
+ record key
+ private_pem : function (key) : string
+ public_pem : function (key) : string
+ get_type : function (key) : string
+ end
+
+ generate_ed25519_keypair : function () : key
+ ed25519_sign : function (key, string) : string
+ ed25519_verify : function (key, string, string) : boolean
+
+ 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
+
+ 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
+
+
+ version : string
+ _LIBCRYPTO_VERSION : string
+end
+return lib