1/* 2 * Broadcom Home Gateway Reference Design 3 * 4 * Copyright (C) 2015, Broadcom Corporation. All Rights Reserved. 5 * 6 * Permission to use, copy, modify, and/or distribute this software for any 7 * purpose with or without fee is hereby granted, provided that the above 8 * copyright notice and this permission notice appear in all copies. 9 * 10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 13 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 15 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 16 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 * $Id: opencrypto.h 241182 2011-02-17 21:50:03Z $ 18 */ 19 20#ifndef _opencrypto_h 21#define _opencrypto_h 22 23 24#define AES_BLOCK_LEN 8 /* bytes for AES block */ 25 26 27/* AES-based keywrap function defined in RFC3394 */ 28int aes_wrap(size_t kl, uint8 *key, size_t il, uint8 *input, uint8 *output); 29 30/* AES-based key unwrap function defined in RFC3394 */ 31int aes_unwrap(size_t kl, uint8 *key, size_t il, uint8 *input, uint8 *output); 32 33/* Pseudo random function */ 34int fPRF(unsigned char *key, int key_len, unsigned char *prefix, 35 int prefix_len, unsigned char *data, int data_len, 36 unsigned char *output, int len); 37 38/* hmac-sha1 keyed secure hash algorithm */ 39void hmac_sha1(unsigned char *text, int text_len, unsigned char *key, 40 int key_len, unsigned char *digest); 41 42 43#endif /* _opencrypto_h */ 44