[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200331002738.GE9199@SDF.ORG>
Date: Tue, 31 Mar 2020 00:27:38 +0000
From: George Spelvin <lkml@....ORG>
To: Mark Rutland <mark.rutland@....com>
Cc: linux-kernel@...r.kernel.org,
Catalin Marinas <catalin.marinas@....com>,
Will Deacon <will@...nel.org>,
linux-arm-kernel@...ts.infradead.org, lkml@....org
Subject: Re: [RFC PATCH v1 44/50] arm64: ptr auth: Use get_random_u64 instead
of _bytes
On Mon, Mar 30, 2020 at 07:32:37PM +0000, George Spelvin wrote:
> On Mon, Mar 30, 2020 at 11:57:45AM +0100, Mark Rutland wrote:
>> As I am unaware, how does the cost of get_random_bytes() compare to the
>> cost of get_random_u64()?
>
> It's approximately 8 times the cost.
Just a expand on on a point I may have left unclear: One
get_random_bytes(), for a length up to 32 bytes, is approximately
8x the one get_random_u64(). (Then it jumps to 16x for up
to 96 bytes.)
Since were're using *two* get_random_u64() calls to replace one
get_random_bytes(), it's a 4x cost difference between the two
alternative ways of generating a 128-bit key.
Powered by blists - more mailing lists