Lines Matching defs:key
64 /* Use the key schedule specific in the standard (ANSI X3.92-1981) */
273 static void deskey(const u8 *key, int decrypt, u32 *keyout)
282 ((key[l >> 3U] & bytebit[m]) == bytebit[m] ? 1 : 0);
399 int des_encrypt(const u8 *clear, const u8 *key, u8 *cypher)
405 /* Add parity bits to the key */
408 tmp = key[i];
428 void des_key_setup(const u8 *key, u32 *ek, u32 *dk)
430 deskey(key, 0, ek);
431 deskey(key, 1, dk);
457 void des3_key_setup(const u8 *key, struct des3_key_s *dkey)
459 deskey(key, 0, dkey->ek[0]);
460 deskey(key + 8, 1, dkey->ek[1]);
461 deskey(key + 16, 0, dkey->ek[2]);
463 deskey(key, 1, dkey->dk[2]);
464 deskey(key + 8, 0, dkey->dk[1]);
465 deskey(key + 16, 1, dkey->dk[0]);
469 void des3_encrypt(const u8 *plain, const struct des3_key_s *key, u8 *crypt)
475 desfunc(work, key->ek[0]);
476 desfunc(work, key->ek[1]);
477 desfunc(work, key->ek[2]);
483 void des3_decrypt(const u8 *crypt, const struct des3_key_s *key, u8 *plain)
489 desfunc(work, key->dk[0]);
490 desfunc(work, key->dk[1]);
491 desfunc(work, key->dk[2]);