Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp5199006ybl; Tue, 10 Dec 2019 02:08:32 -0800 (PST) X-Google-Smtp-Source: APXvYqxoji7vLiqZum5Bs+3RchXtVF33GGhiiHcRNUAmWehhGdEvB2gchGal/AX4Sr5T9UEcTIJl X-Received: by 2002:a05:6808:8ec:: with SMTP id d12mr3133997oic.131.1575972512765; Tue, 10 Dec 2019 02:08:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575972512; cv=none; d=google.com; s=arc-20160816; b=YXivkDEsJZYmYN3jwBO5fXADjI6cEGWWDy12Bdi46JQGhTwpot/0pk5BXrNtkNxZf+ rUNJiuG7F7tfKpL98DQcf0VwqKuhi2dbQWDi/qWALKofDvbuy5iks6a1XJEPOe5chwrk J88u/8IYz0j39Fd+JHIPSVJ1fXnKNZHO+lJDzm0enPuh6cNM8LErOHbc1tlYsOEsuart 8TzVH07GFqrkGKkBmiwrfPLtjOQKeCnAiE3Kmc+9B7f1eJVviCACYHSnO7l4R97VJPPt ACkxuSTIuHBLUByKZiW+eWDE4GkgbJw94RUVH1omInd4LMPtCkose7IN+AWQmkPWs18/ dAzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=1rtt+jT7d6WO4Gbdn46NFId1N1JwyRLGAD+od7Mfwss=; b=UNLu5GRe8jXLvykn9+YDw0wLMi6uMG/Ks93nmtxuizblaeTiQ86+7jR+5WPUBd55OS GHoDoWW9xcgACNj4hkXrOXaXLFkO7z5DZotPs7M57jPOeqIOIIIrcAoh+wFvV2FW8dpS 1601iUZVf0jdsiORGLuwtFxtWAZ71+s6jAwTqpHYe113S2gIZjUHZ3GJGQzK8kOPZJdK J/jPoAbvgxBBRRxk36xeXm9fzNyzAVa0MW5l4k0lxrXK++qpgtkUYMzrslx3c8F4Ot08 x7sPnW92KWEIl6RKX+OOtLNAN6HGVReErVNeFvBA7QKLiGZoNHDJnG1i8j2t8lVlTUaa gzgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qrDZOxKZ; 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=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d62si1719892oib.144.2019.12.10.02.08.21; Tue, 10 Dec 2019 02:08:32 -0800 (PST) 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=@linaro.org header.s=google header.b=qrDZOxKZ; 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=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727107AbfLJKIE (ORCPT + 99 others); Tue, 10 Dec 2019 05:08:04 -0500 Received: from mail-wr1-f65.google.com ([209.85.221.65]:38040 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727076AbfLJKIE (ORCPT ); Tue, 10 Dec 2019 05:08:04 -0500 Received: by mail-wr1-f65.google.com with SMTP id y17so19322233wrh.5 for ; Tue, 10 Dec 2019 02:08:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=1rtt+jT7d6WO4Gbdn46NFId1N1JwyRLGAD+od7Mfwss=; b=qrDZOxKZuKEZf9PQD5L3fQrQwUaMjBGohV3YtvMcCVDBZqjlCSLICU4Xe6pA2mjAVX fmADt0pPBW15Oo1ReMazyeNVnwEDb1dGDtXZ33qIXAB2CbOAys9tOWEUmFYPggS9wnM/ V2OdCGUFaJ1H1Z0s41oShYYG3vLfYH1vUDudsSzcIBTDdn1PxAOxV0jaAeKArMr5FA1O snFOo9PLfjEQ+jw6NEKzo70HdvH/yieYNHwdtFMx7SXfK4tlMxVbz7bvfcokP5Hc0jrI u6fOi05gCg3oFTtSrqw9Ah/vpKRciUVaGEjq/YEgxdW+yFGGF3cN+/LW8qMtzYJN8HRv mY/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=1rtt+jT7d6WO4Gbdn46NFId1N1JwyRLGAD+od7Mfwss=; b=NJW2obFwTSyartIcO+ubjrkuVVTdIh/yZ0ykjeGMSsZDV4LCtw2uRW1C+4nP/jph8E QfBAf1An6bGt0vC16eT/8CiXsPppdfGyXjo4v/Sgt5ytYdBvVRHv2BKYG5mHMSJ2FAot LT977Yzs1RpMNIls5urZBEOcOKNIg+622i/B4qqMGaQuVUfPbgJNKR2F7BiuXaOdHedg Ze0ZrZAUMHIYfbL2TU41i2GCuD4HHengrC4ZNXg4tggUuRCTVnqv1AMP7xYAfRIwMwjH 2amdYvulr7OqML1EfhQXzlt64aGJAh0Q8Jyas1VPiZAP4dWvSCn0/pc2tqqz4ix9ObNO L7Gg== X-Gm-Message-State: APjAAAWgbjt3zyVMsWVqmxEYouEcoFNheO43rtK0nfYhS9KaMAWMsqN9 HYATsvv072Eu/ArewjQ+7IdCXT8Da6QAeDi6dcKHjQ== X-Received: by 2002:a5d:5345:: with SMTP id t5mr2343807wrv.0.1575972482308; Tue, 10 Dec 2019 02:08:02 -0800 (PST) MIME-Version: 1.0 References: <82a75666-3cb7-e33d-d873-1aad5581a13c@ti.com> In-Reply-To: <82a75666-3cb7-e33d-d873-1aad5581a13c@ti.com> From: Ard Biesheuvel Date: Tue, 10 Dec 2019 11:07:51 +0100 Message-ID: Subject: Re: aes_expandkey giving wrong expanded keys over crypto_aes_expand_key(older deprecated implementation under aes_generic) To: Keerthy Cc: "open list:HARDWARE RANDOM NUMBER GENERATOR CORE" , "Kristo, Tero" , Herbert Xu Content-Type: text/plain; charset="UTF-8" Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Tue, 10 Dec 2019 at 11:06, Keerthy wrote: > > > > On 10/12/19 3:31 pm, Ard Biesheuvel wrote: > > Hello Keerthy, > > > > On Tue, 10 Dec 2019 at 10:35, Keerthy wrote: > >> > >> Hi Ard, > >> > >> I am not sure if am the first one to report this. It seems like > >> aes_expandkey is giving me different expansion over what i get with the > >> older crypto_aes_expand_key which was removed with the below commit: > >> > >> commit 5bb12d7825adf0e80b849a273834f3131a6cc4e1 > >> Author: Ard Biesheuvel > >> Date: Tue Jul 2 21:41:33 2019 +0200 > >> > >> crypto: aes-generic - drop key expansion routine in favor of library > >> version > >> > >> The key that is being expanded is from the crypto aes(cbc) testsuite: > >> > >> }, { /* From NIST SP800-38A */ > >> .key = "\x8e\x73\xb0\xf7\xda\x0e\x64\x52" > >> "\xc8\x10\xf3\x2b\x80\x90\x79\xe5" > >> "\x62\xf8\xea\xd2\x52\x2c\x6b\x7b", > >> .klen = 24, > >> > >> > >> The older version crypto_aes_expand_key output that passes the cbc(aes) > >> decryption test: ... > >> > >> The difference is between 52nd index through 59. > >> > >> Any ideas if this is expected? > >> > > > > Yes, this is expected. This particular test vector uses a 192 bit key, > > so those values are DC/ignored. > > Thanks for the quick response. However with the new implementation > decryption test case fails for me with wrong result. Can you share more details please? Platform, endianness, etc ...