Live data from Hacker News

BLAKE3 1.0

github.com

121–126 of 126 posts

Re: BLAKE3 1.0

#121
post #17

Earlier quoted context omitted.

Reference (“&”) to a slice (“[]”) of CHUNK_LEN bytes (“u8”, unsigned 8-bit integers).

Thank you! What is " let mut chunks = ArrayVec:: ::new(); Edit: I probably should not comment to everyone one-by-one, so thank you all for the answers!

Rust syntax really is crazy. It's designed to be utterly incomprehensible.

Re: BLAKE3 1.0

#122
post #116

Earlier quoted context omitted.

An associative / non-commutative hash function over lists. This would mean that the hash of a list, H(list1), could be "concatenated" with another hash, H(list2), to find the hash of the concatenation and be equivalent to H(list1+list2). I think such a construction could be huge for cryptographic verification of data in data structures while avoiding baking in incidental details about the data structure itself. I hes…

This is super interesting, thanks! I just wrote a related note in http://canonical.org/~kragen/dernocua.git in text/hash-consing-ropes.md, linking to those two notes; my interest is using it for hash consing, like symbol interning but for all your strings.

Something that might interest you even more is the related questions by Jason Hise that I linked to. They explored using 8x8 bit-element matrices as an associative hash of a string and apparently it works pretty good as a hash for string keys in a hashmap. Both questions, answers, and comments all have some interesting context, and Jason answers some questions I had about their usage in comments on the second question.

Using 8x8 Binary Matrices as a hash - https://math.stackexchange.com/questions/1902462/using-8x8-b...

Finding Prime Binary Matrices - https://math.stackexchange.com/questions/1914853/finding-pri...

Re: BLAKE3 1.0

#123

Earlier quoted context omitted.

IMO, this shouldn't be a TODO. This should be an #error based on the standard C macros for detecting endianness at compile-time.

This is a good point, and I'd like to fix it. When I look for endianness macros, it doesn't seem like there's a common standard. Is there an approach you'd recommend?

It seems that you're right - ISO C doesn't have standard macros for this. That said, since this code is ARM-specific, and you are already leveraging the ACLE header , I think that a negative test for __ARM_BIG_ENDIAN is appropriate.

https://developer.arm.com/documentation/101028/0012/5--Featu...

Re: BLAKE3 1.0

#124
post #89
post #86

Earlier quoted context omitted.

Hadn't really looked into SIV as I've only written stuff that always generates XChaCha nonces with getrandom but yeah I can totally see why the platform etc. could cause issues that lead to nonce-reuse. This was most informative post, thank you so much!

SIV is usually done with AES/GMAC constructions but you could do it with ChaChaPoly just fine. The big downside is that it requires two passes on encrypt: one to create the MAC and derive the IV and another to encrypt. The overhead for this is small for message/packet based systems though since after pass one the data will be sitting hot in the processor's L0 cache. Decryption can be done in one pass.

Aren't you supposed to Mac the encrypted data?

Re: BLAKE3 1.0

#125

Earlier quoted context omitted.

This is a good point, and I'd like to fix it. When I look for endianness macros, it doesn't seem like there's a common standard. Is there an approach you'd recommend?

It seems that you're right - ISO C doesn't have standard macros for this. That said, since this code is ARM-specific, and you are already leveraging the ACLE header , I think that a negative test for __ARM_BIG_ENDIAN is appropriate. https://developer.arm.com/documentation/101028/0012/5--Featu...

I just put up https://github.com/BLAKE3-team/BLAKE3/pull/188 for this. Let me know if you have any suggestions about how to test it?

Re: BLAKE3 1.0

#126
post #116

Earlier quoted context omitted.

This is super interesting, thanks! I just wrote a related note in http://canonical.org/~kragen/dernocua.git in text/hash-consing-ropes.md, linking to those two notes; my interest is using it for hash consing, like symbol interning but for all your strings.

Something that might interest you even more is the related questions by Jason Hise that I linked to. They explored using 8x8 bit-element matrices as an associative hash of a string and apparently it works pretty good as a hash for string keys in a hashmap. Both questions, answers, and comments all have some interesting context, and Jason answers some questions I had about their usage in comments on the second questio…

It's a pretty interesting idea! If you were implementing it in hardware, it would probably be faster. In software, I suspect that my suggestion of composition of linear forms in the ring ℤ/nℤ would be more efficient.
Post reply on HN