Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// load C Code
var cobol = Polyglot.evalFile("llvm", "KECCAK.so");
(function SHA3_256(sha_input, sha_input_length, sha_output) {
cobol.KECCAK__Wrapper__struct({
LNK_KECCAK_RATE: 1088,
LNK_KECCAK_CAPACITY: 512,
LNK_KECCAK_INPUT: sha_input,
LNK_KECCAK_INPUT_BYTE_LEN: sha_input_length,
LNK_KECCAK_DELIMITED_SUFFIX: 0x06,
LNK_KECCAK_OUTPUT: sha_output,
LNK_KECCAK_OUTPUT_BYTE_LEN: 32
});
// GnuCobol expects a return value
return 0;
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.