Lines Matching defs:key

8  * 256-bit key length added March 20, 1999
23 * the matrix operations in the key schedule, see the book _Contemporary
294 * definition of the RS matrix in the key schedule. Elements of that field
465 * of the key bytes, and w, x, y, and z, are the column of constants from
469 if (key[i]) { \
470 tmp = poly_to_exp[key[i] - 1]; \
477 /* Macros to calculate the key-dependent S-boxes for a 128-bit key using
510 * output of previous stages. j is the index of the first key byte to use.
520 * preprocessed through q1; j is the index of the first key byte to use.
526 * key byte to use. CALC_K256 is identical to CALC_K but for using the
530 mds[0][q0[a ^ key[(j) + 8]] ^ key[j]] \
531 ^ mds[1][q0[b ^ key[(j) + 9]] ^ key[(j) + 1]] \
532 ^ mds[2][q1[c ^ key[(j) + 10]] ^ key[(j) + 2]] \
533 ^ mds[3][q1[d ^ key[(j) + 11]] ^ key[(j) + 3]]
543 CALC_K_2 (q0[a ^ key[(j) + 16]], \
544 q1[b ^ key[(j) + 17]], \
545 q0[c ^ key[(j) + 18]], \
546 q1[d ^ key[(j) + 19]], j)
556 CALC_K192_2 (q1[b ^ key[(j) + 24]], \
557 q1[a ^ key[(j) + 25]], \
558 q0[a ^ key[(j) + 26]], \
559 q0[b ^ key[(j) + 27]], j)
568 /* Perform the key setup. */
569 int __twofish_setkey(struct twofish_ctx *ctx, const u8 *key,
577 /* The S vector used to key the S-boxes, split up into individual bytes.
585 /* Check key length. */
587 return -EINVAL; /* unsupported key length */
610 if (key_len == 24 || key_len == 32) { /* 192- or 256-bit key */
622 if (key_len == 32) { /* 256-bit key */
640 * and speeded up key setup by 7%:
654 } else if (key_len == 24) { /* 192-bit key */
667 } else { /* 128-bit key */
686 int twofish_setkey(struct crypto_tfm *tfm, const u8 *key, unsigned int key_len)
688 return __twofish_setkey(crypto_tfm_ctx(tfm), key, key_len);