45 #define PROFILE_COUNT 16 63 okx ( cipher_setkey ( cipher,
ctx,
test->key,
test->key_len ) == 0,
65 cipher_setiv ( cipher,
ctx,
test->iv,
test->iv_len );
68 if (
test->additional_len ) {
69 okx ( is_auth_cipher ( cipher ), file, line );
71 test->additional_len );
82 cipher_auth ( cipher,
ctx,
auth );
86 cipher_setiv ( cipher,
ctx,
test->iv,
test->iv_len );
89 if (
test->additional_len ) {
91 test->additional_len );
102 cipher_auth ( cipher,
ctx,
auth );
114 unsigned int line ) {
122 okx ( cipher_setkey ( cipher,
ctx,
test->key,
test->key_len ) == 0,
124 cipher_setiv ( cipher,
ctx,
test->iv,
test->iv_len );
127 if (
test->additional_len ) {
128 okx ( is_auth_cipher ( cipher ), file, line );
130 test->additional_len );
141 cipher_auth ( cipher,
ctx,
auth );
145 cipher_setiv ( cipher,
ctx,
test->iv,
test->iv_len );
148 if (
test->additional_len ) {
150 test->additional_len );
161 cipher_auth ( cipher,
ctx,
auth );
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++ )
222 cipher_setiv ( cipher,
ctx,
iv,
sizeof (
iv ) );
unsigned long profile_mean(struct profiler *profiler)
Get mean sample value.
size_t blocksize
Block size.
struct arbelprm_rc_send_wqe rc
static void const void void * dst
size_t alignsize
Alignment size.
static void const void * src
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.
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.
static void const void size_t key_len
#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.
struct golan_eq_context ctx
long int random(void)
Generate a pseudo-random number between 0 and 2147483647L or 2147483562?
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 const void * iv
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 *)
void * memset(void *dest, int character, size_t len) __nonnull