Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp35157597rwd; Mon, 10 Jul 2023 03:31:46 -0700 (PDT) X-Google-Smtp-Source: APBJJlG6Q7ImadPfo7yeZn3IyX1fSAZlizxtEL/abZNuhDHCIyeRfRx/zsmgcTXdP7UGFfPcG4o4 X-Received: by 2002:a05:6a20:3d0c:b0:112:cf5:d5cc with SMTP id y12-20020a056a203d0c00b001120cf5d5ccmr16521797pzi.1.1688985106612; Mon, 10 Jul 2023 03:31:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688985106; cv=none; d=google.com; s=arc-20160816; b=me1fP0ULjO0zJGnOeFLwQO5AlIDkvq0IePNOeQC+LZ+zeKLQT/rIjHrA7H/fwvuHNk nO4ka4/5Mr74TyQKrdrFyXzsruYJO+UVkbMwF+2fq0ZUIYGmyx6fOFJO1u+jo/6b05RT BuwIg7RGbGfIsOVCUZZ724Ko7MP2UTdyZSK54Pj6puPCQo8TH1zJbY8NQYsFmyojP9Ur YbHpvMMKF5QqALUA6fzRmbYMs1xDUR7dTYvKBM+Qf0NZiZ3QneGIEtslmaVZJCH+z0gB zAwLhYkRAwXifYrJz0cuBI9qhlRXZSq6v/3E9Dd+b/N3Mm7iujJbcKpOUgZB86Rkjh5r wjzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=gYP2oWKwpGOXF3gV9wx85l1HhBMYJx0BpeXr6oBux0s=; fh=ZRgAjybieZ7RZpmz0SF8i1Kx5riOlqt/nADXtT2Y8f0=; b=wfbK38ltFVyr8NHvFSBZHI4iGXXnzrTPTTFYRchguKRh5MDHLPJDnQ3tlX382v/TOP 8zM7LV06E8AyqThGZfogXA0zkmssI/FO0tRmpi8kXBQpTipzlZ9W9wLvwNn9EFAHlXIP 6IMfpwykIAeo8k4wGp3Yt0DLQ2/uIdaJmG52whH1E79TFfLIQYgbHBsg0MG0VV+O4+iA wHJ8dVPxzUm9N6MptfRI3I0pCY74gOOeVmQLpGrua3f+1kNoIPUPIiMLgYufkaXNREhP EazFALebsf/MsHO8PmB9HwIA2y2a1hZUNF5fOM+GrHavq+3x+NDfTrtjyeAMvrY/BBI6 GAgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=EJYUqlWT; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 189-20020a6302c6000000b0055379a7131csi9355813pgc.721.2023.07.10.03.31.29; Mon, 10 Jul 2023 03:31:46 -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=@gmail.com header.s=20221208 header.b=EJYUqlWT; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230340AbjGJKX1 (ORCPT + 99 others); Mon, 10 Jul 2023 06:23:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36908 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230064AbjGJKX1 (ORCPT ); Mon, 10 Jul 2023 06:23:27 -0400 Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E493594; Mon, 10 Jul 2023 03:23:22 -0700 (PDT) Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-1b9d9cbcc70so1918275ad.0; Mon, 10 Jul 2023 03:23:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1688984601; x=1689589401; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=gYP2oWKwpGOXF3gV9wx85l1HhBMYJx0BpeXr6oBux0s=; b=EJYUqlWTVoCvlErini+i5t+RO+70VyZYNmqjGO2hkLVg3c419s6BVBkuZVfDDtOo/M IQERf7ZynzFsIzRLurkjcBsmQoVGTyjNXFGso5tnGMXF0LPE8neLGAyXDQPoNQTLNR0J ndktOzuBYrAYeEOiXkmBCaB33yXNr4wPOCzxn0hDBIXqZ46E1qze+HeI06+zjzUs9tu3 e7V2LMF6uS6h5pUcT3IwtbvNEKtMEO0od9qvIKUy9EtNt1PnPtfwPGPTuKwrdf+gzSBp cHCbA+rp5weNWFS4A0/XQI+et1QbuRVFaH5MbKP8WwWoVL/jooVJYYi4qU0l9Qf6AJnp nYmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688984601; x=1689589401; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=gYP2oWKwpGOXF3gV9wx85l1HhBMYJx0BpeXr6oBux0s=; b=Jro+tF+vHdu7WFM2PGpnf7blqB1M6sA3aHjYwriEMXez3pgJWYPdNSCeAt0COdhicH dJAQf929ZbEBQ3pIMIWMN6yygwMA6LE5C2mK7TYtAVvSVdgmTxy+Q8eFmfXAQTFY1WKO KfXkdHFai3xAe9ALzDK/1F2lqtrArMl3gEjF5l3pjBgzdEppqjyhLlk16tJxSGSkJ5uQ J/bOfBYxf4Vusd/pFEu75n9q0RUOedEEfbhzNUPEmQtKgmLIQE59FxpPQI9teH125qOX Ov1cao/0R1VsKnHjsGQeqzJEX1jsZqOgyEyrNlvmSb/tBJRmZO5Ij8zQ78EiFktAd0K/ jMfg== X-Gm-Message-State: ABy/qLYdBzVlL5D3KxqOK1jnNSzZW70Y6uelg6x5Rfbtsa/4K4PRAJ64 AiR36mzKE5/cTVO+F06VZTfjsvlMkc3yaUfn X-Received: by 2002:a17:902:da92:b0:1b3:d8ac:8db3 with SMTP id j18-20020a170902da9200b001b3d8ac8db3mr15565140plx.6.1688984601091; Mon, 10 Jul 2023 03:23:21 -0700 (PDT) Received: from ip-172-30-47-114.us-west-2.compute.internal (ec2-54-68-170-188.us-west-2.compute.amazonaws.com. [54.68.170.188]) by smtp.gmail.com with ESMTPSA id d5-20020a170902cec500b001b5656b0bf9sm7901984plg.286.2023.07.10.03.23.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jul 2023 03:23:20 -0700 (PDT) From: FUJITA Tomonori To: rust-for-linux@vger.kernel.org, linux-crypto@vger.kernel.org Cc: alex.gaynor@gmail.com, herbert@gondor.apana.org.au, ebiggers@kernel.org, benno.lossin@proton.me Subject: [PATCH v2 0/3] Rust abstractions for Crypto API Date: Mon, 10 Jul 2023 19:22:22 +0900 Message-Id: <20230710102225.155019-1-fujita.tomonori@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 This patchset adds minimum Rust abstractions for Crypto API; message digest and random number generator. I'm trying to upstream network and crypto abstractions separately so v2 has only crypto stuff. Changes since v1 [1]: - ShashDesc::new() returns the initialized object. - checks the length of buffer. - fix a compile error without CONFIG_CRYPTO. - adds RNG support. - drops network code. - updates the CRYPTO API entry. [1] https://lore.kernel.org/netdev/010101881db036fb-2fb6981d-e0ef-4ad1-83c3-54d64b6d93b3-000000@us-west-2.amazonses.com/T/ FUJITA Tomonori (3): rust: crypto abstractions for synchronous message digest API rust: crypto abstractions for random number generator API MAINTAINERS: add Rust crypto abstractions files to the CRYPTO API entry MAINTAINERS | 2 + rust/bindings/bindings_helper.h | 2 + rust/helpers.c | 38 ++++++++++ rust/kernel/crypto.rs | 6 ++ rust/kernel/crypto/hash.rs | 128 ++++++++++++++++++++++++++++++++ rust/kernel/crypto/rng.rs | 101 +++++++++++++++++++++++++ rust/kernel/lib.rs | 2 + 7 files changed, 279 insertions(+) create mode 100644 rust/kernel/crypto.rs create mode 100644 rust/kernel/crypto/hash.rs create mode 100644 rust/kernel/crypto/rng.rs -- 2.34.1