Change all stun_XXX_t enums/structs into StunXxx to have a common naming convention
[sipe-libnice.git] / stun / sha1.h
blob4521479af6d7882e9cf0918ba6044d9c7151516a
1 /*
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
10 * license.
12 * See README and COPYING for more details.
15 #ifndef SHA1_H
16 #define SHA1_H
18 #ifdef _WIN32
19 #include "win32_common.h"
20 #else
21 #include <stdint.h>
22 #endif
23 #include <stddef.h>
25 #define SHA1_MAC_LEN 20
28 struct SHA1Context {
29 uint32_t state[5];
30 uint32_t count[2];
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,
41 uint8_t *mac);
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);
49 #endif /* SHA1_H */