15738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/*
25738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project * SHA1 hash implementation and interface functions
35738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project * Copyright (c) 2003-2009, Jouni Malinen <j@w1.fi>
45738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project *
55738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project * This software may be distributed under the terms of the BSD license.
65738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project * See README for more details.
75738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project */
85738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
95738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#ifndef SHA1_H
105738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#define SHA1_H
115738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
125738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#define SHA1_MAC_LEN 20
135738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
145738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Projectint hmac_sha1_vector(const u8 *key, size_t key_len, size_t num_elem,
155738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project		     const u8 *addr[], const size_t *len, u8 *mac);
165738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Projectint hmac_sha1(const u8 *key, size_t key_len, const u8 *data, size_t data_len,
175738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project	       u8 *mac);
185738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Projectint sha1_prf(const u8 *key, size_t key_len, const char *label,
195738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project	     const u8 *data, size_t data_len, u8 *buf, size_t buf_len);
205738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Projectint sha1_t_prf(const u8 *key, size_t key_len, const char *label,
215738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project	       const u8 *seed, size_t seed_len, u8 *buf, size_t buf_len);
225738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Projectint __must_check tls_prf_sha1_md5(const u8 *secret, size_t secret_len,
235738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project				  const char *label, const u8 *seed,
245738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project				  size_t seed_len, u8 *out, size_t outlen);
255738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Projectint pbkdf2_sha1(const char *passphrase, const u8 *ssid, size_t ssid_len,
265738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project		int iterations, u8 *buf, size_t buflen);
275738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#endif /* SHA1_H */
285738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project