[[!comment format=mdwn
 username="joey"
 subject="""comment 1"""
 date="2018-07-19T20:38:12Z"
 content="""
Shared only uses the first 256 bytes of the cipher to
encrypt filenames, while sharedpubkey uses the entire cipher.

That difference makes sense, since shared uses the second half of the cipher to
encrypt file contents, while sharedpubkey encrypts that to the gpg key(s).

You are truncating the sharedpubkey cipher to 256 bytes; I suspect if you
don't, it will work. If it still doesn't work, refer to the working code
that I posted in the forum thread earlier.

I don't think that doc/encryption.mdwn needs to go into detailed specifics.
If someone would like to write a fully detailed explanation of how the
encryption works it could go in doc/internals.mdwn or someplace like that.

(Crypto.hs is also not hard to follow if you look at the types:
cipherMac of a MacOnlyCipher uses the whole cipher, while
cipherMac of a Cipher uses only the beginning of the cipher.
And decryptCipher of a SharedPubKeyCipher creates a MacOnlyCipher.)

This bug certianly does not warrent changing the behavior of git-annex,
which would in any case only complicate the situation since it would still
need to support the current data.
"""]]
