Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp249362rwe; Fri, 14 Apr 2023 02:05:08 -0700 (PDT) X-Google-Smtp-Source: AKy350YMUSu10zjdbiY8glV/I9mKJf4CrP2qbEWTOjY/Ec/IfKHh0xvhFT8EprgQtuAj3KcMYRrG X-Received: by 2002:a05:6a21:6da2:b0:ec:6383:c757 with SMTP id wl34-20020a056a216da200b000ec6383c757mr1610144pzb.0.1681463107896; Fri, 14 Apr 2023 02:05:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681463107; cv=none; d=google.com; s=arc-20160816; b=e5NI2HWlgvMqhKENnBwsec5c2P8soPZ3G9qbbF+6mkfY5/7aBsD+wu6K37gOMXe5jx hD5it339qbGRn8u5AOTX73i5XetYukLI9xNpo7wUXAJ40m2gG5yWcWepySf6ySSqJs9Z OXNqN5ntHwOQ4q6rtfC/I8XS/lDIDdJ03cJg63GwAkJIb3Ws2wETIBfhjZgzzdiRVQ0I 7olR0PdwR0wWlVxp2dW6XpXXVGvM5VJEvnNa5R3r/ptmTHxwxH12qiZs0KtfIyaDPBAp fcM+Q8NkpdEBJgNnJWpxsbabtqcqO7RwtFu+BgGUV+iOF0AV++/qptXpWtPffUWYF8dy 40PQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:from:content-id:mime-version :subject:cc:to:references:in-reply-to:organization:dkim-signature; bh=jb/RqJ7lTYgOp0Zg/Ax0skaO2qNbV/j6uuRXrVdlbsY=; b=o9yeko/+nH6wZkKg4O0/tlu67qtLPITZh6lQ0OlmgltlaUdGmQX+Yeq5x2BlfuZm5j C8vENZJVYvwATRS5F/dyo3at2Sq5/32q0Bpd+K3peRtf4bl55hVaRzJUFyTm+S+y/YlU qJ7A9pSx76Zsnt3vtf7Nm+IoRrkDAeo3a6wh4pnYQRGdknYGe2Locc2iyS4s2m73DgCc RdU0wF6EbxOUEiPLqFpeZ9B16OEzjfSJdsaltoGj1ANiNmvzp8grubjJIhkbLy5EEcWH nBGRZHIrcL1nrHNP/n+3gjmhCzHVNjSnbqtyIm/MI6BxDIJ80fAkQzxkjARbHV5GWGID 6teA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=fRXiY6iy; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b11-20020a63d30b000000b0051b3d534187si4359442pgg.576.2023.04.14.02.04.42; Fri, 14 Apr 2023 02:05:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=fRXiY6iy; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229933AbjDNIs7 (ORCPT + 99 others); Fri, 14 Apr 2023 04:48:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229703AbjDNIs6 (ORCPT ); Fri, 14 Apr 2023 04:48:58 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F4625BB0 for ; Fri, 14 Apr 2023 01:47:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1681462063; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=jb/RqJ7lTYgOp0Zg/Ax0skaO2qNbV/j6uuRXrVdlbsY=; b=fRXiY6iy49r3ANS2iaL3v6ggdQmEVgMkrugcZjFoVyMYHUv4TcO4oCHL2ZRkco6GxGjApd NE8lgCKjurL0M7kKZQsxYK93tEISDPhviFCfrnRoDc4C1zgxpAV3f4EumfC57HoZMW8y6s JU90Ts+GeaOI8J9laKkmYEJ658cqa/U= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-480-UUVI9vDUNtibQQKhwMkfkw-1; Fri, 14 Apr 2023 04:47:39 -0400 X-MC-Unique: UUVI9vDUNtibQQKhwMkfkw-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1C27085A588; Fri, 14 Apr 2023 08:47:39 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.33.36.5]) by smtp.corp.redhat.com (Postfix) with ESMTP id 136FE2166B26; Fri, 14 Apr 2023 08:47:37 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 In-Reply-To: References: <48886D84-1A04-4B07-A666-BB56684E759F@oracle.com> <380323.1681314997@warthog.procyon.org.uk> <1078650.1681394138@warthog.procyon.org.uk> To: Herbert Xu Cc: dhowells@redhat.com, Chuck Lever III , Scott Mayhew , Ard Biesheuvel , Jeff Layton , Linux NFS Mailing List , "linux-crypto@vger.kernel.org" Subject: Re: Did the in-kernel Camellia or CMAC crypto implementation break? MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1235645.1681461986.1@warthog.procyon.org.uk> From: David Howells Date: Fri, 14 Apr 2023 09:47:37 +0100 Message-ID: <1235770.1681462057@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Herbert Xu wrote: > Now that you have it working, perhaps you could convert some of > your test vectors into crypto API test vectors? Actually, I was wondering about that. I see that all the testing data seems to be statically loaded in testmgr.[ch], even if the algorithms to be tested are resident in modules that aren't loaded yet (so it's kind of test "on demand"). I guess it can't be split up amongst the algorithm modules as some of the tests require stuff from multiple modules (eg. aes + cbs + cts). If I'm going to do that, I presume I'd need to create an API akin to the skcipher API or the hash API, say, to do autoload/create krb5 crypto. Maybe loading with something like: struct crypto_krb5 *alg; alg = crypto_alloc_krb5("aes256-cts-hmac-sha384-192", 0, CRYPTO_ALG_ASYNC); and split the algorithms into separate modules? Much of the code would still end up in a common module, though. Note that each algorithm can be asked to do four different things and has four different types of test: - PRF calculation - Key derivation - Encryption/decryption - Checksum generation/verification David