Transparent FS Encryption "Rewrite" Data Clarification
Posted: Fri Sep 13, 2019 12:13 pm
I understand that flash allows bits to go from 1->0, then we can reset a 4k page back all at once from 0->1
Yet esp-idf allows just 32bit writes to an encrypted partition.
https://docs.espressif.com/projects/esp ... ypt-config
> AES-256 operates on 16 byte blocks of data. The flash encryption
engine encrypts and decrypts data in 32 byte blocks, two AES blocks in series.
Understanding encryption, it's fairly random how those 32 bits end up in value.
Can I
A) Expect that writing to the same 32 bits will result in corrupted data? (because no transparent page 0->1)
B) Expect that if any bits need to go from 0->1 that the whole 4k page will be transparently backed up, erased, then re-written correctly as long as the power doesn't go out
C) Expect that if any bits need to go from 0->1 that the whole 4k page will be transparently backed up, erased, then re-written correctly in some magical atomic fashion immune to power outage? (haha)
And if A) rewriting the same bits can result in corruption, how does the FS leave all bits at 1* until encryption is necessary? Just don't touch the other bits other than the 32 bits in question? (would be technically fine as long as I know)
Thanks a bunch for anyone who just happens to know the answer.
Yet esp-idf allows just 32bit writes to an encrypted partition.
https://docs.espressif.com/projects/esp ... ypt-config
> AES-256 operates on 16 byte blocks of data. The flash encryption
engine encrypts and decrypts data in 32 byte blocks, two AES blocks in series.
Understanding encryption, it's fairly random how those 32 bits end up in value.
Can I
A) Expect that writing to the same 32 bits will result in corrupted data? (because no transparent page 0->1)
B) Expect that if any bits need to go from 0->1 that the whole 4k page will be transparently backed up, erased, then re-written correctly as long as the power doesn't go out
C) Expect that if any bits need to go from 0->1 that the whole 4k page will be transparently backed up, erased, then re-written correctly in some magical atomic fashion immune to power outage? (haha)
And if A) rewriting the same bits can result in corruption, how does the FS leave all bits at 1* until encryption is necessary? Just don't touch the other bits other than the 32 bits in question? (would be technically fine as long as I know)
Thanks a bunch for anyone who just happens to know the answer.