1
0
Fork 0
forked from fun/fun

Doxygen code comment cleanups and new blog post. No code changes. (0.41.5)

This commit is contained in:
Johannes Findeisen 2026-05-01 15:15:42 +02:00
commit 4309ec2a52
212 changed files with 423 additions and 476 deletions

View file

@ -8,8 +8,24 @@
*/
/**
* OpenSSL SHA-512 builtin
* @file sha512.c
* @brief Implements OP_OPENSSL_SHA512 to compute a SHA-512 hash in hex.
*
* Behavior:
* - Pops one value from the VM stack and converts it to bytes by first
* turning it into a string with value_to_string_alloc().
* - Computes the SHA-512 digest via fun_openssl_sha512_hex() and pushes the
* lowercase hexadecimal string back on the stack.
* - On allocation or hashing failure, pushes an empty string ("").
*
* Notes:
* - Non-string inputs are accepted and stringified first.
* - This file is included by vm.c and handles OP_OPENSSL_SHA512.
*
* Errors:
* - Does not abort the VM; failures return an empty string.
*/
case OP_OPENSSL_SHA512: {
Value vdata = pop_value(vm);
char *s = value_to_string_alloc(&vdata);