![]() |
Fun API Documentation 0.42.1
The programming language that makes you have fun!
|
OpenSSL-based hashing helpers used by crypto-related VM opcodes. More...
#include <openssl/evp.h>#include <stdlib.h>Go to the source code of this file.
Functions | |
| int | EVP_MD_get_size (const EVP_MD *md) |
| Forward declaration for EVP_MD_get_size on older headers. | |
| static char * | fun_openssl_md5_hex (const unsigned char *data, size_t len) |
| Compute MD5 and return it as a lowercase hexadecimal string. | |
| static char * | fun_openssl_sha256_hex (const unsigned char *data, size_t len) |
| Compute SHA-256 and return it as a lowercase hexadecimal string. | |
| static char * | fun_openssl_sha512_hex (const unsigned char *data, size_t len) |
| Compute SHA-512 and return it as a lowercase hexadecimal string. | |
| static char * | fun_openssl_ripemd160_hex (const unsigned char *data, size_t len) |
| Compute RIPEMD-160 and return it as a lowercase hexadecimal string. | |
OpenSSL-based hashing helpers used by crypto-related VM opcodes.
This module centralizes small, concrete helpers around the OpenSSL EVP message-digest API so that VM opcodes under src/vm/crypto/*.c can remain minimal and focus on VM stack marshalling. Keeping the algorithm-specific logic in src/extensions/ mirrors other extensions (PCRE2, SQLite, XML2, JSON, INI) and improves maintainability.
Build-time feature flag:
Algorithms covered:
Ownership and memory model:
Zero-length input:
Error handling:
OpenSSL 3.x provider note:
Thread-safety:
Definition in file openssl.c.
| int EVP_MD_get_size | ( | const EVP_MD * | md | ) |
Forward declaration for EVP_MD_get_size on older headers.
Some older OpenSSL headers might not declare EVP_MD_get_size even though the symbol is available in libcrypto. Guarded declaration keeps compilation working across versions while always calling the same function.
|
static |
Compute MD5 and return it as a lowercase hexadecimal string.
Behavior and edge cases:
| data | Pointer to input bytes (may be NULL if len==0). |
| len | Number of input bytes. |
|
static |
Compute RIPEMD-160 and return it as a lowercase hexadecimal string.
Availability and details:
| data | Pointer to input bytes (may be NULL if len==0). |
| len | Number of input bytes. |
|
static |
Compute SHA-256 and return it as a lowercase hexadecimal string.
Details:
| data | Pointer to input bytes (may be NULL if len==0). |
| len | Number of input bytes. |
|
static |
Compute SHA-512 and return it as a lowercase hexadecimal string.
Details:
| data | Pointer to input bytes (may be NULL if len==0). |
| len | Number of input bytes. |