Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756721AbcLPF4H (ORCPT ); Fri, 16 Dec 2016 00:56:07 -0500 Received: from mail-ua0-f182.google.com ([209.85.217.182]:34850 "EHLO mail-ua0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752509AbcLPFz4 (ORCPT ); Fri, 16 Dec 2016 00:55:56 -0500 MIME-Version: 1.0 In-Reply-To: References: <1481618949-20086-1-git-send-email-binoy.jayan@linaro.org> <1481618949-20086-2-git-send-email-binoy.jayan@linaro.org> From: Binoy Jayan Date: Fri, 16 Dec 2016 11:25:16 +0530 Message-ID: Subject: Re: [RFC PATCH v2] crypto: Add IV generation algorithms To: Milan Broz Cc: Oded , Ofir , Herbert Xu , "David S. Miller" , linux-crypto@vger.kernel.org, Mark Brown , Arnd Bergmann , Linux kernel mailing list , Alasdair Kergon , Mike Snitzer , dm-devel@redhat.com, Shaohua Li , linux-raid@vger.kernel.org, Rajendra Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1094 Lines: 26 Hi Milan, On 13 December 2016 at 15:31, Milan Broz wrote: > I think that IV generators should not modify or read encrypted data directly, > it should only generate IV. I was trying to find more information about what you said and how a iv generator should be written. I saw two examples of IV generators too used with AEAD ciphers (crypto/seqiv.c and crypto/echainiv.c) Excerpt from crypto api doc: http://www.chronox.de/crypto-API/crypto/architecture.html#crypto-api-cipher-references-and-priority 2. Now, SEQIV uses the AEAD API function calls to invoke the associated AEAD cipher. In our case, during the instantiation of SEQIV, the cipher handle for GCM is provided to SEQIV. This means that SEQIV invokes AEAD cipher operations with the GCM cipher handle. Here, it says seqiv invokes cipher operations. However the code crypto/seqiv.c does not look similar to how the modes are implemented which is confusing. I was looking for an example of an IV generator used with a regular block cipher and not a AEAD cipher. Could you point me out to some? Thanks, Binoy