WringTwistree.Blockize.Compress.RotBitcount.cycleRotBitcount
— MethodcycleRotBitcount(buf::Vector{UInt8})
Repeatedly runs rotBitcount on buf until it repeats. The return value is (a,b), where a-b is the cycle length. If b>0, there's a bug.
WringTwistree.Compress.RotBitcount.cycleRotBitcount
— MethodcycleRotBitcount(buf::Vector{UInt8})
Repeatedly runs rotBitcount on buf until it repeats. The return value is (a,b), where a-b is the cycle length. If b>0, there's a bug.
WringTwistree.RotBitcount.cycleRotBitcount
— MethodcycleRotBitcount(buf::Vector{UInt8})
Repeatedly runs rotBitcount on buf until it repeats. The return value is (a,b), where a-b is the cycle length. If b>0, there's a bug.
WringTwistree.finalize!
— Methodfinalize!(tw::Twistree)
Complete processing the data in the Twistree and return the hash. Use after initialize!
and update!
.
WringTwistree.hash!
— Functionhash!(tw,data::Vector{UInt8}[,parseq])
Hashes a block of data that's all in RAM. Equivalent to calling initialize!
, update!
, and finalize!
. parseq
is the same as in update!
.
WringTwistree.initialize!
— Methodinitialize!(tw::Twistree)
Initialize a Twistree. Do this before calling update!
and finalize!
.
WringTwistree.keyedTwistree
— MethodkeyedTwistree(key)
Create a Twistree which can be used to hash a Vector{UInt8}. The key can be a String or Vector{UInt8} and should be at longest 96 bytes. For an unkeyed hash, use an empty string.
Examples
julia> tw=keyedTwistree("aoeu")
WringTwistree.Twistree(UInt8[0x99 0x5e 0xc9; 0xd6 0xf9 0x17; … ;
0x28 0xc8 0x32; 0xb0 0x81 0x99], Vector{UInt8}[], Vector{UInt8}[], UInt8[])
julia> tw0=keyedTwistree("")
WringTwistree.Twistree(UInt8[0x59 0xe9 0xe7; 0xdb 0x13 0x00; … ;
0xfc 0x76 0x38; 0x27 0x55 0xfd], Vector{UInt8}[], Vector{UInt8}[], UInt8[])
WringTwistree.keyedWring
— MethodkeyedWring(key)
Create a Wring which can be used to encrypt or decrypt a Vector{UInt8}. The key can be a String or Vector{UInt8} and should be at longest 96 bytes.
Examples
julia> wring=keyedWring("aoeu")
WringTwistree.Wring(UInt8[0x99 0x5e 0xc9; 0xd6 0xf9 0x17; … ;
0x28 0xc8 0x32; 0xb0 0x81 0x99], UInt8[0x74 0x43 0x06; 0xb8 0x92 0xb6; … ;
0xca 0x3d 0xc5; 0x1d 0x11 0xbc])
julia> wring0=keyedWring("")
WringTwistree.Wring(UInt8[0x59 0xe9 0xe7; 0xdb 0x13 0x00; … ;
0xfc 0x76 0x38; 0x27 0x55 0xfd], UInt8[0x66 0x5c 0x01; 0x49 0x4c 0xba; … ;
0xe9 0x3a 0x73; 0xbd 0x45 0x08])
WringTwistree.setBreakEven
— MethodsetBreakEven()
Compute and set the break-even points for parallel Wring and Twistree. Run this when upgrading Julia or installing on a new computer. It takes several minutes.
WringTwistree.update!
— Functionupdate!(tw,data::Vector{UInt8}[,parseq])
Update a Twistree with some data. parseq
can be
- :sequential
- :parallel
- :default
If you have more than 62208 bytes of data and they don't fit in RAM, you should feed them to update!
at least 31104 bytes at a time, or at least between 7776(n+2) and 8192(n+2) bytes at a time where n is the number of threads your CPU has.
Examples:
tw=keyedTwistree("")
initialize!(tw)
buf=read(file,65536)
update!(tw,buf)
buf=read(file,65536)
update!(tw,buf)
hash=finalize!(tw)