Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp6418603pxu; Thu, 24 Dec 2020 01:36:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJzc6AhpdhDQDACC+pCpxBH3c1Dl2l8yp6Pcx5nOBs/5YKcE9TmKZMKaPihpPrJLCuEk/L+d X-Received: by 2002:aa7:d2c9:: with SMTP id k9mr27874088edr.74.1608802571001; Thu, 24 Dec 2020 01:36:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608802570; cv=none; d=google.com; s=arc-20160816; b=mJ0kUehpNsmr6D5DyGMED9lHaoPmczjuR152Ow7hXOtV1H14ECfmiLId75p0DcgnJZ b6+qUen0sUBLkn8FwqzWl5tGi2AOV9Y7nO+rNOjVPu8ztm4IghMWWqha5oALxKZzQ0Bw ydAoYed6yFhHjIKvtj3vLk92EH0Kyeqck2mTRkW+n1iBJyE49TBmmyIQj0LZarbmXmj8 LXV+HN2iOTyWquJ1YxuAslAcKGiGepGsYvIrmno6PwgpW6gYCSLmPVFM9WNrB1rj/iry gCLWHyqUkcsPy5cF7OJbF1EtjdrY+T0gcclL4iykju4RUpoCwoa6ih2fiYaRswwZxSZ7 FocA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=4XfVxxDWXarYzvcm/E8/0oqF+lQgHrMQTnHY7kOdbxU=; b=WBtUdwEBQWpGOYCbJ23+BdJogkwHq2UCxEco016N5WczAHObNgzcjtE4NKI1lTkK8/ 3J86D9zmKXN6HUPL7/0vJDZJBJtxFoohDbU2r66mvWE0X/XjHI7eMLsqmgfFJgncZsUb uknhEcHZQBXQaRDoKoCTZm9HKY/SUYwQJ3paqUKZNVXqVK4vOD7rSbBO9NBpEz1ZuB3R yfVRJUl2EFm3BF9hmLSxab+vjfFYcNSDb9KhXa/R0VklcAmyKpqjg/drTSc8e22BdGEV KapXLJ5Sf8HAgtgzqiEBFa3W6+0mdDbooHABBFukW0wfcPe6Tyv9mlu+mkibr8FiifEu BD+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=axpvuOY9; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i1si14457793eds.174.2020.12.24.01.35.49; Thu, 24 Dec 2020 01:36:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=axpvuOY9; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727778AbgLXJeJ (ORCPT + 99 others); Thu, 24 Dec 2020 04:34:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40508 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726159AbgLXJeI (ORCPT ); Thu, 24 Dec 2020 04:34:08 -0500 Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F69BC06179C for ; Thu, 24 Dec 2020 01:33:28 -0800 (PST) Received: by mail-wm1-x32a.google.com with SMTP id q75so1171397wme.2 for ; Thu, 24 Dec 2020 01:33:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=4XfVxxDWXarYzvcm/E8/0oqF+lQgHrMQTnHY7kOdbxU=; b=axpvuOY9nFCk9VLhGK4sRl15qfMpZgnJgt0E1KA68xlu4peINsnUTnnatLWFrk4bEu 9A/vZ7J1JKJWA88F0EOHwSu9IeZmTBkkhn0lHBi/jibKYm9pLr72Wy0BrbVrE0S8K3aM 5OvPrn3vZFc/4I8ZTGdjEiJdDAZr2v4baEL0Yi7ZiUAvmPtNDc6Ny5cON1V12Z1V80G0 /ggPI5g1OVp/boOyZaANdjKNd0W9ZMjFKN2q1Y2YRf9ou3v2J3KNuMpilDnOhOM/44ln wTa19Wa9atlf5BHqKf6mHRtz3Gnd9bIWhzIL92INFHvEEq/WPNJgyC2/eN+vaqIk0vDz 8bTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=4XfVxxDWXarYzvcm/E8/0oqF+lQgHrMQTnHY7kOdbxU=; b=tjzVnnr0c213epeXWWx3U9BPuyedlC032FKuDCDPvSWQa9CUrX53WOH96Irj1c7vzZ 0eTkwpRhTbl5WclKk7+ZeliB4w3dQbMLoqlNMbJ3qBd13+pjQJ7/sz6jkmLmxCv4HJKE SN9MglgSYFCXiCVBJ2eVn5/Gy4pOCMoHYpn9jM19wMweIvxG6IKhE4fq7Ob/jkeMy9fz sTaP+Ga8khepgRFUdYF8R4Ciin5LkWTm0E4X7pW5p/w2yME/3aM44ga0THS5K6nz5aFS scuoGoKWsph1mydrXtNfBtLBMtgL5migqwKk3mzXLLTcEoYuuyk1XZyMjjCZgL7IUhdy qjng== X-Gm-Message-State: AOAM533L3fHexsE8hYx+aXJfh1lUyRNn8l47LpW3jhJl9rdLwQ6WivzL Glr1Z3Y3OnFZ3pesdzjZPHU= X-Received: by 2002:a7b:c052:: with SMTP id u18mr2443719wmc.139.1608802406782; Thu, 24 Dec 2020 01:33:26 -0800 (PST) Received: from [192.168.2.27] (39.35.broadband4.iol.cz. [85.71.35.39]) by smtp.gmail.com with ESMTPSA id o17sm39463525wrg.32.2020.12.24.01.33.25 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 24 Dec 2020 01:33:26 -0800 (PST) Subject: Re: [RFC PATCH 00/10] crypto: x86 - remove XTS and CTR glue helper code To: Ard Biesheuvel , linux-crypto@vger.kernel.org Cc: dm-devel@redhat.com, Megha Dey , Eric Biggers , Herbert Xu , Mike Snitzer References: <20201223223841.11311-1-ardb@kernel.org> From: Milan Broz Message-ID: Date: Thu, 24 Dec 2020 10:33:24 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <20201223223841.11311-1-ardb@kernel.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On 23/12/2020 23:38, Ard Biesheuvel wrote: > After applying my performance fixes for AES-NI in XTS mode, the only > remaining users of the x86 glue helper module are the niche algorithms > camellia, cast6, serpent and twofish. > > It is not clear from the history why all these different versions of these > algorithms in XTS and CTR modes were added in the first place: the only > in-kernel references that seem to exist are to cbc(serpent), cbc(camellia) > and cbc(twofish) in the IPsec stack. The XTS spec only mentions AES, and > CTR modes don't seem to be widely used either. FYI: Serpent, Camellia and Twofish are used in TrueCrypt/VeraCrypt implementation; cryptsetup and I perhaps even VeraCrypt itself tries to use native dm-crypt mapping. (They also added Russian GOST Kuznyechik with XTS, but this is not in mainline, but Debian packages it as gost-crypto-dkms). Serpent and Twofish can be also used with LRW and CBC modes (for old containers only). Cryptsetup uses crypto userspace API to decrypt the key from header, then it configures dm-crypt mapping for data. We need both use and in-kernel API here. For reference, see this table (my independent implementation of TrueCrypt/VeraCrypt modes, it should be complete history though): https://gitlab.com/cryptsetup/cryptsetup/-/blob/master/lib/tcrypt/tcrypt.c#L77 If the above still works (I would really like to have way to open old containers) it is ok to do whatever you want to change here :-) I have no info that CTR is used anywhere related to dm-crypt (IIRC it can be tricked to be used there but it does not make any sense). Thanks, Milan