Re: storing an explicit nonce
От | Stephen Frost |
---|---|
Тема | Re: storing an explicit nonce |
Дата | |
Msg-id | CAOuzzgqf0Cog08bm8gpu=xpGVvBGFJvHH8jjpotZGqLjKGw1hA@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: storing an explicit nonce (Robert Haas <robertmhaas@gmail.com>) |
Ответы |
Re: storing an explicit nonce
|
Список | pgsql-hackers |
Greetings,
On Tue, May 25, 2021 at 15:09 Robert Haas <robertmhaas@gmail.com> wrote:
On Tue, May 25, 2021 at 2:45 PM Bruce Momjian <bruce@momjian.us> wrote:
> Well, if we create a separate nonce counter, we still need to make sure
> it doesn't go backwards during a crash, so we have to WAL log it
I think we don't really need a global counter, do we? We could simply
increment the nonce every time we write the page. If we want to avoid
using the same IV for different pages, then 8 bytes of the nonce could
store a value that's different for every page, and the other 8 bytes
could store a counter. Presumably we won't manage to write the same
page more than 2^64 times, since LSNs are limited to be <2^64, and
those are consumed more than 1 byte at a time for every change to any
page anywhere.
The nonce does need to be absolutely unique for a given encryption key and therefore needs to be global in some form.
Thanks!
Stephen
В списке pgsql-hackers по дате отправления: