|
iPXE
|
Go to the source code of this file.
Data Structures | |
| struct | pubkey_test |
| A public-key encryption and decryption test. More... | |
| struct | pubkey_sign_test |
| A public-key signature test. More... | |
Macros | |
| #define | PRIVATE(...) |
| Define inline private key data. | |
| #define | PUBLIC(...) |
| Define inline public key data. | |
| #define | RANDOM(...) |
| Define inline random data. | |
| #define | PLAINTEXT(...) |
| Define inline plaintext data. | |
| #define | CIPHERTEXT(...) |
| Define inline ciphertext data. | |
| #define | SIGNATURE(...) |
| Define inline signature data. | |
| #define | PUBKEY_TEST(name, PUBKEY, PRIVATE, PUBLIC, RANDOM, PLAINTEXT, CIPHERTEXT) |
| Define a public-key encryption and decryption test. | |
| #define | PUBKEY_SIGN_TEST(name, PUBKEY, PRIVATE, PUBLIC, RANDOM, PLAINTEXT, DIGEST, SIGNATURE) |
| Define a public-key signature test. | |
| #define | pubkey_ok(test) |
| Report a public key encryption and decryption test result. | |
| #define | pubkey_sign_ok(test) |
| Report a public key signature test result. | |
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. | |
| #define PRIVATE | ( | ... | ) |
| #define PUBLIC | ( | ... | ) |
| #define RANDOM | ( | ... | ) |
Define inline random data.
Definition at line 57 of file pubkey_test.h.
Referenced by PUBKEY_SIGN_TEST(), PUBKEY_SIGN_TEST(), PUBKEY_SIGN_TEST(), PUBKEY_TEST(), and PUBKEY_TEST().
| #define PLAINTEXT | ( | ... | ) |
| #define CIPHERTEXT | ( | ... | ) |
| #define SIGNATURE | ( | ... | ) |
Define inline signature data.
Definition at line 66 of file pubkey_test.h.
Referenced by PUBKEY_SIGN_TEST(), PUBKEY_SIGN_TEST(), PUBKEY_SIGN_TEST(), PUBKEY_SIGN_TEST(), PUBKEY_SIGN_TEST(), PUBKEY_SIGN_TEST(), PUBKEY_SIGN_TEST(), PUBKEY_SIGN_TEST(), PUBKEY_SIGN_TEST(), and PUBKEY_SIGN_TEST().
Define a public-key encryption and decryption test.
| name | Test name |
| PUBKEY | Public-key algorithm |
| PRIVATE | Private key |
| PUBLIC | Public key |
| RANDOM | Random data |
| PLAINTEXT | Plaintext |
| CIPHERTEXT | Ciphertext |
| test | Encryption and decryption test |
Definition at line 80 of file pubkey_test.h.
Define a public-key signature test.
| name | Test name |
| PUBKEY | Public-key algorithm |
| PRIVATE | Private key |
| PUBLIC | Public key |
| RANDOM | Random data |
| PLAINTEXT | Plaintext |
| DIGEST | Digest algorithm |
| SIGNATURE | Signature |
| test | Signature test |
Definition at line 122 of file pubkey_test.h.
| #define pubkey_ok | ( | test | ) |
Report a public key encryption and decryption test result.
| test | Public key encryption and decryption test |
Definition at line 161 of file pubkey_test.h.
Referenced by rsa_test_exec().
| #define pubkey_sign_ok | ( | test | ) |
Report a public key signature test result.
| test | Public key signature test |
Definition at line 169 of file pubkey_test.h.
Referenced by ecdsa_test_exec(), and rsa_test_exec().
| FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
|
extern |
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().
|
extern |
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.
|
extern |
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.