Hacker News new | past | comments | ask | show | jobs | submit login

> You can't use any algorithm that requires O(n) IVs (e.g. a separate IV per disk sector), because there's nowhere to store the IVs

Certainly you can. You just have to reduce the effective sector size that the file system can use.

> What do you do when you need to overwrite a block with new data?

You generate a new random nonce (as per XChacha) and you store it in the sector.




> Certainly you can. You just have to reduce the effective sector size that the file system can use.

get back to me when you find a high-performance (FAT doesn't count) Linux filesystem that supports sector sizes of 496.


Modern disks use much bigger sectors. See https://en.wikipedia.org/wiki/Advanced_Format


The issue is non power of 2 sector sizes. The kernel computes sectors with shifts not division (which would be slow).


I do not see how you would need to use divisions in that case.

But even if that was the case, you could just pretend to the OS that you have 7 sectors of 512 bytes each rather than a single sector of 4032 bytes. (or if that was not possible you could just take the hit)


You need division to go from a file offset in bytes to a sector number, hence the need for power of 2 sizes to make this fast. The kernel assumes in multiple places sectors are a power for 2 for this reason - it doesn't rely on the compiler to optimize it (which may not even be possible for some of the compilers it works on).

If you are talking about using reserved sectors for book keeping at the end of the disk that is possible and commonly done.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: