139beb93cSSam Leffler /* 239beb93cSSam Leffler * SHA1 hash implementation and interface functions 3e28a4053SRui Paulo * Copyright (c) 2003-2009, Jouni Malinen <j@w1.fi> 439beb93cSSam Leffler * 5*f05cddf9SRui Paulo * This software may be distributed under the terms of the BSD license. 6*f05cddf9SRui Paulo * See README for more details. 739beb93cSSam Leffler */ 839beb93cSSam Leffler 939beb93cSSam Leffler #ifndef SHA1_H 1039beb93cSSam Leffler #define SHA1_H 1139beb93cSSam Leffler 1239beb93cSSam Leffler #define SHA1_MAC_LEN 20 1339beb93cSSam Leffler 14e28a4053SRui Paulo int hmac_sha1_vector(const u8 *key, size_t key_len, size_t num_elem, 1539beb93cSSam Leffler const u8 *addr[], const size_t *len, u8 *mac); 16e28a4053SRui Paulo int hmac_sha1(const u8 *key, size_t key_len, const u8 *data, size_t data_len, 1739beb93cSSam Leffler u8 *mac); 18e28a4053SRui Paulo int sha1_prf(const u8 *key, size_t key_len, const char *label, 1939beb93cSSam Leffler const u8 *data, size_t data_len, u8 *buf, size_t buf_len); 20e28a4053SRui Paulo int sha1_t_prf(const u8 *key, size_t key_len, const char *label, 2139beb93cSSam Leffler const u8 *seed, size_t seed_len, u8 *buf, size_t buf_len); 22*f05cddf9SRui Paulo int __must_check tls_prf_sha1_md5(const u8 *secret, size_t secret_len, 23*f05cddf9SRui Paulo const char *label, const u8 *seed, 24*f05cddf9SRui Paulo size_t seed_len, u8 *out, size_t outlen); 25*f05cddf9SRui Paulo int pbkdf2_sha1(const char *passphrase, const u8 *ssid, size_t ssid_len, 2639beb93cSSam Leffler int iterations, u8 *buf, size_t buflen); 2739beb93cSSam Leffler #endif /* SHA1_H */ 28