3 * PRF function used in WPA and TGi
5 * Copyright (C) 2012, Broadcom Corporation. All Rights Reserved.
7 * Permission to use, copy, modify, and/or distribute this software for any
8 * purpose with or without fee is hereby granted, provided that the above
9 * copyright notice and this permission notice appear in all copies.
11 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
14 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
16 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
17 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
19 * $Id: prf.h 241182 2011-02-17 21:50:03Z $
27 /* lengths in Bytes */
28 #define PRF_MAX_I_D_LEN 128
29 #define PRF_MAX_KEY_LEN 64
30 #define PRF_OUTBUF_LEN 80
32 extern int BCMROMFN(PRF
)(unsigned char *key
, int key_len
, unsigned char *prefix
,
33 int prefix_len
, unsigned char *data
, int data_len
,
34 unsigned char *output
, int len
);
36 extern int BCMROMFN(fPRF
)(unsigned char *key
, int key_len
, const unsigned char *prefix
,
37 int prefix_len
, unsigned char *data
, int data_len
,
38 unsigned char *output
, int len
);
40 extern void BCMROMFN(hmac_sha1
)(unsigned char *text
, int text_len
, unsigned char *key
,
41 int key_len
, unsigned char *digest
);
43 extern void BCMROMFN(hmac_md5
)(unsigned char *text
, int text_len
, unsigned char *key
,
44 int key_len
, unsigned char *digest
);