45 #define PROFILE_COUNT 16 68 if (
test->additional_len ) {
71 test->additional_len );
89 if (
test->additional_len ) {
91 test->additional_len );
114 unsigned int line ) {
127 if (
test->additional_len ) {
130 test->additional_len );
148 if (
test->additional_len ) {
150 test->additional_len );
173 unsigned int line ) {
200 const void *
src,
void *dst,
size_t len ) ) {
212 for ( i = 0 ; i <
sizeof (
random ) ; i++ )
214 for ( i = 0 ; i <
sizeof (
key ) ; i++ )
216 for ( i = 0 ; i <
sizeof (
iv ) ; i++ )
unsigned long profile_mean(struct profiler *profiler)
Get mean sample value.
size_t blocksize
Block size.
static int is_auth_cipher(struct cipher_algorithm *cipher)
struct arbelprm_rc_send_wqe rc
size_t alignsize
Alignment size.
static unsigned long cipher_cost(struct cipher_algorithm *cipher, size_t key_len, void(*op)(struct cipher_algorithm *cipher, void *ctx, const void *src, void *dst, size_t len))
Calculate cipher encryption or decryption cost.
Self-test infrastructure.
struct golan_eq_context ctx
A data structure for storing profiling information.
static void profile_stop(struct profiler *profiler)
Stop profiling.
unsigned long cipher_cost_decrypt(struct cipher_algorithm *cipher, size_t key_len)
Calculate cipher decryption cost.
u8 iv[16]
Initialization vector.
#define cipher_encrypt(cipher, ctx, src, dst, len)
size_t authsize
Authentication tag size.
void cipher_decrypt_okx(struct cipher_test *test, const char *file, unsigned int line)
Report a cipher decryption test result.
void * memcpy(void *dest, const void *src, size_t len) __nonnull
void cipher_okx(struct cipher_test *test, const char *file, unsigned int line)
Report a cipher encryption and decryption test result.
#define okx(success, file, line)
Report test result.
assert((readw(&hdr->flags) &(GTF_reading|GTF_writing))==0)
static void srand(unsigned int seed)
static void profile_start(struct profiler *profiler)
Start profiling.
static void cipher_setiv(struct cipher_algorithm *cipher, void *ctx, const void *iv, size_t ivlen)
long int random(void)
Generate a pseudo-random number between 0 and 2147483647L or 2147483562?
void(* auth)(void *ctx, void *auth)
Generate authentication tag.
size_t ctxsize
Context size.
uint32_t cost
Root path cost.
#define cipher_decrypt(cipher, ctx, src, dst, len)
#define PROFILE_COUNT
Number of sample iterations for profiling.
static uint16_t struct vmbus_xfer_pages_operations * op
static void cipher_auth(struct cipher_algorithm *cipher, void *ctx, void *auth)
void cipher_encrypt_okx(struct cipher_test *test, const char *file, unsigned int line)
Report a cipher encryption test result.
int memcmp(const void *first, const void *second, size_t len)
Compare memory regions.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
unsigned long cipher_cost_encrypt(struct cipher_algorithm *cipher, size_t key_len)
Calculate cipher encryption cost.
#define NULL
NULL pointer (VOID *)
static int cipher_setkey(struct cipher_algorithm *cipher, void *ctx, const void *key, size_t keylen)
void * memset(void *dest, int character, size_t len) __nonnull