Akshay Saraswat | cbd8f2c | 2013-03-20 21:00:58 +0000 | [diff] [blame^] | 1 | /* |
| 2 | * Header file for SHA hardware acceleration |
| 3 | * |
| 4 | * Copyright (c) 2012 Samsung Electronics |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by |
| 8 | * the Free Software Foundation; either version 2 of the License, or |
| 9 | * (at your option) any later version. |
| 10 | * |
| 11 | * This program is distributed in the hope that it will be useful, |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | * GNU General Public License for more details. |
| 15 | * |
| 16 | * You should have received a copy of the GNU General Public License |
| 17 | * along with this program; if not, write to the Free Software |
| 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 19 | * |
| 20 | */ |
| 21 | #ifndef __HW_SHA_H |
| 22 | #define __HW_SHA_H |
| 23 | |
| 24 | |
| 25 | /** |
| 26 | * Computes hash value of input pbuf using h/w acceleration |
| 27 | * |
| 28 | * @param in_addr A pointer to the input buffer |
| 29 | * @param bufleni Byte length of input buffer |
| 30 | * @param out_addr A pointer to the output buffer. When complete |
| 31 | * 32 bytes are copied to pout[0]...pout[31]. Thus, a user |
| 32 | * should allocate at least 32 bytes at pOut in advance. |
| 33 | * @param chunk_size chunk size for sha256 |
| 34 | */ |
| 35 | void hw_sha256(const uchar * in_addr, uint buflen, |
| 36 | uchar * out_addr, uint chunk_size); |
| 37 | |
| 38 | /** |
| 39 | * Computes hash value of input pbuf using h/w acceleration |
| 40 | * |
| 41 | * @param in_addr A pointer to the input buffer |
| 42 | * @param bufleni Byte length of input buffer |
| 43 | * @param out_addr A pointer to the output buffer. When complete |
| 44 | * 32 bytes are copied to pout[0]...pout[31]. Thus, a user |
| 45 | * should allocate at least 32 bytes at pOut in advance. |
| 46 | * @param chunk_size chunk_size for sha1 |
| 47 | */ |
| 48 | void hw_sha1(const uchar * in_addr, uint buflen, |
| 49 | uchar * out_addr, uint chunk_size); |
| 50 | #endif |