Debian Codegraph @

crypto_decode/761x3/ref/decode.c

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