lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


I'm currently modifying a pure Lua sha1 and hmac_sha1 library I found
a while back[1] to use existing bitwise library functions instead of
its pure Lua versions when possible.

All of the bitwise arithmetic tests at the end of the file pass on all
of the platforms I tested[2], except for the ones that print "nullop"
followed by a series of zeroes (those tests aren't supported by all
three bitwise libraries).

Three of the four platforms pass all the validation tests, but for
some reason Lua 5.1.5 with bitlib fails on the first one if bitlib's
functions are used instead of the pure Lua equivalents (which pass all
the tests).

Would anyone with 5.1.5 and bitlib be willing to test the code and/or
point out any obvious errors on my part? It can be run directly from
the command line or with dofile.

Thanks,
Choonster

[1] https://github.com/Choonster/luabnet_tools/blob/master/lua/bnet/tools/external/sha1.lua
[2]  I've tested it on Lua 5.1.4 with Lua BitOp from LuaForWindows,
Lua 5.1.5 with bitlib from the LuaDist repo[3], LuaJIT 2.0.1 with
built-in Lua BitOp and Lua 5.2.2 with built-in bit32
[3] https://github.com/LuaDist/bitlib