12 #include <linux/slab.h>
15 static const char cachefiles_charmap[64] =
17 "abcdefghijklmnopqrstuvwxyz"
18 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
22 static const char cachefiles_filecharmap[256] = {
39 unsigned char csum, ch;
46 BUG_ON(keylen < 2 || keylen > 514);
48 csum = raw[0] + raw[1];
50 for (loop = 2; loop < keylen; loop++) {
53 print &= cachefiles_filecharmap[ch];
67 keylen = (keylen + 2) / 3;
88 sprintf(key,
"@%02x%c+", (
unsigned) csum, 0);
96 key[len + 1] = cachefiles_charmap[acc & 63];
98 key[len] = cachefiles_charmap[acc & 63];
102 for (loop = keylen; loop > 0; loop--) {
117 default: type =
'S';
break;
121 for (loop = keylen; loop > 0; loop--) {
135 key[len++] = cachefiles_charmap[acc & 63];
137 key[len++] = cachefiles_charmap[acc & 63];
139 key[len++] = cachefiles_charmap[acc & 63];
141 key[len++] = cachefiles_charmap[acc & 63];
149 default: type =
'T';
break;
157 _leave(
" = %p %d", key, len);