cryptsetup  2.4.3
About: cryptsetup is a utility used to conveniently setup disk encryption based on the dm-crypt kernel module. These include plain dm-crypt volumes, LUKS volumes, loop-AES and TrueCrypt compatible format.
  Fossies Dox: cryptsetup-2.4.3.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

cipher_check.c File Reference
#include <errno.h>
#include <time.h>
#include "crypto_backend_internal.h"
Include dependency graph for cipher_check.c:

Go to the source code of this file.

Macros

#define CLOCK_MONOTONIC_RAW   CLOCK_MONOTONIC
 
#define CIPHER_BLOCK_BYTES   65536
 
#define CIPHER_TIME_MIN_MS   0.001
 

Functions

static int time_ms (struct timespec *start, struct timespec *end, double *ms)
 
static int cipher_perf_one (const char *name, const char *mode, char *buffer, size_t buffer_size, const char *key, size_t key_size, const char *iv, size_t iv_size, int enc)
 
static int cipher_measure (const char *name, const char *mode, char *buffer, size_t buffer_size, const char *key, size_t key_size, const char *iv, size_t iv_size, int encrypt, double *ms)
 
static double speed_mbs (unsigned long bytes, double ms)
 
int crypt_cipher_perf_kernel (const char *name, const char *mode, char *buffer, size_t buffer_size, const char *key, size_t key_size, const char *iv, size_t iv_size, double *encryption_mbs, double *decryption_mbs)
 

Macro Definition Documentation

◆ CIPHER_BLOCK_BYTES

#define CIPHER_BLOCK_BYTES   65536

Definition at line 34 of file cipher_check.c.

◆ CIPHER_TIME_MIN_MS

#define CIPHER_TIME_MIN_MS   0.001

Definition at line 40 of file cipher_check.c.

◆ CLOCK_MONOTONIC_RAW

#define CLOCK_MONOTONIC_RAW   CLOCK_MONOTONIC

Definition at line 27 of file cipher_check.c.

Function Documentation

◆ cipher_measure()

static int cipher_measure ( const char *  name,
const char *  mode,
char *  buffer,
size_t  buffer_size,
const char *  key,
size_t  key_size,
const char *  iv,
size_t  iv_size,
int  encrypt,
double *  ms 
)
static

◆ cipher_perf_one()

static int cipher_perf_one ( const char *  name,
const char *  mode,
char *  buffer,
size_t  buffer_size,
const char *  key,
size_t  key_size,
const char *  iv,
size_t  iv_size,
int  enc 
)
static

◆ crypt_cipher_perf_kernel()

int crypt_cipher_perf_kernel ( const char *  name,
const char *  mode,
char *  buffer,
size_t  buffer_size,
const char *  key,
size_t  key_size,
const char *  iv,
size_t  iv_size,
double *  encryption_mbs,
double *  decryption_mbs 
)

Definition at line 130 of file cipher_check.c.

References cipher_measure(), name, and speed_mbs().

Referenced by crypt_benchmark().

◆ speed_mbs()

static double speed_mbs ( unsigned long  bytes,
double  ms 
)
static

Definition at line 123 of file cipher_check.c.

Referenced by crypt_cipher_perf_kernel().

◆ time_ms()

static int time_ms ( struct timespec *  start,
struct timespec *  end,
double *  ms 
)
static

Definition at line 47 of file cipher_check.c.

Referenced by benchmark_callback(), and cipher_measure().