-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add baseName
to ExternalContent
#71
Conversation
@@ -211,7 +212,9 @@ Private file content has two variants: inlined or externalized. Externalized con | |||
|
|||
#### 3.1.4.1 Externalized Content |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: it would be good to expand section 3.1.4
. I've had to re-load a bunch of context about the difference between inline and external content, which means that it will very likely be confusing to someone new coming in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Specifically some examples of when you'd want one or the other would be helpful
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to expand the section a little bit 👀
LMK what you think
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Super great! Thanks :)
spec/private-wnfs.md
Outdated
@@ -211,7 +212,9 @@ Private file content has two variants: inlined or externalized. Externalized con | |||
|
|||
#### 3.1.4.1 Externalized Content | |||
|
|||
Since external content blocks are separate from the header, they MUST have a unique `NameAccumulator` derived from a random key (to avoid forcing lookups to go through the header). If the key were derived from the header's key, then the file would be re-encrypted e.g. every time the metadata changed. See [sharded file content access algorithm](#44-sharded-file-content-access) for more detail. | |||
Since external content blocks are separate from the header, they each MUST have a `NameAccumulator` that is different than the file's `NameAccumulator`. We allow these names to have an arbitrary base. For the normal case, the base name is RECOMMENDED to be the file's name with the externalized content's encryption `key`, hashed to a prime, added to it as a name segment. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is "base" here a term defined elsewhere? It may be worth linking to it, or using a more descriptive term here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps it's this field?
baseName: NameAccumulator
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the file's name with
The nameaccumulator, or the human readable name? The with
here is concatenation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The NameAccumulator
. I tried to make this more explicit by saying "file's name
from its header".
LMK if that's better :)
d0b834b
to
637f1da
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! 👏
@@ -211,7 +212,9 @@ Private file content has two variants: inlined or externalized. Externalized con | |||
|
|||
#### 3.1.4.1 Externalized Content |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Super great! Thanks :)
We explicitly add
baseName
to theExternalContent
record.Usually
baseName = file.header.name.add(externalContent.key)
, but in some cases it's nice to for it to be something different.This is nice, because it makes
ExternalContent
self-contained. You only need the information fromExternalContent
to be able to read the whole content bytes.This allows us to potentially use it in other places (e.g. thinking of #50), as well as copying it over from other
PrivateFile
s, in case a file gets moved or copied, without having to re-encrypt a bunch of data.❗ merge order ❗
namefilter.md
and addNameAccumulator
verification algorithm #68derive_key
algorithm instead of SHA3 #69AES-GCM
toXChaCha20-Poly1305
#70