]> git.lizzy.rs Git - plan9front.git/blob - sys/src/libc/port/netcrypt.c
libregexp: improve the transition to next available thread, instruction, and generation
[plan9front.git] / sys / src / libc / port / netcrypt.c
1 #include <u.h>
2 #include <libc.h>
3
4 int
5 netcrypt(void *key, void *chal)
6 {
7         uchar buf[8], *p;
8
9         strncpy((char*)buf, chal, 7);
10         buf[7] = '\0';
11         for(p = buf; *p && *p != '\n'; p++)
12                 ;
13         *p = '\0';
14         encrypt(key, buf, 8);
15         sprint(chal, "%.2ux%.2ux%.2ux%.2ux", buf[0], buf[1], buf[2], buf[3]);
16         return 1;
17 }