2 * Copyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved.
4 * Licensed under the Apache License 2.0 (the "License"). You may not use
5 * this file except in compliance with the License. You can obtain a copy
6 * in the file LICENSE in the source distribution or at
7 * https://www.openssl.org/source/license.html
11 #include <openssl/evp.h>
12 #include <openssl/kdf.h>
13 #include <openssl/core_names.h>
14 #include <openssl/param_build.h>
15 #include "internal/cryptlib.h"
16 #include "internal/nelem.h"
17 #include "self_test.h"
18 #include "self_test_data.inc"
20 static int self_test_digest(const ST_KAT_DIGEST
*t
, OSSL_SELF_TEST
*st
,
24 unsigned char out
[EVP_MAX_MD_SIZE
];
25 unsigned int out_len
= 0;
26 EVP_MD_CTX
*ctx
= EVP_MD_CTX_new();
27 EVP_MD
*md
= EVP_MD_fetch(libctx
, t
->algorithm
, NULL
);
29 OSSL_SELF_TEST_onbegin(st
, OSSL_SELF_TEST_TYPE_KAT_DIGEST
, t
->desc
);
33 || !EVP_DigestInit_ex(ctx
, md
, NULL
)
34 || !EVP_DigestUpdate(ctx
, t
->pt
, t
->pt_len
)
35 || !EVP_DigestFinal(ctx
, out
, &out_len
))
38 /* Optional corruption */
39 OSSL_SELF_TEST_oncorrupt_byte(st
, out
);
41 if (out_len
!= t
->expected_len
42 || memcmp(out
, t
->expected
, out_len
) != 0)
48 OSSL_SELF_TEST_onend(st
, ok
);
53 * Helper function to setup a EVP_CipherInit
54 * Used to hide the complexity of Authenticated ciphers.
56 static int cipher_init(EVP_CIPHER_CTX
*ctx
, const EVP_CIPHER
*cipher
,
57 const ST_KAT_CIPHER
*t
, int enc
)
59 unsigned char *in_tag
= NULL
;
62 /* Flag required for Key wrapping */
63 EVP_CIPHER_CTX_set_flags(ctx
, EVP_CIPHER_CTX_FLAG_WRAP_ALLOW
);
65 /* Use a normal cipher init */
66 return EVP_CipherInit_ex(ctx
, cipher
, NULL
, t
->key
, t
->iv
, enc
)
67 && EVP_CIPHER_CTX_set_padding(ctx
, pad
);
70 /* The authenticated cipher init */
72 in_tag
= (unsigned char *)t
->tag
;
74 return EVP_CipherInit_ex(ctx
, cipher
, NULL
, NULL
, NULL
, enc
)
75 && EVP_CIPHER_CTX_ctrl(ctx
, EVP_CTRL_AEAD_SET_IVLEN
, t
->iv_len
, NULL
)
77 || EVP_CIPHER_CTX_ctrl(ctx
, EVP_CTRL_AEAD_SET_TAG
, t
->tag_len
,
79 && EVP_CipherInit_ex(ctx
, NULL
, NULL
, t
->key
, t
->iv
, enc
)
80 && EVP_CIPHER_CTX_set_padding(ctx
, pad
)
81 && EVP_CipherUpdate(ctx
, NULL
, &tmp
, t
->aad
, t
->aad_len
);
84 /* Test a single KAT for encrypt/decrypt */
85 static int self_test_cipher(const ST_KAT_CIPHER
*t
, OSSL_SELF_TEST
*st
,
88 int ret
= 0, encrypt
= 1, len
, ct_len
= 0, pt_len
= 0;
89 EVP_CIPHER_CTX
*ctx
= NULL
;
90 EVP_CIPHER
*cipher
= NULL
;
91 unsigned char ct_buf
[256] = { 0 };
92 unsigned char pt_buf
[256] = { 0 };
94 OSSL_SELF_TEST_onbegin(st
, OSSL_SELF_TEST_TYPE_KAT_CIPHER
, t
->base
.desc
);
96 ctx
= EVP_CIPHER_CTX_new();
99 cipher
= EVP_CIPHER_fetch(libctx
, t
->base
.algorithm
, "");
103 /* Encrypt plain text message */
104 if (!cipher_init(ctx
, cipher
, t
, encrypt
)
105 || !EVP_CipherUpdate(ctx
, ct_buf
, &len
, t
->base
.pt
, t
->base
.pt_len
)
106 || !EVP_CipherFinal_ex(ctx
, ct_buf
+ len
, &ct_len
))
109 OSSL_SELF_TEST_oncorrupt_byte(st
, ct_buf
);
111 if (ct_len
!= (int)t
->base
.expected_len
112 || memcmp(t
->base
.expected
, ct_buf
, ct_len
) != 0)
115 if (t
->tag
!= NULL
) {
116 unsigned char tag
[16] = { 0 };
118 if (!EVP_CIPHER_CTX_ctrl(ctx
, EVP_CTRL_AEAD_GET_TAG
, t
->tag_len
, tag
)
119 || memcmp(tag
, t
->tag
, t
->tag_len
) != 0)
123 if (!(cipher_init(ctx
, cipher
, t
, !encrypt
)
124 && EVP_CipherUpdate(ctx
, pt_buf
, &len
, ct_buf
, ct_len
)
125 && EVP_CipherFinal_ex(ctx
, pt_buf
+ len
, &pt_len
)))
129 if (pt_len
!= (int)t
->base
.pt_len
130 || memcmp(pt_buf
, t
->base
.pt
, pt_len
) != 0)
135 EVP_CIPHER_free(cipher
);
136 EVP_CIPHER_CTX_free(ctx
);
137 OSSL_SELF_TEST_onend(st
, ret
);
141 static int add_params(OSSL_PARAM_BLD
*bld
, const ST_KAT_PARAM
*params
,
145 const ST_KAT_PARAM
*p
;
149 for (p
= params
; p
->data
!= NULL
; ++p
)
152 case OSSL_PARAM_UNSIGNED_INTEGER
: {
153 BIGNUM
*bn
= BN_CTX_get(ctx
);
156 || (BN_bin2bn(p
->data
, p
->data_len
, bn
) == NULL
)
157 || !OSSL_PARAM_BLD_push_BN(bld
, p
->name
, bn
))
161 case OSSL_PARAM_UTF8_STRING
: {
162 if (!OSSL_PARAM_BLD_push_utf8_string(bld
, p
->name
, p
->data
,
167 case OSSL_PARAM_OCTET_STRING
: {
168 if (!OSSL_PARAM_BLD_push_octet_string(bld
, p
->name
, p
->data
,
173 case OSSL_PARAM_INTEGER
: {
174 if (!OSSL_PARAM_BLD_push_int(bld
, p
->name
, *(int *)p
->data
))
187 static int self_test_kdf(const ST_KAT_KDF
*t
, OSSL_SELF_TEST
*st
,
188 OSSL_LIB_CTX
*libctx
)
191 unsigned char out
[128];
193 EVP_KDF_CTX
*ctx
= NULL
;
194 BN_CTX
*bnctx
= NULL
;
195 OSSL_PARAM
*params
= NULL
;
196 OSSL_PARAM_BLD
*bld
= NULL
;
198 OSSL_SELF_TEST_onbegin(st
, OSSL_SELF_TEST_TYPE_KAT_KDF
, t
->desc
);
200 bld
= OSSL_PARAM_BLD_new();
204 kdf
= EVP_KDF_fetch(libctx
, t
->algorithm
, "");
208 ctx
= EVP_KDF_CTX_new(kdf
);
212 bnctx
= BN_CTX_new_ex(libctx
);
215 if (!add_params(bld
, t
->params
, bnctx
))
217 params
= OSSL_PARAM_BLD_to_param(bld
);
221 if (t
->expected_len
> sizeof(out
))
223 if (EVP_KDF_derive(ctx
, out
, t
->expected_len
, params
) <= 0)
226 OSSL_SELF_TEST_oncorrupt_byte(st
, out
);
228 if (memcmp(out
, t
->expected
, t
->expected_len
) != 0)
234 EVP_KDF_CTX_free(ctx
);
236 OSSL_PARAM_free(params
);
237 OSSL_PARAM_BLD_free(bld
);
238 OSSL_SELF_TEST_onend(st
, ret
);
242 static int self_test_drbg(const ST_KAT_DRBG
*t
, OSSL_SELF_TEST
*st
,
243 OSSL_LIB_CTX
*libctx
)
246 unsigned char out
[256];
248 EVP_RAND_CTX
*test
= NULL
, *drbg
= NULL
;
249 unsigned int strength
= 256;
250 int prediction_resistance
= 1; /* Causes a reseed */
251 OSSL_PARAM drbg_params
[3] = {
252 OSSL_PARAM_END
, OSSL_PARAM_END
, OSSL_PARAM_END
255 OSSL_SELF_TEST_onbegin(st
, OSSL_SELF_TEST_TYPE_DRBG
, t
->desc
);
257 rand
= EVP_RAND_fetch(libctx
, "TEST-RAND", NULL
);
261 test
= EVP_RAND_CTX_new(rand
, NULL
);
266 drbg_params
[0] = OSSL_PARAM_construct_uint(OSSL_RAND_PARAM_STRENGTH
,
268 if (!EVP_RAND_set_ctx_params(test
, drbg_params
))
271 rand
= EVP_RAND_fetch(libctx
, t
->algorithm
, NULL
);
275 drbg
= EVP_RAND_CTX_new(rand
, test
);
280 strength
= EVP_RAND_strength(drbg
);
282 drbg_params
[0] = OSSL_PARAM_construct_utf8_string(t
->param_name
,
284 /* This is only used by HMAC-DRBG but it is ignored by the others */
286 OSSL_PARAM_construct_utf8_string(OSSL_DRBG_PARAM_MAC
, "HMAC", 0);
287 if (!EVP_RAND_set_ctx_params(drbg
, drbg_params
))
291 OSSL_PARAM_construct_octet_string(OSSL_RAND_PARAM_TEST_ENTROPY
,
292 (void *)t
->entropyin
,
295 OSSL_PARAM_construct_octet_string(OSSL_RAND_PARAM_TEST_NONCE
,
296 (void *)t
->nonce
, t
->noncelen
);
297 if (!EVP_RAND_instantiate(test
, strength
, 0, NULL
, 0, drbg_params
))
299 if (!EVP_RAND_instantiate(drbg
, strength
, 0, t
->persstr
, t
->persstrlen
,
304 OSSL_PARAM_construct_octet_string(OSSL_RAND_PARAM_TEST_ENTROPY
,
305 (void *)t
->entropyinpr1
,
307 if (!EVP_RAND_set_ctx_params(test
, drbg_params
))
310 if (!EVP_RAND_generate(drbg
, out
, t
->expectedlen
, strength
,
311 prediction_resistance
,
312 t
->entropyaddin1
, t
->entropyaddin1len
))
316 OSSL_PARAM_construct_octet_string(OSSL_RAND_PARAM_TEST_ENTROPY
,
317 (void *)t
->entropyinpr2
,
319 if (!EVP_RAND_set_ctx_params(test
, drbg_params
))
323 * This calls ossl_prov_drbg_reseed() internally when
324 * prediction_resistance = 1
326 if (!EVP_RAND_generate(drbg
, out
, t
->expectedlen
, strength
,
327 prediction_resistance
,
328 t
->entropyaddin2
, t
->entropyaddin2len
))
331 OSSL_SELF_TEST_oncorrupt_byte(st
, out
);
333 if (memcmp(out
, t
->expected
, t
->expectedlen
) != 0)
336 if (!EVP_RAND_uninstantiate(drbg
))
339 * Check that the DRBG data has been zeroized after
340 * ossl_prov_drbg_uninstantiate.
342 if (!EVP_RAND_verify_zeroization(drbg
))
347 EVP_RAND_CTX_free(drbg
);
348 EVP_RAND_CTX_free(test
);
349 OSSL_SELF_TEST_onend(st
, ret
);
353 #if !defined(OPENSSL_NO_DH) || !defined(OPENSSL_NO_EC)
354 static int self_test_ka(const ST_KAT_KAS
*t
,
355 OSSL_SELF_TEST
*st
, OSSL_LIB_CTX
*libctx
)
358 EVP_PKEY_CTX
*kactx
= NULL
, *dctx
= NULL
;
359 EVP_PKEY
*pkey
= NULL
, *peerkey
= NULL
;
360 OSSL_PARAM
*params
= NULL
;
361 OSSL_PARAM
*params_peer
= NULL
;
362 unsigned char secret
[256];
363 size_t secret_len
= sizeof(secret
);
364 OSSL_PARAM_BLD
*bld
= NULL
;
365 BN_CTX
*bnctx
= NULL
;
367 OSSL_SELF_TEST_onbegin(st
, OSSL_SELF_TEST_TYPE_KAT_KA
, t
->desc
);
369 bnctx
= BN_CTX_new_ex(libctx
);
373 bld
= OSSL_PARAM_BLD_new();
377 if (!add_params(bld
, t
->key_group
, bnctx
)
378 || !add_params(bld
, t
->key_host_data
, bnctx
))
380 params
= OSSL_PARAM_BLD_to_param(bld
);
382 if (!add_params(bld
, t
->key_group
, bnctx
)
383 || !add_params(bld
, t
->key_peer_data
, bnctx
))
386 params_peer
= OSSL_PARAM_BLD_to_param(bld
);
387 if (params
== NULL
|| params_peer
== NULL
)
390 /* Create a EVP_PKEY_CTX to load the DH keys into */
391 kactx
= EVP_PKEY_CTX_new_from_name(libctx
, t
->algorithm
, "");
394 if (EVP_PKEY_fromdata_init(kactx
) <= 0
395 || EVP_PKEY_fromdata(kactx
, &pkey
, EVP_PKEY_KEYPAIR
, params
) <= 0)
397 if (EVP_PKEY_fromdata_init(kactx
) <= 0
398 || EVP_PKEY_fromdata(kactx
, &peerkey
, EVP_PKEY_KEYPAIR
, params_peer
) <= 0)
401 /* Create a EVP_PKEY_CTX to perform key derivation */
402 dctx
= EVP_PKEY_CTX_new_from_pkey(libctx
, pkey
, NULL
);
406 if (EVP_PKEY_derive_init(dctx
) <= 0
407 || EVP_PKEY_derive_set_peer(dctx
, peerkey
) <= 0
408 || EVP_PKEY_derive(dctx
, secret
, &secret_len
) <= 0)
411 OSSL_SELF_TEST_oncorrupt_byte(st
, secret
);
413 if (secret_len
!= t
->expected_len
414 || memcmp(secret
, t
->expected
, t
->expected_len
) != 0)
420 EVP_PKEY_free(peerkey
);
421 EVP_PKEY_CTX_free(kactx
);
422 EVP_PKEY_CTX_free(dctx
);
423 OSSL_PARAM_free(params_peer
);
424 OSSL_PARAM_free(params
);
425 OSSL_PARAM_BLD_free(bld
);
426 OSSL_SELF_TEST_onend(st
, ret
);
429 #endif /* !defined(OPENSSL_NO_DH) || !defined(OPENSSL_NO_EC) */
431 static int self_test_sign(const ST_KAT_SIGN
*t
,
432 OSSL_SELF_TEST
*st
, OSSL_LIB_CTX
*libctx
)
435 OSSL_PARAM
*params
= NULL
, *params_sig
= NULL
;
436 OSSL_PARAM_BLD
*bld
= NULL
;
437 EVP_PKEY_CTX
*sctx
= NULL
, *kctx
= NULL
;
438 EVP_PKEY
*pkey
= NULL
;
439 unsigned char sig
[256];
440 BN_CTX
*bnctx
= NULL
;
442 static const unsigned char dgst
[] = {
443 0x7f, 0x83, 0xb1, 0x65, 0x7f, 0xf1, 0xfc, 0x53, 0xb9, 0x2d, 0xc1, 0x81,
444 0x48, 0xa1, 0xd6, 0x5d, 0xfc, 0x2d, 0x4b, 0x1f, 0xa3, 0xd6, 0x77, 0x28,
445 0x4a, 0xdd, 0xd2, 0x00, 0x12, 0x6d, 0x90, 0x69
448 OSSL_SELF_TEST_onbegin(st
, OSSL_SELF_TEST_TYPE_KAT_SIGNATURE
, t
->desc
);
450 bnctx
= BN_CTX_new_ex(libctx
);
454 bld
= OSSL_PARAM_BLD_new();
458 if (!add_params(bld
, t
->key
, bnctx
))
460 params
= OSSL_PARAM_BLD_to_param(bld
);
462 /* Create a EVP_PKEY_CTX to load the DSA key into */
463 kctx
= EVP_PKEY_CTX_new_from_name(libctx
, t
->algorithm
, "");
464 if (kctx
== NULL
|| params
== NULL
)
466 if (EVP_PKEY_fromdata_init(kctx
) <= 0
467 || EVP_PKEY_fromdata(kctx
, &pkey
, EVP_PKEY_KEYPAIR
, params
) <= 0)
470 /* Create a EVP_PKEY_CTX to use for the signing operation */
471 sctx
= EVP_PKEY_CTX_new_from_pkey(libctx
, pkey
, NULL
);
473 || EVP_PKEY_sign_init(sctx
) <= 0)
476 /* set signature parameters */
477 if (!OSSL_PARAM_BLD_push_utf8_string(bld
, OSSL_SIGNATURE_PARAM_DIGEST
,
479 strlen(t
->mdalgorithm
) + 1))
481 params_sig
= OSSL_PARAM_BLD_to_param(bld
);
482 if (EVP_PKEY_CTX_set_params(sctx
, params_sig
) <= 0)
485 if (EVP_PKEY_sign(sctx
, sig
, &siglen
, dgst
, sizeof(dgst
)) <= 0
486 || EVP_PKEY_verify_init(sctx
) <= 0
487 || EVP_PKEY_CTX_set_params(sctx
, params_sig
) <= 0)
491 * Used by RSA, for other key types where the signature changes, we
492 * can only use the verify.
494 if (t
->sig_expected
!= NULL
495 && (siglen
!= t
->sig_expected_len
496 || memcmp(sig
, t
->sig_expected
, t
->sig_expected_len
) != 0))
499 OSSL_SELF_TEST_oncorrupt_byte(st
, sig
);
500 if (EVP_PKEY_verify(sctx
, sig
, siglen
, dgst
, sizeof(dgst
)) <= 0)
506 EVP_PKEY_CTX_free(kctx
);
507 EVP_PKEY_CTX_free(sctx
);
508 OSSL_PARAM_free(params
);
509 OSSL_PARAM_free(params_sig
);
510 OSSL_PARAM_BLD_free(bld
);
511 OSSL_SELF_TEST_onend(st
, ret
);
516 * Test an encrypt or decrypt KAT..
518 * FIPS 140-2 IG D.9 states that separate KAT tests are needed for encrypt
521 static int self_test_asym_cipher(const ST_KAT_ASYM_CIPHER
*t
, OSSL_SELF_TEST
*st
,
522 OSSL_LIB_CTX
*libctx
)
525 OSSL_PARAM
*keyparams
= NULL
, *initparams
= NULL
;
526 OSSL_PARAM_BLD
*keybld
= NULL
, *initbld
= NULL
;
527 EVP_PKEY_CTX
*encctx
= NULL
, *keyctx
= NULL
;
528 EVP_PKEY
*key
= NULL
;
529 BN_CTX
*bnctx
= NULL
;
530 unsigned char out
[256];
531 size_t outlen
= sizeof(out
);
533 OSSL_SELF_TEST_onbegin(st
, OSSL_SELF_TEST_TYPE_KAT_ASYM_CIPHER
, t
->desc
);
535 bnctx
= BN_CTX_new_ex(libctx
);
539 /* Load a public or private key from data */
540 keybld
= OSSL_PARAM_BLD_new();
542 || !add_params(keybld
, t
->key
, bnctx
))
544 keyparams
= OSSL_PARAM_BLD_to_param(keybld
);
545 keyctx
= EVP_PKEY_CTX_new_from_name(libctx
, t
->algorithm
, NULL
);
546 if (keyctx
== NULL
|| keyparams
== NULL
)
548 if (EVP_PKEY_fromdata_init(keyctx
) <= 0
549 || EVP_PKEY_fromdata(keyctx
, &key
, EVP_PKEY_KEYPAIR
, keyparams
) <= 0)
552 /* Create a EVP_PKEY_CTX to use for the encrypt or decrypt operation */
553 encctx
= EVP_PKEY_CTX_new_from_pkey(libctx
, key
, NULL
);
555 || (t
->encrypt
&& EVP_PKEY_encrypt_init(encctx
) <= 0)
556 || (!t
->encrypt
&& EVP_PKEY_decrypt_init(encctx
) <= 0))
559 /* Add any additional parameters such as padding */
560 if (t
->postinit
!= NULL
) {
561 initbld
= OSSL_PARAM_BLD_new();
564 if (!add_params(initbld
, t
->postinit
, bnctx
))
566 initparams
= OSSL_PARAM_BLD_to_param(initbld
);
567 if (initparams
== NULL
)
569 if (EVP_PKEY_CTX_set_params(encctx
, initparams
) <= 0)
574 if (EVP_PKEY_encrypt(encctx
, out
, &outlen
,
575 t
->in
, t
->in_len
) <= 0)
578 if (EVP_PKEY_decrypt(encctx
, out
, &outlen
,
579 t
->in
, t
->in_len
) <= 0)
583 OSSL_SELF_TEST_oncorrupt_byte(st
, out
);
584 if (outlen
!= t
->expected_len
585 || memcmp(out
, t
->expected
, t
->expected_len
) != 0)
592 EVP_PKEY_CTX_free(encctx
);
593 EVP_PKEY_CTX_free(keyctx
);
594 OSSL_PARAM_free(keyparams
);
595 OSSL_PARAM_BLD_free(keybld
);
596 OSSL_PARAM_free(initparams
);
597 OSSL_PARAM_BLD_free(initbld
);
598 OSSL_SELF_TEST_onend(st
, ret
);
603 * Test a data driven list of KAT's for digest algorithms.
604 * All tests are run regardless of if they fail or not.
605 * Return 0 if any test fails.
607 static int self_test_digests(OSSL_SELF_TEST
*st
, OSSL_LIB_CTX
*libctx
)
611 for (i
= 0; i
< (int)OSSL_NELEM(st_kat_digest_tests
); ++i
) {
612 if (!self_test_digest(&st_kat_digest_tests
[i
], st
, libctx
))
618 static int self_test_ciphers(OSSL_SELF_TEST
*st
, OSSL_LIB_CTX
*libctx
)
622 for (i
= 0; i
< (int)OSSL_NELEM(st_kat_cipher_tests
); ++i
) {
623 if (!self_test_cipher(&st_kat_cipher_tests
[i
], st
, libctx
))
629 static int self_test_asym_ciphers(OSSL_SELF_TEST
*st
, OSSL_LIB_CTX
*libctx
)
633 for (i
= 0; i
< (int)OSSL_NELEM(st_kat_asym_cipher_tests
); ++i
) {
634 if (!self_test_asym_cipher(&st_kat_asym_cipher_tests
[i
], st
, libctx
))
640 static int self_test_kdfs(OSSL_SELF_TEST
*st
, OSSL_LIB_CTX
*libctx
)
644 for (i
= 0; i
< (int)OSSL_NELEM(st_kat_kdf_tests
); ++i
) {
645 if (!self_test_kdf(&st_kat_kdf_tests
[i
], st
, libctx
))
651 static int self_test_drbgs(OSSL_SELF_TEST
*st
, OSSL_LIB_CTX
*libctx
)
655 for (i
= 0; i
< (int)OSSL_NELEM(st_kat_drbg_tests
); ++i
) {
656 if (!self_test_drbg(&st_kat_drbg_tests
[i
], st
, libctx
))
662 static int self_test_kas(OSSL_SELF_TEST
*st
, OSSL_LIB_CTX
*libctx
)
665 #if !defined(OPENSSL_NO_DH) || !defined(OPENSSL_NO_EC)
668 for (i
= 0; i
< (int)OSSL_NELEM(st_kat_kas_tests
); ++i
) {
669 if (!self_test_ka(&st_kat_kas_tests
[i
], st
, libctx
))
677 static int self_test_signatures(OSSL_SELF_TEST
*st
, OSSL_LIB_CTX
*libctx
)
681 for (i
= 0; i
< (int)OSSL_NELEM(st_kat_sign_tests
); ++i
) {
682 if (!self_test_sign(&st_kat_sign_tests
[i
], st
, libctx
))
689 * Run the algorithm KAT's.
690 * Return 1 is successful, otherwise return 0.
691 * This runs all the tests regardless of if any fail.
693 int SELF_TEST_kats(OSSL_SELF_TEST
*st
, OSSL_LIB_CTX
*libctx
)
697 if (!self_test_digests(st
, libctx
))
699 if (!self_test_ciphers(st
, libctx
))
701 if (!self_test_signatures(st
, libctx
))
703 if (!self_test_kdfs(st
, libctx
))
705 if (!self_test_drbgs(st
, libctx
))
707 if (!self_test_kas(st
, libctx
))
709 if (!self_test_asym_ciphers(st
, libctx
))