-
Notifications
You must be signed in to change notification settings - Fork 322
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gzhttp: Add SHA256 as paranoid option (#769)
``` Benchmark2kJitter-32 67309 17580 ns/op 116.50 MB/s 3478 B/op 17 allocs/op Benchmark2kJitterParanoid-32 54398 21564 ns/op 94.97 MB/s 3438 B/op 16 allocs ``` ### Paranoid? The padding size is determined by the remainder of a CRC32 of the content. Since the payload contains elements unknown to the attacker, there is no reason to believe they can derive any information from this remainder, or predict it. However, for those that feel uncomfortable with a CRC32 being used for this can enable "paranoid" mode which will use SHA256 for determining the padding. The hashing itself is about 2 orders of magnitude slower, but in overall terms will maybe only reduce speed by 10%. Paranoid mode has no effect if buffer is < 0 (non-content aware padding).
- Loading branch information
Showing
3 changed files
with
277 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters