aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/sha256.c
diff options
context:
space:
mode:
authorThiago de Arruda <tpadilha84@gmail.com>2015-02-13 12:06:01 -0300
committerThiago de Arruda <tpadilha84@gmail.com>2015-02-16 23:17:39 -0300
commite0e41b30c61922e099a067ac5c137e745699a1aa (patch)
treed4cbc2313612e5f6bc135ceb8cf520cd19b89b20 /src/nvim/sha256.c
parent6383ea6e8e14350432f1fc7da519b54d0ed67f8c (diff)
downloadrneovim-e0e41b30c61922e099a067ac5c137e745699a1aa.tar.gz
rneovim-e0e41b30c61922e099a067ac5c137e745699a1aa.tar.bz2
rneovim-e0e41b30c61922e099a067ac5c137e745699a1aa.zip
ui: Remove/adapt some old code for a big UI refactor
- Remove abstract_ui global, now it is always active - Remove some terminal handling code - Remove unused functions - Remove HAVE_TGETENT/TERMINFO/TERMIOS/IOCTL #ifdefs - Remove tgetent/terminfo from version.c - Remove curses/terminfo dependencies - Only start/stop termcap when starting/exiting the program - msg_use_printf will return true if there are no attached UIs( messages will be written to stdout) - Remove `ex_winpos`(implement `:winpos` with `ex_ni`)
Diffstat (limited to 'src/nvim/sha256.c')
-rw-r--r--src/nvim/sha256.c37
1 files changed, 0 insertions, 37 deletions
diff --git a/src/nvim/sha256.c b/src/nvim/sha256.c
index e5e29768af..46b8d47c00 100644
--- a/src/nvim/sha256.c
+++ b/src/nvim/sha256.c
@@ -351,40 +351,3 @@ bool sha256_self_test(void)
}
return failures == false;
}
-
-/// Fill "header[header_len]" with random_data.
-/// Also "salt[salt_len]" when "salt" is not NULL.
-///
-/// @param header
-/// @param header_len
-/// @param salt
-/// @param salt_len
-void sha2_seed(char_u *restrict header, size_t header_len,
- char_u *restrict salt, size_t salt_len)
-{
- static char_u random_data[1000];
- char_u sha256sum[SHA256_SUM_SIZE];
- context_sha256_T ctx;
-
- unsigned int seed = (unsigned int) os_hrtime();
-
- size_t i;
- for (i = 0; i < sizeof(random_data) - 1; i++) {
- random_data[i] = (char_u) ((os_hrtime() ^ (uint64_t)rand_r(&seed)) & 0xff);
- }
- sha256_start(&ctx);
- sha256_update(&ctx, random_data, sizeof(random_data));
- sha256_finish(&ctx, sha256sum);
-
- // put first block into header.
- for (i = 0; i < header_len; i++) {
- header[i] = sha256sum[i % sizeof(sha256sum)];
- }
-
- // put remaining block into salt.
- if (salt != NULL) {
- for (i = 0; i < salt_len; i++) {
- salt[i] = sha256sum[(i + header_len) % sizeof(sha256sum)];
- }
- }
-}