dm-crypt.c (255e2646496fcbf836a3dfe1b535692f09f11b45) dm-crypt.c (a4a82ce3d24d4409143a7b7b980072ada6e20b2a)
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * Copyright (C) 2003 Jana Saout <jana@saout.de>
4 * Copyright (C) 2004 Clemens Fruhwirth <clemens@endorphin.org>
5 * Copyright (C) 2006-2020 Red Hat, Inc. All rights reserved.
6 * Copyright (C) 2013-2020 Milan Broz <gmazyland@gmail.com>
7 *
8 * This file is released under the GPL.

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

359 int log;
360
361 if (crypt_integrity_aead(cc))
362 bs = crypto_aead_blocksize(any_tfm_aead(cc));
363 else
364 bs = crypto_skcipher_blocksize(any_tfm(cc));
365 log = ilog2(bs);
366
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * Copyright (C) 2003 Jana Saout <jana@saout.de>
4 * Copyright (C) 2004 Clemens Fruhwirth <clemens@endorphin.org>
5 * Copyright (C) 2006-2020 Red Hat, Inc. All rights reserved.
6 * Copyright (C) 2013-2020 Milan Broz <gmazyland@gmail.com>
7 *
8 * This file is released under the GPL.

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

359 int log;
360
361 if (crypt_integrity_aead(cc))
362 bs = crypto_aead_blocksize(any_tfm_aead(cc));
363 else
364 bs = crypto_skcipher_blocksize(any_tfm(cc));
365 log = ilog2(bs);
366
367 /* we need to calculate how far we must shift the sector count
368 * to get the cipher block count, we use this shift in _gen */
369
367 /*
368 * We need to calculate how far we must shift the sector count
369 * to get the cipher block count, we use this shift in _gen.
370 */
370 if (1 << log != bs) {
371 ti->error = "cypher blocksize is not a power of 2";
372 return -EINVAL;
373 }
374
375 if (log > 9) {
376 ti->error = "cypher blocksize is > 512";
377 return -EINVAL;

--- 3302 unchanged lines hidden ---
371 if (1 << log != bs) {
372 ti->error = "cypher blocksize is not a power of 2";
373 return -EINVAL;
374 }
375
376 if (log > 9) {
377 ti->error = "cypher blocksize is > 512";
378 return -EINVAL;

--- 3302 unchanged lines hidden ---