NebulousLabs / Sia

Blockchain-based marketplace for file storage. Project has moved to GitLab: https://gitlab.com/NebulousLabs/Sia
https://sia.tech
MIT License
2.71k stars 440 forks source link

Decrypt chunk pieces in parallel and in-place #3155

Closed ChrisSchinnerl closed 6 years ago

ChrisSchinnerl commented 6 years ago

Encrypting/Decrypting a whole chunk with a single thread is pretty slow. This PR moves that code to the worker threads to encrypt/decrypt on a per-piece basis.

lukechampine commented 6 years ago

are there places where we don't want to decrypt in-place?

ChrisSchinnerl commented 6 years ago

@lukechampine It looks like quite a few tests in the wallet are failing if I change it to be in-place by default.

ChrisSchinnerl commented 6 years ago

I reverted the commits for the parallel encryption for now since it is just too much of a hack to do it in-place right now. Once we get rid of the nonce in the sector after moving to Threefish, we can implement a much easier in-place solution for this.