Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp544114ybh; Sun, 12 Jul 2020 15:06:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwyfS7vVgG71KnUbUUvKC5EOhywMOdG44TaD1cI6RQsjN1kM+9Q4itfdOFz3dDYdmI+f9eH X-Received: by 2002:a50:d80f:: with SMTP id o15mr89849019edj.156.1594591586293; Sun, 12 Jul 2020 15:06:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594591586; cv=none; d=google.com; s=arc-20160816; b=y1nf1qH8UF7NO/canuxoD1gZwAAEEtePO9kHkYuyu1xJxdwv8oQiVT81/WTjeWt8XL GmUgmXrjx2q+FjDxRzTSYrsjO7lQI4hjlqUuyxEBvhiF51Pt2F/BAx8f45d7yI0hdFVJ sck0OjhdjWvjAA5DqqlAi5O2jgoGZdTAAvdWq2SBUKGNLduwCWdyaCKXISBgoUT6bMSR FsD0gzwNECkZALrqFUhwFz4pJNPcZ7dcAn0JTg0Pk8mvXO5heoxSGmKMzwUHRusiihZX /gbU0Pw4qpTpK6W29e8OQEMKf9DJfOaqh5UanWFAd04c8XSJdO5QMvtBzQbv7VDBHf1X XHNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=CbdwI+GjGXYdV3U47TY5hl6Jlz/QJdBn0tACGHFIeaU=; b=Zl5/lABJ9Ssp5BQI7f3RQ4ma5Kbe1xe6e8MnyEFVvg/RTDz5Nq7A5R9QEhaT3Gdqvq mwrfcmouHvR+cSp53uR/UybBzzntr+KIUwXlXwfrQKVq3sHMxk8yPi5dEWtvRvudvcR1 B+RA2gm+fux5+cbcfLeog6aSKgVbdXyWKxl1b7I8JvRy3dZFVWzcbbXu1pVzD7tLIOE1 9k+wGhFhHI+1UT2T5p2rcVV8JDCdEFAhfuQZ+aOzswsU3ZFgbIvidsp8LffpG+5CRy5I N4eZivdR4y9hJkXaNnfKUWS0lueYzzbjLRxYeQbUlqofDg3kzyRxguq0h96fSkuznfBx oFTA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d3si9106232edn.145.2020.07.12.15.06.03; Sun, 12 Jul 2020 15:06:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729526AbgGLWFv (ORCPT + 99 others); Sun, 12 Jul 2020 18:05:51 -0400 Received: from inva020.nxp.com ([92.121.34.13]:48300 "EHLO inva020.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729020AbgGLWFu (ORCPT ); Sun, 12 Jul 2020 18:05:50 -0400 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 7F7AE1A0D0D; Mon, 13 Jul 2020 00:05:48 +0200 (CEST) Received: from inva024.eu-rdc02.nxp.com (inva024.eu-rdc02.nxp.com [134.27.226.22]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 733101A0CFD; Mon, 13 Jul 2020 00:05:48 +0200 (CEST) Received: from lorenz.ea.freescale.net (lorenz.ea.freescale.net [10.171.71.5]) by inva024.eu-rdc02.nxp.com (Postfix) with ESMTP id 0557A204BE; Mon, 13 Jul 2020 00:05:47 +0200 (CEST) From: Iuliana Prodan To: Herbert Xu , Horia Geanta , Aymen Sghaier Cc: "David S. Miller" , Silvano Di Ninno , Franck Lenormand , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, linux-imx , Iuliana Prodan Subject: [PATCH 0/2] crypto: caam - add tagged keys functionality and tk transformations for skcipher Date: Mon, 13 Jul 2020 01:05:34 +0300 Message-Id: <1594591536-531-1-git-send-email-iuliana.prodan@nxp.com> X-Mailer: git-send-email 2.1.0 X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Tagged keys are keys that contain metadata indicating what they are and how to handle them using the new added tag_object API. A tag object represents the metadata (or simply a header/configuration) and the actual data (e.g. black key) obtained from hardware. Patch #2 adds support, for tagged keys, to skcipher algorithms by adding new transformations, with tk prefix to distinguish between plaintext and tagged keys. 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". tk_ transformations will know how to handle tagged keys, by loading the proper settings for KEY command. Iuliana Prodan (2): crypto: caam - add tag object functionality crypto: caam - support tagged keys for skcipher algorithms drivers/crypto/caam/Kconfig | 9 +++ drivers/crypto/caam/Makefile | 1 + drivers/crypto/caam/caamalg.c | 107 ++++++++++++++++++++++++++++-- drivers/crypto/caam/caamalg_desc.c | 28 ++++++-- drivers/crypto/caam/desc.h | 4 +- drivers/crypto/caam/desc_constr.h | 4 ++ drivers/crypto/caam/tag_object.c | 129 +++++++++++++++++++++++++++++++++++++ drivers/crypto/caam/tag_object.h | 99 ++++++++++++++++++++++++++++ 8 files changed, 372 insertions(+), 9 deletions(-) create mode 100644 drivers/crypto/caam/tag_object.c create mode 100644 drivers/crypto/caam/tag_object.h -- 2.1.0