• Radu Berinde's avatar
    hash/crc32: cleanup code and improve tests · bdde1013
    Radu Berinde authored
    Major reorganization of the crc32 code:
    
     - The arch-specific files now implement a well-defined interface
       (documented in crc32.go). They no longer have the responsibility of
       initializing and falling back to a non-accelerated implementation;
       instead, that happens in the higher level code.
    
     - The non-accelerated algorithms are moved to a separate file with no
       dependencies on other code.
    
     - The "cutoff" optimization for slicing-by-8 is moved inside the
       algorithm itself (as opposed to every callsite).
    
    Tests are significantly improved:
     - direct tests for the non-accelerated algorithms.
     - "cross-check" tests for arch-specific implementations (all archs).
     - tests for misaligned buffers for both IEEE and Castagnoli.
    
    Fixes #16909.
    
    Change-Id: I9b6dd83b7a57cd615eae901c0a6d61c6b8091c74
    Reviewed-on: https://go-review.googlesource.com/27935Reviewed-by: 's avatarKeith Randall <khr@golang.org>
    bdde1013
Name
Last commit
Last update
..
adler32 Loading commit data...
crc32 Loading commit data...
crc64 Loading commit data...
fnv Loading commit data...
hash.go Loading commit data...
test_cases.txt Loading commit data...
test_gen.awk Loading commit data...