Lines Matching refs:key

39  * encryption context with a key.
41 * A DES key is 64bit wide but only 56bits of the key are used. The remaining
48 * After initializing a context with a key you could use this context to
56 * unsigned char key[8];
62 * * Fill 'key' and 'plaintext' with some data *
66 * des_setkey(context, key);
171 static int is_weak_key ( const byte *key );
486 * rawkey: 8 Bytes of key data
581 * Fill a DES context with subkeys calculated from a 64bit key.
586 des_setkey (struct _des_ctx *ctx, const byte * key)
602 des_key_schedule (key, ctx->encrypt_subkeys);
786 * Check whether the 8 byte key is weak.
787 * Does not check the parity bits of the key but simple ignore them.
790 is_weak_key ( const byte *key )
797 work[i] = key[i] & 0xfe;
799 /* binary search in the weak key table */
840 byte key[8] =
851 des_setkey (des, key);
856 memcpy (key, temp3, 8);
897 struct { byte key[24]; byte plain[8]; byte cipher[8]; } testdata[] = {
967 tripledes_set3keys (des3, testdata[i].key,
968 testdata[i].key + 8, testdata[i].key + 16);
981 * Check the weak key detection. We simply assume that the table
982 * with weak keys is ok and check every key in the table if it is
999 return "weak key table defect";
1003 return "DES weak key detection failed";
1011 do_tripledes_setkey ( void *context, const byte *key, unsigned keylen )
1018 tripledes_set3keys ( ctx, key, key+8, key+16);
1022 else if (is_weak_key (key) || is_weak_key (key+8) || is_weak_key (key+16))
1075 do_des_setkey (void *context, const byte *key, unsigned keylen)
1082 des_setkey (ctx, key);
1084 if (is_weak_key (key)) {