|
iPXE
|
Public key self-tests. More...
#include <stdint.h>#include <stdlib.h>#include <string.h>#include <assert.h>#include <ipxe/crypto.h>#include <ipxe/test.h>#include "pubkey_test.h"Go to the source code of this file.
Functions | |
| FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
| int | pubkey_test_get_random (void *data, size_t len) |
| Get random data input. | |
| void | pubkey_okx (struct pubkey_test *test, const char *file, unsigned int line) |
| Report public key encryption and decryption test result. | |
| void | pubkey_sign_okx (struct pubkey_sign_test *test, const char *file, unsigned int line) |
| Report public key signature test result. | |
Variables | |
| static const uint8_t * | pubkey_random |
| Random data input. | |
| static size_t | pubkey_random_len |
| Length of random data input. | |
Public key self-tests.
Definition in file pubkey_test.c.
| FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
| int pubkey_test_get_random | ( | void * | data, |
| size_t | len ) |
Get random data input.
| rc | Return status code |
Definition at line 56 of file pubkey_test.c.
References assert, data, len, memcpy(), pubkey_random, and pubkey_random_len.
Referenced by rsa_test_exec().
| void pubkey_okx | ( | struct pubkey_test * | test, |
| const char * | file, | ||
| unsigned int | line ) |
Report public key encryption and decryption test result.
| test | Public key encryption and decryption test |
| file | Test code file |
| line | Test code line |
Definition at line 78 of file pubkey_test.c.
References asn1_built(), asn1_compare(), asn1_builder::data, free, asn1_builder::len, NULL, okx, pubkey_decrypt(), pubkey_encrypt(), pubkey_match(), pubkey_random, pubkey_random_len, and test.
| void pubkey_sign_okx | ( | struct pubkey_sign_test * | test, |
| const char * | file, | ||
| unsigned int | line ) |
Report public key signature test result.
| test | Public key signature test |
| file | Test code file |
| line | Test code line |
Definition at line 153 of file pubkey_test.c.
References asn1_built(), asn1_compare(), digest_algorithm::ctxsize, asn1_builder::data, digest_final(), digest_init(), digest_update(), digest_algorithm::digestsize, free, asn1_builder::len, memcpy(), NULL, okx, pubkey_match(), pubkey_random, pubkey_random_len, pubkey_sign(), pubkey_verify(), signature, and test.
|
static |
Random data input.
Definition at line 44 of file pubkey_test.c.
Referenced by pubkey_okx(), pubkey_sign_okx(), and pubkey_test_get_random().
|
static |
Length of random data input.
Definition at line 47 of file pubkey_test.c.
Referenced by pubkey_okx(), pubkey_sign_okx(), and pubkey_test_get_random().