struct session_op sess;
struct crypt_op cryp;
uint8_t iv[EALG_MAX_BLOCK_LEN];
+ unsigned int hash_reset;
int cfd;
};
ctx->cryp.src = (void *) text;
ctx->cryp.dst = NULL;
ctx->cryp.op = COP_ENCRYPT;
- ctx->cryp.flags = COP_FLAG_UPDATE;
+
+ if (ctx->hash_reset == 0)
+ ctx->cryp.flags = COP_FLAG_UPDATE;
+ else
+ {
+ ctx->cryp.flags = 0;
+ ctx->hash_reset = 0;
+ }
if (ioctl (ctx->cfd, CIOCCRYPT, &ctx->cryp))
{
gnutls_assert ();
return 0;
}
+static void
+cryptodev_mac_reset (void *_ctx)
+{
+ struct cryptodev_ctx *ctx = _ctx;
+
+ ctx->hash_reset = 1;
+}
+
static int
cryptodev_mac_fast (gnutls_mac_algorithm_t algo,
const void *key, size_t key_size, const void *text,
.hash = cryptodev_mac_hash,
.output = cryptodev_mac_output,
.deinit = cryptodev_mac_deinit,
+ .reset = cryptodev_mac_reset,
.fast = cryptodev_mac_fast
};
#define cryptodev_digest_hash cryptodev_mac_hash
#define cryptodev_digest_output cryptodev_mac_output
+#define cryptodev_digest_reset cryptodev_mac_reset
static int
cryptodev_digest_fast (gnutls_digest_algorithm_t algo,
.hash = cryptodev_digest_hash,
.output = cryptodev_digest_output,
.deinit = cryptodev_digest_deinit,
+ .reset = cryptodev_digest_reset,
.fast = cryptodev_digest_fast
};