Lines Matching +full:21 +full:- +full:k

7  * Adapted for FreeBSD-2.0 by Geoffrey M. Rehmet
11 * Adapted for FreeBSD-4.0 by Mark R V Murray
54 * It is assumed that the 8-byte arrays passed by reference can be
78 61, 53, 45, 37, 29, 21, 13, 5, 63, 55, 47, 39, 31, 23, 15, 7
86 14, 6, 61, 53, 45, 37, 29, 21, 13, 5, 28, 20, 12, 4
95 14, 17, 11, 24, 1, 5, 3, 28, 15, 6, 21, 10,
159 16, 7, 20, 21, 29, 12, 28, 17, 1, 15, 23, 26, 5, 18, 31, 10,
203 return(ch - 'a' + 38); in ascii_to_bin()
207 return(ch - 'A' + 12); in ascii_to_bin()
211 return(ch - '.'); in ascii_to_bin()
218 int i, j, b, k, inbit, obit; in des_init() local
227 * Invert the S-boxes, reordering the input bits. in des_init()
236 * Convert the inverted S-boxes into 4 arrays of 8 bits. in des_init()
237 * Each will handle 12 bits of the S-box input. in des_init()
251 init_perm[final_perm[i] = IP[i] - 1] = (u_char)i; in des_init()
260 inv_key_perm[key_perm[i] - 1] = (u_char)i; in des_init()
268 inv_comp_perm[comp_perm[i] - 1] = (u_char)i; in des_init()
272 * Set up the OR-mask arrays for the initial and final permutations, in des_init()
275 for (k = 0; k < 8; k++) { in des_init()
277 *(il = &ip_maskl[k][i]) = 0L; in des_init()
278 *(ir = &ip_maskr[k][i]) = 0L; in des_init()
279 *(fl = &fp_maskl[k][i]) = 0L; in des_init()
280 *(fr = &fp_maskr[k][i]) = 0L; in des_init()
282 inbit = 8 * k + j; in des_init()
287 *ir |= bits32[obit-32]; in des_init()
291 *fr |= bits32[obit - 32]; in des_init()
296 *(il = &key_perm_maskl[k][i]) = 0L; in des_init()
297 *(ir = &key_perm_maskr[k][i]) = 0L; in des_init()
299 inbit = 8 * k + j; in des_init()
306 *ir |= bits28[obit - 28]; in des_init()
309 *(il = &comp_maskl[k][i]) = 0L; in des_init()
310 *(ir = &comp_maskr[k][i]) = 0L; in des_init()
312 inbit = 7 * k + j; in des_init()
319 *ir |= bits24[obit - 24]; in des_init()
326 * Invert the P-box permutation, and convert into OR-masks for in des_init()
327 * handling the output of the S-box arrays setup above. in des_init()
330 un_pbox[pbox[i] - 1] = (u_char)i; in des_init()
392 * Do key permutation and split into two 28-bit subkeys. in des_setkey()
419 t0 = (k0 << shifts) | (k0 >> (28 - shifts)); in des_setkey()
420 t1 = (k1 << shifts) | (k1 >> (28 - shifts)); in des_setkey()
422 de_keysl[15 - round] = in des_setkey()
423 en_keysl[round] = comp_maskl[0][(t0 >> 21) & 0x7f] in des_setkey()
427 | comp_maskl[4][(t1 >> 21) & 0x7f] in des_setkey()
432 de_keysr[15 - round] = in des_setkey()
433 en_keysr[round] = comp_maskr[0][(t0 >> 21) & 0x7f] in des_setkey()
437 | comp_maskr[4][(t1 >> 21) & 0x7f] in des_setkey()
449 * l_in, r_in, l_out, and r_out are in pseudo-"big-endian" format. in do_des()
467 count = -count; in do_des()
492 while (count--) { in do_des()
499 while (round--) { in do_des()
501 * Expand R to 48 bits (simulate the E-box). in do_des()
603 while (q - (u_char *)keybuf - 8) { in crypt_des()
609 return (-1); in crypt_des()
613 * "new"-style: in crypt_des()
614 * setting - underscore, 4 bytes of count, 4 bytes of salt in crypt_des()
615 * key - unlimited characters in crypt_des()
618 count |= ascii_to_bin(setting[i]) << ((i - 1) * 6); in crypt_des()
621 salt |= ascii_to_bin(setting[i]) << ((i - 5) * 6); in crypt_des()
628 return (-1); in crypt_des()
633 while (q - (u_char *)keybuf - 8 && *key) in crypt_des()
637 return (-1); in crypt_des()
642 * "old"-style: in crypt_des()
643 * setting - 2 bytes of salt in crypt_des()
644 * key - up to 8 characters in crypt_des()
665 return (-1); in crypt_des()