Linux cryptographic layer development
 help / color / mirror / Atom feed
From: "Jason A. Donenfeld" <Jason@zx2c4.com>
To: Xi Ruoyao <xry111@xry111.site>
Cc: Huacai Chen <chenhuacai@kernel.org>,
	WANG Xuerui <kernel@xen0n.name>,
	linux-crypto@vger.kernel.org, loongarch@lists.linux.dev,
	Jinyang He <hejinyang@loongson.cn>,
	Tiezhu Yang <yangtiezhu@loongson.cn>,
	Arnd Bergmann <arnd@arndb.de>
Subject: Re: [PATCH v2 0/2] LoongArch: Implement getrandom() in vDSO
Date: Thu, 15 Aug 2024 14:28:01 +0000	[thread overview]
Message-ID: <Zr4QccFIu4BQOwEI@zx2c4.com> (raw)
In-Reply-To: <eae5ab91ee6a6eb96c397b4ff6470b72e9bf3086.camel@xry111.site>

On Thu, Aug 15, 2024 at 10:22:31PM +0800, Xi Ruoyao wrote:
> > so I'll be able to take a look at this for real starting the 26th, as
> > right now I'm just on my cellphone using lore+mutt.
> > 
> > One thing I wanted to ask, though, is - doesn't LoongArch have 32 8-byte
> > registers? Shouldn't that be enough to implement ChaCha without spilling
> > and without using LSX?
> 
> I'll work on it but I need to ask a question (it may be stupid because I
> know a little about security) before starting to code:
> 
> Is "stack-less" meaning simply "don't spill any sensitive data onto the
> stack," or more strictly "stack shouldn't be used at all"?
> 
> For example, is it OK to save all the callee-saved registers in the
> function prologue onto the stack, and restore them in the epilogue?

Just means don't spill sensitive info, which means the key, the output,
the entire ChaCha state, and all intermediate states. But saving
callee-saved registers in the prologue like usual is fine.

Jason

  reply	other threads:[~2024-08-15 14:28 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-15 13:33 [PATCH v2 0/2] LoongArch: Implement getrandom() in vDSO Xi Ruoyao
2024-08-15 13:33 ` [PATCH v2 1/2] LoongArch: Perform alternative runtime patching on vDSO Xi Ruoyao
2024-08-15 13:33 ` [PATCH v2 2/2] LoongArch: vDSO: Wire up getrandom() vDSO implementation Xi Ruoyao
2024-08-15 14:04 ` [PATCH v2 0/2] LoongArch: Implement getrandom() in vDSO Jason A. Donenfeld
2024-08-15 14:22   ` Xi Ruoyao
2024-08-15 14:28     ` Jason A. Donenfeld [this message]
2024-08-26  6:32   ` Xi Ruoyao
2024-08-26  8:54     ` Jason A. Donenfeld
2024-08-15 14:08 ` Jason A. Donenfeld

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=Zr4QccFIu4BQOwEI@zx2c4.com \
    --to=jason@zx2c4.com \
    --cc=arnd@arndb.de \
    --cc=chenhuacai@kernel.org \
    --cc=hejinyang@loongson.cn \
    --cc=kernel@xen0n.name \
    --cc=linux-crypto@vger.kernel.org \
    --cc=loongarch@lists.linux.dev \
    --cc=xry111@xry111.site \
    --cc=yangtiezhu@loongson.cn \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox