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 442 forks source link

Decrypt chunk pieces in parallel and in-place #3155

Closed ChrisSchinnerl closed 5 years ago

ChrisSchinnerl commented 5 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 5 years ago

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

ChrisSchinnerl commented 5 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 5 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.