summaryrefslogtreecommitdiff
path: root/src/lib/libc/stdlib/recallocarray.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2025-09-05wycheproof: add support for EcCurve teststb1-1/+103
This checks for a collection of prime order groups (secp, Brainpool, FRP) the curve parameters are corrct. The collection is a superset of our built-in curves, so we get one more validation for exxentially free.
2025-09-05wycheproof: add custom JSON unmarshaler big integerstb1-9/+58
Since the wycheproof tests were written in Java, they inherited some of that language's weirdnesses. For example, the hex representation may have odd length, is 2-complement and needs zero-padding if the top bit of a nibble is set, similar to ASN.1 integers. This is needed for correctly decoding the Primality test cases, which worked nicely in v0 but no longer for v1. Convert the Primality test to use this.
2025-09-05wycheproof: make RSA tests worktb1-43/+79
There's more work needed here since some of the tests are designed to test the signing side of things, where we only verify. To be dealt with later.
2025-09-05wycheproof: move ECDSA tests to v1tb1-14/+15
This excludes the bitcoin tests since our ECDSA_verify() doesn't have the logic to enforce s < order / 2 to avoid the well-known malleability issue with secp256k1 that (r, s) is valid if and only if (r, order - s) is valid. Moreover, add a workaround for overly picky P1363 tests where only correctly padded P1363 signatures are accepted. As the test authors say "To our knowledge no standard (i.e., IEEE P1363 or RFC 7515) requires any explicit checks of the signature size during signature verification." In fact, the problem really is in the test code, not in libcrypto and is a bit annoying to fix in a non-silly way.
2025-09-05wycheproof: move ECDH tests to v1 (skip PEM for now)tb1-6/+5
2025-09-05wycheproof: move AES to v1 and explicitly skip gmac testtb1-3/+3
2025-09-04wycheproof: go fmttb1-6/+6
2025-09-04wycheproof: move HKDF to v1tb1-2/+2
2025-09-04wycheproof: move EdDSA to v1tb1-7/+7
eddsa_test.json is now ed25519_test.json and again key* was renamed to PublicKey*.
2025-09-04wycheproof: move DSA to v1tb1-6/+6
key* are now called PublicKey*, so change teh json tags accordingly.
2025-09-04wycheproof: move x25519 to v1tb1-5/+5
2025-09-04wycheproof: migrate {,X}ChaCha20-Poly1305 to v1tb1-3/+3
2025-09-04wycheproof: migrate HMAC to v1tb1-3/+3
This is straightforward since the schema did not change. This adds coverage for HMAC-SHA512/224 and HMAC-SHA512/256.
2025-09-04wycheproof: add struct to support the testvector_v1 schematb1-7/+26
2025-09-04wycheproof: add version sum type and annotate all tests as v0tb1-30/+41
The version is passed to the test runner, so it can unmarshal the v0 and v1 JSON as appropriate later on.
2025-09-04wycheproof: use local variables for testGroups and algorithmtb1-7/+11
2025-09-04wycheproof: start migrating to testvectors_v1tb1-4/+5
In https://github.com/C2SP/wycheproof/pull/169, upstream removed the testvector/ path, thereby creating the need to migrate if we want to benefit from future changes and tests. While this has been around for a very long time and generally provided more and better coverage, there never was sufficient motivation to do so. As a first step, change use of the testVectorPath constant to use of a path variable so we can switch the tests one by one by appending _v1 when appropriate.
2025-09-02Disable assembly bn_sqr_words() again for now.jsing3-8/+8
The old assembly bn_sqr_words() does not actually square words in the bignum sense. These will have to be renamed (once I come up with a name for whatever it actually does) before we can roll forward again. Found the hard way by Janne Johansson.
2025-09-01Add const here as well...jsing1-2/+2
2025-09-01Use bn_mul_words() from bn_mod_mul_words().jsing1-5/+3
Use bn_mul_words() and bn_montgomery_reduce_words(), rather than using bn_montgomery_multiply_words(). This provides better performance on architectures that have assembly optimised bn_mul_words(), such as amd64.
2025-09-01Constify bn_mul_words().jsing3-6/+9
2025-09-01Use bn_sqr_words() from bn_mod_sqr_words().jsing1-5/+3
Use bn_sqr_words() and bn_montgomery_reduce_words(), rather than using bn_montgomery_multiply_words(). This provides better performance on architectures that have assembly optimised bn_sqr_words(), such as amd64. ok tb@
2025-09-01Provide bn_mul_words() on amd64.jsing2-2/+12
This uses s2n-bignum's bignum_mul() and provides significant performance gains for a range of multiplication sizes.
2025-08-31EC_GROUP_new_curve_GFp: add a sentence on what elliptic curves look liketb1-2/+7
(for our purposes).
2025-08-31Remove bn_dump.3tb1-415/+0
Not installed for nearly a decade since it only "documents" internal functions and structs and the internal function doco gets more out of sync with reality with every (much needed) pass over bn/
2025-08-31Reorder functions since they've been renamed.jsing1-17/+17
2025-08-31Rename prototype for bn_mul_normal().jsing1-2/+2
This was missed in the previous commit.
2025-08-30Rename bn_mul_words()/bn_mul_add_words().jsing14-111/+106
Most bn_.*_words() functions operate on two word arrays, however bn_mul_words() and bn_mul_add_words() operate on one word array and multiply by a single word. Rename these to bn_mulw_words() and bn_mulw_add_words() to reflect this, following naming scheme that we use for primitives. This frees up bn_mul_words() to actually be used for multiplying two word arrays. Rename bn_mul_normal() to bn_mul_words(), which will then become one of the possible assembly integration points. ok tb@
2025-08-30Rework bn_sqr() to use bn_sqr_words().jsing4-26/+27
Rework some of the squaring code so that it calls bn_sqr_words() and use this as the integration point for assembly. Convert bn_sqr_normal() to bn_sqr_words(), which is then used on architectures that do not provide their own version. This means that we resume using the assembly version of bn_sqr_words() on i386, mips64 and powerpc, which can provide considerable performance gains. ok tb@
2025-08-29Remove OPENSSL_VAR_AS_FUNCTION #undeftb1-3/+1
The code supporting this toggle has long been removed from all the forks. discussed with jsing
2025-08-26ec_asn1_test: fix error messagetb1-2/+2
2025-08-26ec_asn1_test: d'oh. actually ensure all builtin curves are of prime ordertb1-6/+6
2025-08-26ec_asn1_test: ensure all builtin curves are of prime ordertb1-1/+58
2025-08-26ec_mult.c: place this code under my ISC licensetb1-58/+13
I have effectively rewritten the entirety of this file end of 2024. This isn't code I'm particularly proud of, but it's much better than it was before (it's not as if that involved any sort of challenge...) requested by/ok jsing
2025-08-26rsa_method_test: point at correct function in error stringtb1-2/+2
2025-08-25zap stray spacetb1-2/+2
2025-08-25Move opensslconf.h to a machine-independent placetb14-158/+7
After drilling through many layers of fossilized turds from a long-forgotten millenium, jsing and I finally found oil^Wa machine-independent version of opensslconf.h. Remove the no longer needed versions in arch/*/ and move one copy to the top level. Add an RCS tag and place the remaining garbage in the public domain. ok jsing
2025-08-25freenull: missing target deps, use -Wall -Werror like elsewheretb1-2/+4
2025-08-25freenull.c.head: include mlkem.h for MLKEM_{private,public}_key_free()tb1-1/+2
2025-08-22Also print addresses of the _libre_ symbolstb1-2/+6
2025-08-22fix symbols test to actually detect missing _libre_ symbolstb1-2/+2
2025-08-22Hide primitive BOOLEAN itemstb2-2/+8
Rides the libcrypto bump from a couple days ago
2025-08-19x_crl.c: wont -> won't + KNF for a commenttb1-3/+4
2025-08-19An executive decision has been taken to expose marshal private key as welltb5-9/+13
rides the libcrypto bump
2025-08-19same crank for libssl and libtls as for libcryptotb2-2/+2
2025-08-19bump libcrypto minor after symbol additiontb1-1/+1
2025-08-19Expose beck's version of BoringSSL's ML-KEM APitb1-0/+16
This includes interfaces for public and private keys for ML-KEM 768 and 1024. Marshalling and parsing of public keys and parsing of the wasteful NIST format of private keys (marshalling this private key format is deliberately omitted from the public API). Decapsulation and encapsulation of shared secrets. This will soon be used to implement the X25519MLKEM768 hybrid key agreement in libssl. ok beck jsing
2025-08-19Add back the ASN1_{,F,T}BOOLEAN_it ASN.1 itemstb1-0/+3
I was overeager to remove those a while back. This was dumb because this is about a basic ASN.1 type. The Gentoo maintainers found that tpm2-tools uses templated ASN.1 involving them. Fixes https://github.com/libressl/portable/issues/1178 ok beck jsing
2025-08-18sync with crypto_namespace.h: avoid asm("") for MSVCtb1-1/+5
Removes another patch in portable
2025-08-18Avoid asm("") for MSVCtb1-1/+5
This allows us to get rid of an ugly patch in portable. ok jsing