Commit graph

4 commits

Author SHA1 Message Date
Kurt
2deb51b365 Minor optimization for hashing
don't use FIPS compliant hashing methods explicitly, no real reason to. hash.Create() will select managed vs csp depending on the framework/core and reg flags.
add >net46 incremental hash logic for swsh
remove static sha256 instance (single threaded overkill)
2021-01-08 00:32:04 -08:00
Kurt
86d80a7d0b Minor perf improvement for advancing keys
Further improvements can be made if there's a way to have a union struct (4 u16s, lumped u64) that has a simple 4bit diagonal mirror operation on it. Can be at least twice as fast.

Benchmarking with optimizations shows about 80-90% of the prior time taken, so at least a 10% speed optimization

Rarely used, was fun to try and optimize a little more.

Eliminate bounds checks by accessing/setting the highest element, and only index twice instead of 6x.
Eliminate u16 casts by leaving as int type (same result)
Eliminate temp value caching and instead directly write to storage. (no more _0123).

End result looks neat too, since the >> 0's removed looks like a diagonal, like the nibble rotation :D
2021-01-07 20:50:28 -08:00
Kurt
1138cd44bc Minor rearranging 2021-01-07 18:05:21 -08:00
Kurt
19d40f61f5 Move save crypto types to focused folder 2021-01-07 16:01:34 -08:00