Annotate

teal-src/util/crypto.d.tl @ 12714:82bca7191f13

util.crypto: Use stack space buffers Removes assumption that LUAL_BUFFERSIZE is known at pre-processing time, which it is not in Lua 5.3 and 5.4, where it is a computed macro based on sizeof. Allocation of stack space is safer and faster, no need to worry about luaL_prepbuffer failing to allocate memory and skipping free()
author Kim Alvefur <zash@zash.se>
date Mon, 11 Jul 2022 17:01:55 +0200
parent 12695:6aaa604fdfd5
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
12695
6aaa604fdfd5 util.crypto: Add Teal type specification
Kim Alvefur <zash@zash.se>
parents:
diff changeset
1 local record lib
6aaa604fdfd5 util.crypto: Add Teal type specification
Kim Alvefur <zash@zash.se>
parents:
diff changeset
2 record key
6aaa604fdfd5 util.crypto: Add Teal type specification
Kim Alvefur <zash@zash.se>
parents:
diff changeset
3 private_pem : function (key) : string
6aaa604fdfd5 util.crypto: Add Teal type specification
Kim Alvefur <zash@zash.se>
parents:
diff changeset
4 public_pem : function (key) : string
6aaa604fdfd5 util.crypto: Add Teal type specification
Kim Alvefur <zash@zash.se>
parents:
diff changeset
5 get_type : function (key) : string
6aaa604fdfd5 util.crypto: Add Teal type specification
Kim Alvefur <zash@zash.se>
parents:
diff changeset
6 end
6aaa604fdfd5 util.crypto: Add Teal type specification
Kim Alvefur <zash@zash.se>
parents:
diff changeset
7
6aaa604fdfd5 util.crypto: Add Teal type specification
Kim Alvefur <zash@zash.se>
parents:
diff changeset
8 generate_ed25519_keypair : function () : key
6aaa604fdfd5 util.crypto: Add Teal type specification
Kim Alvefur <zash@zash.se>
parents:
diff changeset
9 ed25519_sign : function (key, string) : string
6aaa604fdfd5 util.crypto: Add Teal type specification
Kim Alvefur <zash@zash.se>
parents:
diff changeset
10 ed25519_verify : function (key, string, string) : boolean
6aaa604fdfd5 util.crypto: Add Teal type specification
Kim Alvefur <zash@zash.se>
parents:
diff changeset
11
6aaa604fdfd5 util.crypto: Add Teal type specification
Kim Alvefur <zash@zash.se>
parents:
diff changeset
12 ecdsa_sha256_sign : function (key, string) : string
6aaa604fdfd5 util.crypto: Add Teal type specification
Kim Alvefur <zash@zash.se>
parents:
diff changeset
13 ecdsa_sha256_verify : function (key, string, string) : boolean
6aaa604fdfd5 util.crypto: Add Teal type specification
Kim Alvefur <zash@zash.se>
parents:
diff changeset
14 parse_ecdsa_signature : function (string) : string, string
6aaa604fdfd5 util.crypto: Add Teal type specification
Kim Alvefur <zash@zash.se>
parents:
diff changeset
15 build_ecdsa_signature : function (string, string) : string
6aaa604fdfd5 util.crypto: Add Teal type specification
Kim Alvefur <zash@zash.se>
parents:
diff changeset
16
6aaa604fdfd5 util.crypto: Add Teal type specification
Kim Alvefur <zash@zash.se>
parents:
diff changeset
17 import_private_pem : function (string) : key
6aaa604fdfd5 util.crypto: Add Teal type specification
Kim Alvefur <zash@zash.se>
parents:
diff changeset
18 import_public_pem : function (string) : key
6aaa604fdfd5 util.crypto: Add Teal type specification
Kim Alvefur <zash@zash.se>
parents:
diff changeset
19
6aaa604fdfd5 util.crypto: Add Teal type specification
Kim Alvefur <zash@zash.se>
parents:
diff changeset
20 aes_128_gcm_encrypt : function (key, string, string) : string
6aaa604fdfd5 util.crypto: Add Teal type specification
Kim Alvefur <zash@zash.se>
parents:
diff changeset
21 aes_128_gcm_decrypt : function (key, string, string) : string
6aaa604fdfd5 util.crypto: Add Teal type specification
Kim Alvefur <zash@zash.se>
parents:
diff changeset
22 aes_256_gcm_encrypt : function (key, string, string) : string
6aaa604fdfd5 util.crypto: Add Teal type specification
Kim Alvefur <zash@zash.se>
parents:
diff changeset
23 aes_256_gcm_decrypt : function (key, string, string) : string
6aaa604fdfd5 util.crypto: Add Teal type specification
Kim Alvefur <zash@zash.se>
parents:
diff changeset
24
6aaa604fdfd5 util.crypto: Add Teal type specification
Kim Alvefur <zash@zash.se>
parents:
diff changeset
25
6aaa604fdfd5 util.crypto: Add Teal type specification
Kim Alvefur <zash@zash.se>
parents:
diff changeset
26 version : string
6aaa604fdfd5 util.crypto: Add Teal type specification
Kim Alvefur <zash@zash.se>
parents:
diff changeset
27 _LIBCRYPTO_VERSION : string
6aaa604fdfd5 util.crypto: Add Teal type specification
Kim Alvefur <zash@zash.se>
parents:
diff changeset
28 end
6aaa604fdfd5 util.crypto: Add Teal type specification
Kim Alvefur <zash@zash.se>
parents:
diff changeset
29 return lib