Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp1227534ybg; Fri, 18 Oct 2019 14:10:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqxdaBlb7bzQHhaCimgB030B8y5U3oViT5K7TkuPwOhA5f5KoflZob5bI5ZR4ks7zp4beG9A X-Received: by 2002:a17:906:b817:: with SMTP id dv23mr10653347ejb.22.1571433036588; Fri, 18 Oct 2019 14:10:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571433036; cv=none; d=google.com; s=arc-20160816; b=NJfRdUY48So6Snebp33dZcBCx/pDbUuS0wP0EPz1yZ+jldOrZKqfkdEJeS6KXziYDF XAHai8B8DM/rmTR1O88w72C1ra5sNsDKbdfJFeyBhKmQFIZ8gjgMzWTw7/r/+an3IPSo drvUoY8tvU01YccRWTKgVpyN7EnKtpEN+MkHAc75/XsI9dTPRCjzD8msBszVLVR62lJe gn5qzWx8WG3TrHDSEzWOg2xHesS9c2EOxSxOuPb0Vi48k13/Y6k2qty0FJX4CLz/uhW2 +ASIQi3FUenFw7FtsyA4f9xks2GyCKF9juoDBIXGVS/ocDLw2kW5zNjZkV9hENSZUpL3 hHew== 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 :dkim-signature; bh=aTLhNcek6xPUcSJYqH/7VnHiyCYLdIPPndN1mNRNi1I=; b=Oq/A1zGjPwvwMJrveo7ntY71i7yWjfEhfAOnLu+2GTiCHuhV6e5EV+xyXPYTCjzimy ZgmAyCq/TGc3NMiTvdD8HydnVAuCfAsxlp8oQIPYwRO+yHX81r9cBB0CYHvdmg08KpMP s+d0FTThPxmeAmkGqLEkY3VJ+yCbwTZ+SGRq3xiOET7cyU2Q/UewGDr8qwfgsEA4gkzK FEWDsZcwOcICPz6dhBgH9MGA7ackJxZp/lJP53GK5xZKKEjXF2swSn5/g3WWYQ3NbICd izzAzecXAsHw3I6XG2VbUC5yZwQ2sD39hMzCbDmLfmR2nhd3OydN66m1P6sSk5is4VBl 6C/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=bizxW2iq; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 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 vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r3si4102245ejs.415.2019.10.18.14.10.07; Fri, 18 Oct 2019 14:10:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=bizxW2iq; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 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 S2440498AbfJQQjd (ORCPT + 99 others); Thu, 17 Oct 2019 12:39:33 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:43393 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729529AbfJQQjd (ORCPT ); Thu, 17 Oct 2019 12:39:33 -0400 Received: by mail-wr1-f67.google.com with SMTP id j18so3113742wrq.10 for ; Thu, 17 Oct 2019 09:39:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=aTLhNcek6xPUcSJYqH/7VnHiyCYLdIPPndN1mNRNi1I=; b=bizxW2iqJ/myY96G2MbmcrDi072+j8LLO8OKbyl+gByLVegcACQcY1N+pOFKJa8T5v HLUyxWGY7FIZ1GJrgpk8aWWvpb2ZX9RDUW6OujjEtlR0uY6eMNIeSFvFcXeG4ELRjlCf VmEWzQTjGsnXJhXo+trwh4Tx95IeR9lCu6IkT4Aw1uRBSvVzxTNKGa/pORmirXIkYI3m RB5lRUuwo/xZo+kD+KNxKOZA5cdojJ7aCwlesS+qtjpM8H9dmG1BvZoy6m4aPsa5VSPs BBeBObyZir+njaHka0Lc/c6OWmPK0x6shHIA++9NHYIO0idjXFBmruxsb2JrIPD6kQhh bgVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=aTLhNcek6xPUcSJYqH/7VnHiyCYLdIPPndN1mNRNi1I=; b=rgx5rxQyyV0e2o1Kqc8dvNvjM8WPSBxyjT+nCk2xTSdBTTJ3XeyIQ3j6Ujptp33Gjt H5kc3bbIQmqbDjcBtX78hr3fLSjgBE38668IyMDOEKEknG7rfcNYiYjv6kqlxcKEL1/B dySRyMMfh7XJk/x4diDSlpvZ//KcOI3jn7FgpyDKQYdVUA9eOfTnvpWxSIYGRWFFOR+I l2/tXU4du2VGEv2cADCvd9xaIVFhix7Ign84+ldqi8NedgVu/9L1wzRt363b4rfsT74r 9pHa5Wb9J/zHm18bfQ1z4Q/nYR7Mfuf/LteFQfGSuGJLOJrgrm7Yeo4CUly9Np/5CyFv T7dQ== X-Gm-Message-State: APjAAAU3mbuLbmg9+R/zoxL6uZJc9T/7pyW8ZnslaRtlsJC6nvTq+wkV 2uBTRFSJ0If+vArFH3GGBGPuKPSR X-Received: by 2002:adf:ea07:: with SMTP id q7mr940423wrm.102.1571330370806; Thu, 17 Oct 2019 09:39:30 -0700 (PDT) Received: from localhost.localdomain.com ([188.204.2.113]) by smtp.gmail.com with ESMTPSA id w125sm3769781wmg.32.2019.10.17.09.39.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 Oct 2019 09:39:30 -0700 (PDT) From: Pascal van Leeuwen X-Google-Original-From: Pascal van Leeuwen To: linux-crypto@vger.kernel.org Cc: antoine.tenart@bootlin.com, herbert@gondor.apana.org.au, davem@davemloft.net, Pascal van Leeuwen Subject: [PATCH] crypto: inside-secure - Fix build error with CONFIG_CRYPTO_SM3=m Date: Thu, 17 Oct 2019 17:36:28 +0200 Message-Id: <1571326588-8013-1-git-send-email-pvanleeuwen@verimatrix.com> X-Mailer: git-send-email 1.8.3.1 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Always take the zero length hash value for SM3 from the local constant to avoid a reported build error when SM3 is configured to be a module. Signed-off-by: Pascal van Leeuwen --- drivers/crypto/inside-secure/safexcel_hash.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/crypto/inside-secure/safexcel_hash.c b/drivers/crypto/inside-secure/safexcel_hash.c index 85c3a07..c906509a 100644 --- a/drivers/crypto/inside-secure/safexcel_hash.c +++ b/drivers/crypto/inside-secure/safexcel_hash.c @@ -785,12 +785,8 @@ static int safexcel_ahash_final(struct ahash_request *areq) memcpy(areq->result, sha512_zero_message_hash, SHA512_DIGEST_SIZE); else if (ctx->alg == CONTEXT_CONTROL_CRYPTO_ALG_SM3) { - if (IS_ENABLED(CONFIG_CRYPTO_SM3)) - memcpy(areq->result, sm3_zero_message_hash, - SM3_DIGEST_SIZE); - else - memcpy(areq->result, - EIP197_SM3_ZEROM_HASH, SM3_DIGEST_SIZE); + memcpy(areq->result, + EIP197_SM3_ZEROM_HASH, SM3_DIGEST_SIZE); } return 0; -- 1.8.3.1