debris / tiny-keccak

An implementation of Keccak derived functions specified in FIPS-202, SP800-185 and KangarooTwelve
Creative Commons Zero v1.0 Universal
193 stars 49 forks source link

Allow custom rate/delim #16

Closed quininer closed 7 years ago

quininer commented 7 years ago

I try to implement cSHAKE. According to the specification, it needs to use a different rate.

If N = "" and S = "":
    return SHAKE128(X, L);
Else:
    return KECCAK[256](bytepad(encode_string(N) || encode_string(S), 168) || X || 00, L).

Note that the numbers 168 and 136 are rates (in bytes) of the KECCAK[256] and KECCAK[512] sponge functions, respectively; the characters 00 in the Courier New font in these definitions specify two zero bits.

quininer commented 7 years ago

oops, It is no different.

quininer commented 7 years ago

I still need to customize delim. in order to fast fill zero, I added a new method.

debris commented 7 years ago

thanks! published in version 1.3.0