summaryrefslogtreecommitdiffstats
path: root/src/crypt.c
diff options
context:
space:
mode:
authorYegappan Lakshmanan <yegappan@yahoo.com>2022-06-29 12:55:36 +0100
committerBram Moolenaar <Bram@vim.org>2022-06-29 12:55:36 +0100
commitee47eaceaa148e07b566ff420f9a3c2edde2fa34 (patch)
tree990dc0d8074d51970ecc83ad94a59e884687a313 /src/crypt.c
parentc207fd2535717030d78f9b92839e5f2ac004cc78 (diff)
patch 9.0.0003: functions are global while they could be localv9.0.0003
Problem: Functions are global while they could be local. Solution: Add "static". Add a few tests. (Yegappan Lakshmanan, closes #10612)
Diffstat (limited to 'src/crypt.c')
-rw-r--r--src/crypt.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/crypt.c b/src/crypt.c
index bed76a96d4..b2b50d4632 100644
--- a/src/crypt.c
+++ b/src/crypt.c
@@ -73,6 +73,10 @@ typedef struct {
char_u *p2, int last);
} cryptmethod_T;
+static int crypt_sodium_init(cryptstate_T *state, char_u *key, char_u *salt, int salt_len, char_u *seed, int seed_len);
+static long crypt_sodium_buffer_decode(cryptstate_T *state, char_u *from, size_t len, char_u **buf_out, int last);
+static long crypt_sodium_buffer_encode(cryptstate_T *state, char_u *from, size_t len, char_u **buf_out, int last);
+
// index is method_nr of cryptstate_T, CRYPT_M_*
static cryptmethod_T cryptmethods[CRYPT_M_COUNT] = {
// PK_Zip; very weak
@@ -850,7 +854,7 @@ crypt_append_msg(
}
}
- int
+ static int
crypt_sodium_init(
cryptstate_T *state UNUSED,
char_u *key UNUSED,
@@ -1030,7 +1034,7 @@ fail:
* Encrypt "from[len]" into "to[len]".
* "from" and "to" can be equal to encrypt in place.
*/
- long
+ static long
crypt_sodium_buffer_encode(
cryptstate_T *state UNUSED,
char_u *from UNUSED,
@@ -1080,7 +1084,7 @@ crypt_sodium_buffer_encode(
* Decrypt "from[len]" into "to[len]".
* "from" and "to" can be equal to encrypt in place.
*/
- long
+ static long
crypt_sodium_buffer_decode(
cryptstate_T *state UNUSED,
char_u *from UNUSED,