From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.5 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 65C80C433E3 for ; Thu, 16 Jul 2020 07:36:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3E65A20760 for ; Thu, 16 Jul 2020 07:36:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728208AbgGPHgS (ORCPT ); Thu, 16 Jul 2020 03:36:18 -0400 Received: from helcar.hmeau.com ([216.24.177.18]:39708 "EHLO fornost.hmeau.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725921AbgGPHgS (ORCPT ); Thu, 16 Jul 2020 03:36:18 -0400 Received: from gwarestrin.arnor.me.apana.org.au ([192.168.0.7]) by fornost.hmeau.com with smtp (Exim 4.92 #5 (Debian)) id 1jvyR8-0003l4-CL; Thu, 16 Jul 2020 17:36:11 +1000 Received: by gwarestrin.arnor.me.apana.org.au (sSMTP sendmail emulation); Thu, 16 Jul 2020 17:36:10 +1000 Date: Thu, 16 Jul 2020 17:36:10 +1000 From: Herbert Xu To: Iuliana Prodan Cc: Horia Geanta , Aymen Sghaier , "David S. Miller" , Silvano Di Ninno , Franck Lenormand , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, linux-imx Subject: Re: [PATCH 2/2] crypto: caam - support tagged keys for skcipher algorithms Message-ID: <20200716073610.GA28215@gondor.apana.org.au> References: <1594591536-531-1-git-send-email-iuliana.prodan@nxp.com> <1594591536-531-3-git-send-email-iuliana.prodan@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1594591536-531-3-git-send-email-iuliana.prodan@nxp.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 13, 2020 at 01:05:36AM +0300, Iuliana Prodan wrote: > Tagged keys are keys that contain metadata indicating what > they are and how to handle them using tag_object API. > > Add support, for tagged keys, to skcipher algorithms by > adding new transformations, with _tk_ prefix to distinguish > between plaintext and tagged keys. > > For job descriptors a new option (key_cmd_opt) was added for KEY command. > Tagged keys can be loaded using only a KEY command with ENC=1 > and the proper setting of the EKT bit. The EKT bit in the > KEY command indicates which encryption algorithm (AES-ECB or > AES-CCM) should be used to decrypt the key. These options will be kept in > key_cmd_opt. > > The tk_ transformations can be used directly by their name: > struct sockaddr_alg sa = { > .salg_family = AF_ALG, > .salg_type = "skcipher", /* this selects the symmetric cipher */ > .salg_name = "tk(cbc(aes))" /* this is the cipher name */ > }; > or for dm-crypt, e.g. using dmsetup: > dmsetup -v create encrypted --table "0 $(blockdev --getsz /dev/mmcblk2p10) > crypt capi:tk(cbc(aes))-plain :32:logon:seckey 0 /dev/mmcblk2p10 0 1 > sector_size:512". > > Signed-off-by: Franck LENORMAND > Signed-off-by: Iuliana Prodan Can this use the existing paes name instead of tk as done in other drivers? Thanks, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt