hifn_795x.c (552c69b36ebd966186573b9c7a286b390935cce1) hifn_795x.c (231baecdef7a906579925ccf1bd45aa734f32320)
1/*
2 * 2007+ Copyright (c) Evgeniy Polyakov <johnpol@2ka.mipt.ru>
3 * All rights reserved.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.

--- 1947 unchanged lines hidden (view full) ---

1956 crypto_ablkcipher_set_flags(cipher, CRYPTO_TFM_RES_BAD_KEY_LEN);
1957 return -1;
1958 }
1959
1960 if (len == HIFN_DES_KEY_LENGTH) {
1961 u32 tmp[DES_EXPKEY_WORDS];
1962 int ret = des_ekey(tmp, key);
1963
1/*
2 * 2007+ Copyright (c) Evgeniy Polyakov <johnpol@2ka.mipt.ru>
3 * All rights reserved.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.

--- 1947 unchanged lines hidden (view full) ---

1956 crypto_ablkcipher_set_flags(cipher, CRYPTO_TFM_RES_BAD_KEY_LEN);
1957 return -1;
1958 }
1959
1960 if (len == HIFN_DES_KEY_LENGTH) {
1961 u32 tmp[DES_EXPKEY_WORDS];
1962 int ret = des_ekey(tmp, key);
1963
1964 if (unlikely(ret == 0) && (tfm->crt_flags & CRYPTO_TFM_REQ_WEAK_KEY)) {
1964 if (unlikely(ret == 0) &&
1965 (tfm->crt_flags & CRYPTO_TFM_REQ_FORBID_WEAK_KEYS)) {
1965 tfm->crt_flags |= CRYPTO_TFM_RES_WEAK_KEY;
1966 return -EINVAL;
1967 }
1968 }
1969
1970 dev->flags &= ~HIFN_FLAG_OLD_KEY;
1971
1972 memcpy(ctx->key, key, len);

--- 722 unchanged lines hidden ---
1966 tfm->crt_flags |= CRYPTO_TFM_RES_WEAK_KEY;
1967 return -EINVAL;
1968 }
1969 }
1970
1971 dev->flags &= ~HIFN_FLAG_OLD_KEY;
1972
1973 memcpy(ctx->key, key, len);

--- 722 unchanged lines hidden ---