Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1583079pxa; Thu, 20 Aug 2020 15:20:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz8eB/lVEONGBWs29oafY7Cv2fgYQiev6cH5OxDsWOyXjP0gWMeUYuwVtMGbkNz1h9mwt6y X-Received: by 2002:a17:906:ff05:: with SMTP id zn5mr84483ejb.64.1597962003828; Thu, 20 Aug 2020 15:20:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597962003; cv=none; d=google.com; s=arc-20160816; b=m0BS4stWFG2G/sjEqL3INf3qNAaLQyrDN28RgZ1LDfuaOSNDxTUy3XfMwX0hOz82/Q JcqoKt2Ga9R/0zgl0yc6QsO8WkPAK8+lhn+Z3NVKFqD5NSwgGbbiMJZc8eQUape17M59 SO52lIlRNXJVL/ld9MUqVGomGEU4PiOQhCEg5WBVLYnXS302iJywOVwxOjcIxkSU29/Q qz9MjVQGomOgFZVP8Vqo2unTTyDgVfM+Vv4o1y+SVZEaV7taSayPKdFNB3WGlnOOLhEs +YmbD98MBT8BXxGEvm1myYNebMWU2grt4tJLBGSpBfeddTdQKs9W34rNajDnr3BDeIDh 7vaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject :dkim-signature:dkim-filter; bh=W2a4oMYkFr5gKQ4nG6sCd2jqcSy1vcdxQ6eLms8J+DU=; b=QPhX3iwZJj43zGvR3C7vrOCfa+L7wk6FMNUAzMKCcyhTZl9JwgG4agvQnEgifnJiLe QmdrTZBCrRKjNYs33Xq43cvwunYDn5gyMtZ+6c7sJUFytdcCQzj+59JR94RpDobEzyw3 RVsTWzUxVbeBEtyFyEaYKbGUK8CH5zRNoqtSAmf9F9UOH3nuylZyTrcIvd1uYv3U7J3o X5og7FPjP5r9B6qPUyNDBW+C0vbeVlqxZc8d7c+Pk+e86AJxNwPIHW61wGByT1vkFC4t gFIS0MRdt18H6sFp9D9lRVO0qoi3zc5MaMsTh4omvM35eJUe9G2o36+zzX72NVif1+Wb giSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@candelatech.com header.s=default header.b=FOoFx+gl; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=candelatech.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w14si2063188ejb.720.2020.08.20.15.19.27; Thu, 20 Aug 2020 15:20:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@candelatech.com header.s=default header.b=FOoFx+gl; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=candelatech.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726896AbgHTWJ6 (ORCPT + 99 others); Thu, 20 Aug 2020 18:09:58 -0400 Received: from mail2.candelatech.com ([208.74.158.173]:52158 "EHLO mail3.candelatech.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726852AbgHTWJ5 (ORCPT ); Thu, 20 Aug 2020 18:09:57 -0400 Received: from [192.168.254.6] (unknown [50.34.202.127]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail3.candelatech.com (Postfix) with ESMTPSA id 1909513C2B1; Thu, 20 Aug 2020 15:09:56 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 mail3.candelatech.com 1909513C2B1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=candelatech.com; s=default; t=1597961396; bh=uNhc3ajKahL3I7txtRGxA+G34nEuTt1ajzY0QjK5XBA=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=FOoFx+glIVFX8exTYBlydKzlRLMGDMWxKW2IVZLqwibJqI8SDGbTiP5g0RoyOGLgA LrCZjo0tXgcNxbIZNR37H0KpSngl56T/u7eprHTdvZ2KyJWdvQ8rCXN5aYdDQBjWqi UGSB+WsL5JFlcJ+k527xGII65jgAZs7zxrDYA5jQ= Subject: Re: [PATCH 0/5] crypto: Implement cmac based on cbc skcipher To: Herbert Xu Cc: Ard Biesheuvel , Linux Crypto Mailing List , Eric Biggers References: <20200820070645.GA21395@gondor.apana.org.au> <20200820072910.GA21631@gondor.apana.org.au> <20200820074414.GA21848@gondor.apana.org.au> <20200820075353.GA21901@gondor.apana.org.au> <6bd84823-7dc6-e132-2959-e73d6806d2f1@candelatech.com> <20200820201055.GA24119@gondor.apana.org.au> From: Ben Greear Organization: Candela Technologies Message-ID: Date: Thu, 20 Aug 2020 15:09:55 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20200820201055.GA24119@gondor.apana.org.au> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-MW Content-Transfer-Encoding: 7bit Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On 8/20/20 1:10 PM, Herbert Xu wrote: > On Thu, Aug 20, 2020 at 06:54:58AM -0700, Ben Greear wrote: >> >> Here's a run on an: Intel(R) Core(TM) i7-7700T CPU @ 2.90GHz >> >> testing speed of async cmac(aes-aesni) (cmac(aes-aesni)) >> >> [ 259.397910] tcrypt: test 8 ( 1024 byte blocks, 1024 bytes per update, 1 updates): 8442 cycles/operation, 8 cycles/byte >> >> testing speed of async cmac(aes-generic) (cmac(aes-generic)) >> >> [ 294.171530] tcrypt: test 8 ( 1024 byte blocks, 1024 bytes per update, 1 updates): 9022 cycles/operation, 8 cycles/byte >> >> On my slow apu2 board with processor: AMD GX-412TC SOC >> >> testing speed of async cmac(aes-aesni) (cmac(aes-aesni)) >> >> [ 51.751810] tcrypt: test 8 ( 1024 byte blocks, 1024 bytes per update, 1 updates): 18759 cycles/operation, 18 cycle >> >> testing speed of async cmac(aes-generic) (cmac(aes-generic)) >> >> [ 97.837497] tcrypt: test 8 ( 1024 byte blocks, 1024 bytes per update, 1 updates): 31365 cycles/operation, 30 cycle > > So clearly aes-generic is slower than aes-aesni even with saving and > restoring for each block. Therefore improving the performance of > the latter per se does not make sense. I have always assumed that I need aesni instructions to have any chance at this performing well, but there are certainly chips out there that don't have aesni, so possibly it is still worth improving if it is relatively easy to do so. I am currently using x86-64 CPUs with aesni, and also some AP platforms running QCA ARM chips. I am not sure if ARM is using aesni or not...it is certainly not that fast, but maybe for other reasons. Thanks, Ben > > Cheers, > -- Ben Greear Candela Technologies Inc http://www.candelatech.com