summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/pkcs12/p12_sbag.c (unfollow)
Commit message (Collapse)AuthorFilesLines
6 daysCall aes_set_encrypt_key_generic() from aes_set_decrypt_key_generic().jsing1-2/+2
With the renaming, aes_set_decrypt_key_generic() should now call aes_set_encrypt_key_generic() directly.
6 daysAllow generic AES implementation to be used as a fallback.jsing3-19/+65
Rename the C based AES implementation to *_generic() and provide *_internal() wrappers for these. This allows for architectures to provide accelerated versions without having to also provide a fallback implementation. ok tb@
6 daysZero the round keys on AES_set_{en,de}crypt_key() function entry.jsing1-1/+5
This avoids leaving previous round keys around on failure, or leaving parts of previous round keys behind if reused with a smaller key size. ok tb@
6 daysValidate AES_set_{encrypt,decrypt}_key() inputs at API boundary.jsing2-18/+28
Every aes_set_{encrypt,decrypt}_key_internal() implementation is currently required to check the inputs and return appropriate error codes. Pull the input validation up to the API boundary, setting key->rounds at the same time. Additionally, call aes_set_encrypt_key_internal() directly from aes_set_decrypt_key_internal(), rather than going back through the public API. ok tb@
6 dayswycheproof: rework test selectiontb1-69/+82
Since this has grown organically, the test selection has become a weird mix of globs, regexes and test variants and it is hard to reason about what is run and why. Instead, load all the json files from testvectors_v1/ and look at algorithm (almost always available) and test schema to figure out if we support it in libcrypto and the test harness. This separates the logic of the test runner better from the test selection. Also make it a fatal error if we don't explicitly skip an unknown algorithm.
6 dayswycheproof: skip tests using curve448/edwards448tb1-7/+12
6 dayswycheproof: skip tests using SHAKE-128 and SHAKE-256tb1-1/+17
6 dayswycheproof: rename skipSmallCurve() into skipCurve()tb1-4/+6
This prepares an upcoming change by not only skipping small curves but also binary curves that have test vectors.
6 dayswycheproof: determine the test variant from the JSON schematb1-30/+41
6 dayswycheproof: retire the ECDSA webcrypto teststb1-71/+2
The webcrypto test files for P-256, P-384, and P-521 are identical to the P1363 test files for these curves with the hashes SHA-256, SHA-384, and SHA-512, respectively. The only real differences in the test paths is the Go glue code to translate to libcrypto, so they're pointless.
7 daysRemove BN_DIV2W.jsing3-28/+4
The BN_DIV2W define provides a code path for double word division via the C compiler, which is only enabled on hppa. Simplify the code and mop this up. ok tb@
7 daysRe-enable bn_sqr_words() assembly.jsing3-8/+8
This is now only on amd64.
7 daysRename old assembly bn_sqr_words() to bn_sqr_word_wise().jsing6-30/+27
bn_sqr_words() does not actually compute the square of the words, it only computes the square of each individual word - rename it to reflect reality. Discussed with tb@
8 dayswycheproof: go fmttb1-4/+4
8 dayswycheproof: use a cleaner way of dealing with P1363 signature lengthtb1-4/+12
8 daysDeduplicate the mlkem 768 and mlkem 1024 code.beck6-1788/+527
This moves everything not public to mlkem_internal.c removing the old files and doing some further cleanup on the way. With this landed mlkem is out of my stack and can be changed without breaking my subsequent changes ok tb@
9 dayswycheproof: check for the v1 directory since v0 will go awaytb1-2/+2
9 dayswycheproof: port the MI primes check to v1tb2-3/+24
9 dayswycheproof: remove support for v0 test vectorstb1-68/+38
9 dayswycheproof: drop JOSE teststb1-2/+1
These are no longer supported in v1 and we skipped them anyway.
9 dayswycheproof: move AES key wrap tests to v1tb1-4/+4
9 dayswycheproof: 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.
9 dayswycheproof: 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.
9 dayswycheproof: 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.
9 dayswycheproof: 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.
9 dayswycheproof: move ECDH tests to v1 (skip PEM for now)tb1-6/+5
9 dayswycheproof: move AES to v1 and explicitly skip gmac testtb1-3/+3
10 dayswycheproof: go fmttb1-6/+6
10 dayswycheproof: move HKDF to v1tb1-2/+2
10 dayswycheproof: move EdDSA to v1tb1-7/+7
eddsa_test.json is now ed25519_test.json and again key* was renamed to PublicKey*.
10 dayswycheproof: move DSA to v1tb1-6/+6
key* are now called PublicKey*, so change teh json tags accordingly.
10 dayswycheproof: move x25519 to v1tb1-5/+5
10 dayswycheproof: migrate {,X}ChaCha20-Poly1305 to v1tb1-3/+3
10 dayswycheproof: 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.
10 dayswycheproof: add struct to support the testvector_v1 schematb1-7/+26
10 dayswycheproof: 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.
10 dayswycheproof: use local variables for testGroups and algorithmtb1-7/+11
10 dayswycheproof: 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.
12 daysDisable 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.
13 daysAdd const here as well...jsing1-2/+2
13 daysUse 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.
13 daysConstify bn_mul_words().jsing3-6/+9
13 daysUse 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@
13 daysProvide 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.
14 daysEC_GROUP_new_curve_GFp: add a sentence on what elliptic curves look liketb1-2/+7
(for our purposes).
14 daysRemove 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/
14 daysReorder functions since they've been renamed.jsing1-17/+17
14 daysRename 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@