Percona-Lab / pg_tde

MIT License
107 stars 19 forks source link

Using ctid as IV base instead of offset calculation #107

Closed dutow closed 7 months ago

dutow commented 8 months ago

This commit modifies the ID calculation of normal tuples to just use the alrady exisitng ItemPointer to offset the IV instead of the actual offset addresses, as the ItemPointer doesn't change during moves and also easier to use for replication.

As part of this, the structure of the IV is also changed: instead of using the offset as the base number, and incrementing it sequentially, we now insert the "base" ItemPointer at the high part of the IV, and start the counter at the other end, at the low part of the IV.

This means that we are no longer using AES-CTR, but instead rely on a custom AES based encryption, but this is also required for toast, as with that, we can't rely on the uniqueness of the address in the entire data range.

Old encryption tests are also deleted, as they no longer work with these changes.

codeforall commented 8 months ago

There is also a tiny typo in the commit message. "alrady"