3 * HMAC-MD4 message authentication code.
6 /* nettle, low-level cryptographics library
8 * Copyright (C) 2003 Simon Josefsson
9 * Copyright (C) 2002 Niels Möller
11 * The nettle library is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License as published by
13 * the Free Software Foundation; either version 2.1 of the License, or (at your
14 * option) any later version.
16 * The nettle library is distributed in the hope that it will be useful, but
17 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
18 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
19 * License for more details.
21 * You should have received a copy of the GNU Lesser General Public License
22 * along with the nettle library; see the file COPYING.LIB. If not, write to
23 * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
30 hmac_md4_set_key(struct hmac_md4_ctx
*ctx
,
31 unsigned key_length
, const uint8_t *key
)
33 HMAC_SET_KEY(ctx
, &nettle_md4
, key_length
, key
);
37 hmac_md4_update(struct hmac_md4_ctx
*ctx
,
38 unsigned length
, const uint8_t *data
)
40 md4_update(&ctx
->state
, length
, data
);
44 hmac_md4_digest(struct hmac_md4_ctx
*ctx
,
45 unsigned length
, uint8_t *digest
)
47 HMAC_DIGEST(ctx
, &nettle_md4
, length
, digest
);