From: George Spelvin <lkml@SDF.ORG>
To: Mark Rutland <mark.rutland@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will@kernel.org>,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, lkml@sdf.org
Subject: Re: [RFC PATCH v1 44/50] arm64: ptr auth: Use get_random_u64 instead of _bytes
Date: Tue, 31 Mar 2020 00:27:38 +0000 [thread overview]
Message-ID: <20200331002738.GE9199@SDF.ORG> (raw)
In-Reply-To: <20200330193237.GC9199@SDF.ORG>
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.
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
WARNING: multiple messages have this Message-ID (diff)
From: George Spelvin <lkml@SDF.ORG>
To: Mark Rutland <mark.rutland@arm.com>
Cc: linux-kernel@vger.kernel.org,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will@kernel.org>,
linux-arm-kernel@lists.infradead.org, lkml@sdf.org
Subject: Re: [RFC PATCH v1 44/50] arm64: ptr auth: Use get_random_u64 instead of _bytes
Date: Tue, 31 Mar 2020 00:27:38 +0000 [thread overview]
Message-ID: <20200331002738.GE9199@SDF.ORG> (raw)
In-Reply-To: <20200330193237.GC9199@SDF.ORG>
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.
next prev parent reply other threads:[~2020-03-31 0:27 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-10 12:15 [RFC PATCH v1 44/50] arm64: ptr auth: Use get_random_u64 instead of _bytes George Spelvin
2019-12-10 12:15 ` George Spelvin
2020-03-30 10:57 ` Mark Rutland
2020-03-30 10:57 ` Mark Rutland
2020-03-30 19:32 ` George Spelvin
2020-03-30 19:32 ` George Spelvin
2020-03-31 0:27 ` George Spelvin [this message]
2020-03-31 0:27 ` George Spelvin
2020-03-31 10:14 ` Mark Rutland
2020-03-31 10:14 ` Mark Rutland
2020-03-31 14:49 ` George Spelvin
2020-03-31 14:49 ` George Spelvin
2020-03-31 16:26 ` Mark Rutland
2020-03-31 16:26 ` Mark Rutland
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200331002738.GE9199@SDF.ORG \
--to=lkml@sdf.org \
--cc=catalin.marinas@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.