des_generic.c (58e16d792a6a8c6b750f637a4649967fcac853dc) des_generic.c (6ee41e5420d0afa8cddf09aa7384dabe570f8dc7)
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * Cryptographic API.
4 *
5 * DES & Triple DES EDE Cipher Algorithms.
6 *
7 * Copyright (c) 2005 Dag Arne Osvik <da@osvik.no>
8 */

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

836 ROUND(R, L, A, B, K, -2);
837 }
838 FP(R, L, A);
839
840 d[0] = cpu_to_le32(R);
841 d[1] = cpu_to_le32(L);
842}
843
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * Cryptographic API.
4 *
5 * DES & Triple DES EDE Cipher Algorithms.
6 *
7 * Copyright (c) 2005 Dag Arne Osvik <da@osvik.no>
8 */

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

836 ROUND(R, L, A, B, K, -2);
837 }
838 FP(R, L, A);
839
840 d[0] = cpu_to_le32(R);
841 d[1] = cpu_to_le32(L);
842}
843
844/*
845 * RFC2451:
846 *
847 * For DES-EDE3, there is no known need to reject weak or
848 * complementation keys. Any weakness is obviated by the use of
849 * multiple keys.
850 *
851 * However, if the first two or last two independent 64-bit keys are
852 * equal (k1 == k2 or k2 == k3), then the DES3 operation is simply the
853 * same as DES. Implementers MUST reject keys that exhibit this
854 * property.
855 *
856 */
857int __des3_ede_setkey(u32 *expkey, u32 *flags, const u8 *key,
858 unsigned int keylen)
859{
860 int err;
861
862 err = __des3_verify_key(flags, key);
863 if (unlikely(err))
864 return err;

--- 133 unchanged lines hidden ---
844int __des3_ede_setkey(u32 *expkey, u32 *flags, const u8 *key,
845 unsigned int keylen)
846{
847 int err;
848
849 err = __des3_verify_key(flags, key);
850 if (unlikely(err))
851 return err;

--- 133 unchanged lines hidden ---