summaryrefslogtreecommitdiffstats
path: root/lock/util.c
diff options
context:
space:
mode:
authorSadeep Madurange <sadeep@asciimx.com>2025-04-15 18:10:52 +0800
committerSadeep Madurange <sadeep@asciimx.com>2025-04-15 18:15:31 +0800
commit18502ba0f60906d6fc886d85096d8c2eef9ca4a9 (patch)
tree1600851148da2c721eda28b716fa3dfbe2336755 /lock/util.c
parent41ccbacf8a68f9bd7fe798b19ef5a9f07563a7d0 (diff)
downloadsmart-home-18502ba0f60906d6fc886d85096d8c2eef9ca4a9.tar.gz
Add encryption logic to back end.
Diffstat (limited to 'lock/util.c')
-rw-r--r--lock/util.c34
1 files changed, 0 insertions, 34 deletions
diff --git a/lock/util.c b/lock/util.c
index 6810c1e..32a1fcf 100644
--- a/lock/util.c
+++ b/lock/util.c
@@ -4,40 +4,6 @@
#include "util.h"
-static char tab[] = {
- '0', '8', '3', '6', 'a', 'Z', '$', '4', 'v', 'R', '@',
- 'E', '1', 'o', '#', ')', '2', '5', 'q', ';', '.', 'I',
- 'c', '7', '9', '*', 'L', 'V', '&', 'k', 'K', '!', 'm',
- 'N', '(', 'O', 'Q', 'A', '>', 'T', 't', '?', 'S', 'h',
- 'w', '/', 'n', 'W', 'l', 'M', 'e', 'H', 'j', 'g', '[',
- 'P', 'f', ':', 'B', ']', 'Y', '^', 'F', '%', 'C', 'x'
-};
-
-static uint16_t tablen = sizeof(tab) / sizeof(tab[0]);
-
-void wdt_init(void)
-{
- wdt_reset();
- WDTCSR |= (1 << WDCE) | (1 << WDE);
- WDTCSR = (1 << WDE) | (1 << WDP3) | (1 << WDP0);
-}
-
-void keygen(char *buf, uint8_t n)
-{
- int i, imax;
- uint8_t sreg;
- uint16_t seed;
-
- sreg = SREG;
- cli();
- seed = TCNT1;
- SREG = sreg;
-
- for (i = 0, imax = n - 1; i < imax; i++, seed++)
- buf[i] = tab[(seed % tablen)];
- buf[imax] = '\0';
-}
-
void xor(const char *k, const char *s, char *d, uint8_t n)
{
int i;