typedef struct keyset keyset;
typedef struct algswitch algswitch;
-typedef struct bulkcrypto {
+typedef struct bulkops {
const char *name;
unsigned prim;
int (*check)(const algswitch */*a*/, dstr */*e*/);
int (*encrypt)(keyset */*ks*/, unsigned /*ty*/, buf */*b*/, buf */*bb*/);
int (*decrypt)(keyset */*ks*/, unsigned /*ty*/,
buf */*b*/, buf */*bb*/, uint32 */*seq*/);
-} bulkcrypto;
+} bulkops;
#define BCP_CIPHER 1
#define BCP_MAC 2
struct algswitch {
const gchash *h; /* Hash function */
const gccipher *mgf; /* Mask-generation function */
- const struct bulkcrypto *bulk; /* Bulk crypto transformation */
+ const bulkops *bulk; /* Bulk crypto transformation */
const gccipher *c; /* Symmetric encryption scheme */
const gcmac *m; /* Message authentication code */
const gccipher *b; /* Block cipher */
#define HASH_STRING(h, s) GH_HASH((h), (s), sizeof(s))
-extern const struct bulkcrypto bulktab[];
+extern const bulkops bulktab[];
/*----- Data structures ---------------------------------------------------*/
unsigned long sz_exp, sz_regen; /* Data limits for the keyset */
T( unsigned seq; ) /* Sequence number for tracing */
unsigned f; /* Various useful flags */
- const bulkcrypto *bulk; /* Bulk crypto transform */
+ const bulkops *bulk; /* Bulk crypto transform */
size_t tagsz; /* Length to truncate MAC tags */
struct ksdir {
gcipher *c; /* Keyset cipher for encryption */
/*----- Other macros ------------------------------------------------------*/
-#define QUICKRAND noise_timer(RAND_GLOBAL)
+#define QUICKRAND \
+ do { rand_quick(RAND_GLOBAL); noise_timer(RAND_GLOBAL); } while (0)
/*----- Key management ----------------------------------------------------*/