Debian Codegraph @

crypto_encode/857x3/ref/encode.c

raw
1 // 20250302 djb: port to -Wc++-compat
2 #include "crypto_encode.h"
3 #include "crypto_uint8.h"
4 #define uint8 crypto_uint8
5
6 #define p 857
7
8 void crypto_encode(unsigned char *s,const void *v)
9 {
10 const uint8 *f = (const uint8 *) v;
11 uint8 x;
12 int i;
13
14 for (i = 0;i < p/4;++i) {
15 x = *f++ + 1;
16 x += (*f++ + 1)<<2;
17 x += (*f++ + 1)<<4;
18 x += (*f++ + 1)<<6;
19 *s++ = x;
20 }
21 x = *f++ + 1;
22 *s++ = x;
23 }