Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp2340140rdb; Sun, 3 Dec 2023 12:33:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IGRBHL6k1OYx7Cf4A2kE2AfiYBOPHqc20x/s6NctvOkdY9gCB0Y751SDGNT0HlGHZNqlesl X-Received: by 2002:ac8:59cc:0:b0:425:4043:50c9 with SMTP id f12-20020ac859cc000000b00425404350c9mr4173474qtf.88.1701635627087; Sun, 03 Dec 2023 12:33:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701635627; cv=none; d=google.com; s=arc-20160816; b=ej0bU05gHtkKLKUyslRAWR2KE1MuIY9X8ZyTLeYD2JmEpnfWGjomwQvWj+3TiJkdCE Mh7vCsv2B+q5Zu+xmv6m8aBS3UbbxRQsbHg/UBVOIB5meu8QYdkQNGf+X8YRwThWd931 WMG90mH7EwBfsTfz49t8w+Cu6em5AMEuaAttHkh17A4lowAqYuMy4QypDWMtIHQfPlH0 q1SjVv1DdAJ0XXkRsJfgBR2khovLneVnvXZFgsQz9JAoOvJ+TCyWrB1EWx2ECVgxjG6+ FMaGkJnazR+ZQ3WYPX/fAGiJtwLDiNNrtSQGXmN61MB8WtKRWA3SUo2kfDZNO+f/6gAI gjeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:dkim-signature:message-id; bh=WrcuaLhGqZyLcCzhjZbCK/3gCaj2ccG1Zvyabs5yjRI=; fh=Oxy+rETYMYvGxVmqLg6qMMq8N+F27F5oN59kkK+eWgo=; b=HYUE633b/yBE4TtjHaIB3lCwOw0ehiQGFci/q/9V7XyYBhY35ICNjPbw+tA0X4fK5G mOSRXLwWE15MJHKaj1qAYxGMx46KFrRadw+P5GfbtlFHYxQmDtNRTNVMbFizo2vpUPt+ piiEzXtV0XZisrfeyOcEX+ryFJQ0P/r/fuKJjZMpgm9gD1Dnjtee1Vf8ah52T1RM/GJm yEwk+xNf4G528vGFhTnTban1S0cXGLnOITGnkKoiVJihhZngHhd0Kp3njsadUOAdUoLe 0SmgoSi2O4zVEJ/GlXJE+1CArQlEgFP0RGsup++Wq0mcqrSVwVGN7mIXhH548mA7UZQE x0ZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=hDNVZNuf; spf=pass (google.com: domain of linux-crypto+bounces-518-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-crypto+bounces-518-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id f4-20020a05622a114400b0042376ba4ee0si8418087qty.281.2023.12.03.12.33.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Dec 2023 12:33:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto+bounces-518-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=hDNVZNuf; spf=pass (google.com: domain of linux-crypto+bounces-518-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-crypto+bounces-518-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id C393D1C20829 for ; Sun, 3 Dec 2023 20:33:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 32B251EB42 for ; Sun, 3 Dec 2023 20:33:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="hDNVZNuf" X-Original-To: linux-crypto@vger.kernel.org Received: from out-181.mta1.migadu.com (out-181.mta1.migadu.com [95.215.58.181]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 84E94A9; Sun, 3 Dec 2023 12:00:52 -0800 (PST) Message-ID: <84d81e44-b3eb-c4d0-aad3-6014fd7cef43@linux.dev> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1701633650; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=WrcuaLhGqZyLcCzhjZbCK/3gCaj2ccG1Zvyabs5yjRI=; b=hDNVZNufE6YSFIU1lV56tX4eUvDPKxP/PH9VGERwhswSJqv0lSXJkRriWUAYeArvbT2M4X jTRb5nyR92hX7oJ0NpE4GXP/Ga0vyingFtx5RDfV8iZQ8dFxVwTzkzl35Tq6XV8ZohF4P6 8v01eZJEJAW/VWDohj5ljebycZTU5vg= Date: Sun, 3 Dec 2023 20:00:48 +0000 Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [PATCH bpf-next v7 2/3] bpf: crypto: add skcipher to bpf crypto Content-Language: en-US To: Herbert Xu , Vadim Fedorenko Cc: Jakub Kicinski , Martin KaFai Lau , Andrii Nakryiko , Alexei Starovoitov , Mykola Lysenko , netdev@vger.kernel.org, linux-crypto@vger.kernel.org, bpf@vger.kernel.org References: <20231202010604.1877561-1-vadfed@meta.com> <20231202010604.1877561-2-vadfed@meta.com> X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Vadim Fedorenko In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT On 02.12.2023 03:52, Herbert Xu wrote: > On Fri, Dec 01, 2023 at 05:06:03PM -0800, Vadim Fedorenko wrote: >> >> +static int bpf_crypto_lskcipher_encrypt(void *tfm, const u8 *src, u8 *dst, >> + unsigned int len, u8 *iv) >> +{ >> + return crypto_lskcipher_encrypt(tfm, src, dst, len, iv); >> +} > > Please note that the API has been updated and the iv field is now > the siv. For algorithms with a non-zero statesize, that means that > the IV must be followed by enough memory to store the internal state, > i.e., crypto_lskcipher_statesize(tfm). > > Thanks, Hi Herbert! Thanks for the reminder. I have read v3 of your patchset and AFAIU only arc4 is affected right now. All other algorithms still have statesize=0, so should work without any changes. I'll make a TODO note for myself to add state size check in bpf_crypto part once different trees are merged during merge window. Am I right that it only affects skcipher and AEAD crypto will not be changed? Thanks, Vadim