text: /*
   * SHA1 hash implementation and interface functions
   * Copyright (c) 2003-2005, Jouni Malinen <j@w1.fi>
   *
   * This program is free software; you can redistribute it and/or modify
   * it under the terms of the GNU General Public License version 2 as
   * published by the Free Software Foundation.
   *
   * Alternatively, this software may be distributed under the terms of BSD
   * license.
   *
   * See README and COPYING for more details.
   */
  
  #ifndef PBKDF2_SHA1_H
  #define PBKDF2_SHA1_H
  
  #define SHA1_MAC_LEN 20
  
  
  #ifdef _MSC_VER
  typedef UINT64 u64;
  typedef UINT32 u32;
  typedef UINT16 u16;
  typedef UINT8 u8;
  typedef INT64 s64;
  typedef INT32 s32;
  typedef INT16 s16;
  typedef INT8 s8;
  #define WPA_TYPES_DEFINED
  #endif /* _MSC_VER */
  
  #ifdef __vxworks
  typedef unsigned long long u64;
  typedef UINT32 u32;
  typedef UINT16 u16;
  typedef UINT8 u8;
  typedef long long s64;
  typedef INT32 s32;
  typedef INT16 s16;
  typedef INT8 s8;
  #define WPA_TYPES_DEFINED
  #endif /* __vxworks */
  
  #ifdef CONFIG_TI_COMPILER
  #ifdef _LLONG_AVAILABLE
  typedef unsigned long long u64;
  #else
  /*
   * TODO: 64-bit variable not available. Using long as a workaround to test the
   * build, but this will likely not work for all operations.
   */
  typedef unsigned long u64;
  #endif
  typedef unsigned int u32;
  typedef unsigned short u16;
  typedef unsigned char u8;
  #define WPA_TYPES_DEFINED
  #endif /* CONFIG_TI_COMPILER */
  
  #ifndef WPA_TYPES_DEFINED
  #ifdef CONFIG_USE_INTTYPES_H
  #include <inttypes.h>
  #else
  #include <stdint.h>
  #endif
  typedef uint64_t u64;
  typedef uint32_t u32;
  typedef uint16_t u16;
  typedef uint8_t u8;
  typedef int64_t s64;
  typedef int32_t s32;
  typedef int16_t s16;
  typedef int8_t s8;
  #define WPA_TYPES_DEFINED
  #endif
  
  void hmac_sha1_vector(const u8 *key, size_t key_len, size_t num_elem,
  		      const u8 *addr[], const size_t *len, u8 *mac);
  void hmac_sha1(const u8 *key, size_t key_len, const u8 *data, size_t data_len,
  	       u8 *mac);
  void pbkdf2_sha1(const char *passphrase, const char *ssid, size_t ssid_len,
  		 int iterations, u8 *buf, size_t buflen);
  void sha1_vector(size_t num_elem, const u8 *addr[], const size_t *len,
  		 u8 *mac);
  #ifdef CONFIG_CRYPTO_INTERNAL
  struct SHA1Context;
  
  void SHA1Init(struct SHA1Context *context);
  void SHA1Update(struct SHA1Context *context, const void *data, u32 len);
  void SHA1Final(unsigned char digest[20], struct SHA1Context *context);
  #endif /* CONFIG_CRYPTO_INTERNAL */
  
  #endif /* SHA1_H */
  