1
0
Fork 0
forked from fun/fun

Added LibreSSL as an alternative to OpenSSL. Needs more testing! (0.38.16)

This commit is contained in:
Johannes Findeisen 2026-02-19 23:33:00 +01:00
commit 3e0d47a268
35 changed files with 677 additions and 38 deletions

View file

@ -0,0 +1,28 @@
#!/usr/bin/env fun
/*
* This file is part of the Fun programming language.
* https://fun-lang.xyz/
*
* Copyright 2026 Johannes Findeisen <you@hanez.org>
* Licensed under the terms of the Apache-2.0 license.
* https://opensource.org/license/apache-2-0
*
* Added: 2026-02-19
*/
// LibreSSL MD5 example
// Enable with -DFUN_WITH_LIBRESSL=ON during build for real hashing.
s = "abc"
d = libressl_md5(s)
print("md5(abc) = " + d)
// Another quick check (empty string)
e = ""
print("md5(\"\") = " + libressl_md5(e))
/* Expected output:
md5(abc) = 900150983cd24fb0d6963f7d28e17f72
md5("") = d41d8cd98f00b204e9800998ecf8427e
*/

View file

@ -0,0 +1,28 @@
#!/usr/bin/env fun
/*
* This file is part of the Fun programming language.
* https://fun-lang.xyz/
*
* Copyright 2026 Johannes Findeisen <you@hanez.org>
* Licensed under the terms of the Apache-2.0 license.
* https://opensource.org/license/apache-2-0
*
* Added: 2026-02-19
*/
// LibreSSL RIPEMD-160 example
// Enable with -DFUN_WITH_LIBRESSL=ON during build for real hashing.
s = "abc"
d = libressl_ripemd160(s)
print("ripemd160(abc) = " + d)
// Another quick check (empty string)
e = ""
print("ripemd160(\"\") = " + libressl_ripemd160(e))
/* Expected output:
ripemd160(abc) = 8eb208f7e05d987a9b049a9a5c0c2b74e07e6a5d
ripemd160("") = 9c1185a5c5e9fc54612808977ee8f548b2258d31
*/

View file

@ -0,0 +1,28 @@
#!/usr/bin/env fun
/*
* This file is part of the Fun programming language.
* https://fun-lang.xyz/
*
* Copyright 2026 Johannes Findeisen <you@hanez.org>
* Licensed under the terms of the Apache-2.0 license.
* https://opensource.org/license/apache-2-0
*
* Added: 2026-02-19
*/
// LibreSSL SHA-256 example
// Enable with -DFUN_WITH_LIBRESSL=ON during build for real hashing.
s = "abc"
d = libressl_sha256(s)
print("sha256(abc) = " + d)
// Another quick check (empty string)
e = ""
print("sha256(\"\") = " + libressl_sha256(e))
/* Expected output:
sha256(abc) = ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad
sha256("") = e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
*/

View file

@ -0,0 +1,28 @@
#!/usr/bin/env fun
/*
* This file is part of the Fun programming language.
* https://fun-lang.xyz/
*
* Copyright 2026 Johannes Findeisen <you@hanez.org>
* Licensed under the terms of the Apache-2.0 license.
* https://opensource.org/license/apache-2-0
*
* Added: 2026-02-19
*/
// LibreSSL SHA-512 example
// Enable with -DFUN_WITH_LIBRESSL=ON during build for real hashing.
s = "abc"
d = libressl_sha512(s)
print("sha512(abc) = " + d)
// Another quick check (empty string)
e = ""
print("sha512(\"\") = " + libressl_sha512(e))
/* Expected output:
sha512(abc) = ddaf35a193617abacc417349ae20413112e6fa4e89a97ea20a9eeee64b55d39a2192992a274fc1a836ba3c23a3feebbd454d4423643ce80e2a9ac94fa54ca49f
sha512("") = cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e
*/