2 * SHA1 hash implementation and interface functions
3 * Copyright (c) 2003-2005, Jouni Malinen <j@w1.fi>
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
9 * Alternatively, this software may be distributed under the terms of BSD
12 * See README and COPYING for more details.
19 #include "win32_common.h"
25 #define SHA1_MAC_LEN 20
31 unsigned char buffer
[64];
34 typedef struct SHA1Context SHA1_CTX
;
36 void SHA1Init(SHA1_CTX
*context
);
37 void SHA1Update(SHA1_CTX
*context
, const void *data
, uint32_t len
);
38 void SHA1Final(unsigned char digest
[20], SHA1_CTX
*context
);
40 void sha1_vector(size_t num_elem
, const uint8_t *addr
[], const size_t *len
,
42 void hmac_sha1_vector(const uint8_t *key
, size_t key_len
, size_t num_elem
,
43 const uint8_t *addr
[], const size_t *len
, uint8_t *mac
);
44 void hmac_sha1(const uint8_t *key
, size_t key_len
,
45 const uint8_t *data
, size_t data_len
, uint8_t *mac
);
46 void sha1_prf(const uint8_t *key
, size_t key_len
, const char *label
,
47 const uint8_t *data
, size_t data_len
, uint8_t *buf
, size_t buf_len
);