In this PR, the key commitment scheme is obtained by prefixing the encrypted data with a fixed 32 bytes string.
To avoid using the same key (the archive key) twice, the hardcoded string is the first chunk to be encrypted.
To avoid using the same nonce & key, there is a shift of 1 (FIRST_DATA_CHUNK_NUMBER=1) between the "chunk_number" value computed by layers and the actual value used in the build_nonce, ie:
Data on disk: [hardcoded string. Nonce=build_nonce(nonce, 0) -- 512bits + tag long][underlayer chunk #1. Nonce=build_nonce(nonce, 1) -- 4MB + tag long]...[underlayer chunk #n. Nonce=build_nonce(nonce, n) -- last size + tag long]
Note: as this PR modifies the current format, it is expected to fail on archive_v1 checks
Failing tests are caused by an update to Py-bindings (unrelated to this PR) and the "long" test CI enabling the check_archive_v1 test, which is expected to fail
Fix #206
:warning: this is a breaking change
In this PR, the key commitment scheme is obtained by prefixing the encrypted data with a fixed 32 bytes string.
To avoid using the same key (the archive key) twice, the hardcoded string is the first chunk to be encrypted. To avoid using the same nonce & key, there is a shift of 1 (
FIRST_DATA_CHUNK_NUMBER=1
) between the "chunk_number" value computed by layers and the actual value used in thebuild_nonce
, ie:Note: as this PR modifies the current format, it is expected to fail on
archive_v1
checksUpdate: use a 512bits for 256bits of security