hw_sha.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. * Computes hash value of input pbuf using h/w acceleration
  25. *
  26. * @param in_addr A pointer to the input buffer
  27. * @param bufleni Byte length of input buffer
  28. * @param out_addr A pointer to the output buffer. When complete
  29. * 32 bytes are copied to pout[0]...pout[31]. Thus, a user
  30. * should allocate at least 32 bytes at pOut in advance.
  31. * @param chunk_size chunk size for sha256
  32. */
  33. void hw_sha256(const uchar * in_addr, uint buflen,
  34. uchar * out_addr, uint chunk_size);
  35. /**
  36. * Computes hash value of input pbuf using h/w acceleration
  37. *
  38. * @param in_addr A pointer to the input buffer
  39. * @param bufleni Byte length of input buffer
  40. * @param out_addr A pointer to the output buffer. When complete
  41. * 32 bytes are copied to pout[0]...pout[31]. Thus, a user
  42. * should allocate at least 32 bytes at pOut in advance.
  43. * @param chunk_size chunk_size for sha1
  44. */
  45. void hw_sha1(const uchar * in_addr, uint buflen,
  46. uchar * out_addr, uint chunk_size);
  47. #endif