give Lua access to tomcrypt's SHA256

This adds Lua hooks to CryptManager for libtomcrypt's SHA256 hash
function.  It follows along with the C++ patterns Glenn wrote a decade
and a half ago for CryptMananger's MD5 and SHA1 hooks.

StepMania's CMakeProject-tomcrypt file has been updated to build with
sha256 symbols.  Invoking cmake to build with system tomcrypt works fine
as-is.

Note that these functions return binary formatted strings, but themers
can convert to hexadecimal format using the global Lua function
BinaryToHex().
This commit is contained in:
quietly-turning
2020-09-09 15:37:01 -04:00
parent fdef606b46
commit 72cd6edf5c
5 changed files with 71 additions and 6 deletions
+1
View File
@@ -823,6 +823,7 @@ else()
sm_add_compile_definition("tomcrypt" LTC_DEVRANDOM)
# Common formulas used by our app.
sm_add_compile_definition("tomcrypt" LTC_SHA256)
sm_add_compile_definition("tomcrypt" LTC_SHA1)
sm_add_compile_definition("tomcrypt" LTC_MD5)