]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - include/sha1.h
Merge branch 'u-boot-samsung/master' into 'u-boot-arm/master'
[karo-tx-uboot.git] / include / sha1.h
index 15ea13cd3a703e1be8653e11062e9c2dfaeb4271..da09dab9769af05a80c7f42c42e1f489fe32cb66 100644 (file)
@@ -59,7 +59,8 @@ void sha1_starts( sha1_context *ctx );
  * \param input    buffer holding the  data
  * \param ilen    length of the input data
  */
-void sha1_update( sha1_context *ctx, unsigned char *input, int ilen );
+void sha1_update(sha1_context *ctx, const unsigned char *input,
+                unsigned int ilen);
 
 /**
  * \brief         SHA-1 final digest
@@ -76,17 +77,19 @@ void sha1_finish( sha1_context *ctx, unsigned char output[20] );
  * \param ilen    length of the input data
  * \param output   SHA-1 checksum result
  */
-void sha1_csum( unsigned char *input, int ilen,
-               unsigned char output[20] );
+void sha1_csum(const unsigned char *input, unsigned int ilen,
+               unsigned char *output);
 
 /**
- * \brief         Output = SHA-1( file contents )
+ * \brief         Output = SHA-1( input buffer ), with watchdog triggering
  *
- * \param path    input file name
+ * \param input    buffer holding the  data
+ * \param ilen    length of the input data
  * \param output   SHA-1 checksum result
- * \return        0 if successful, or 1 if fopen failed
+ * \param chunk_sz watchdog triggering period (in bytes of input processed)
  */
-int sha1_file( char *path, unsigned char output[20] );
+void sha1_csum_wd(const unsigned char *input, unsigned int ilen,
+               unsigned char *output, unsigned int chunk_sz);
 
 /**
  * \brief         Output = HMAC-SHA-1( input buffer, hmac key )
@@ -97,9 +100,9 @@ int sha1_file( char *path, unsigned char output[20] );
  * \param ilen    length of the input data
  * \param output   HMAC-SHA-1 result
  */
-void sha1_hmac( unsigned char *key, int keylen,
-               unsigned char *input, int ilen,
-               unsigned char output[20] );
+void sha1_hmac(const unsigned char *key, int keylen,
+               const unsigned char *input, unsigned int ilen,
+               unsigned char *output);
 
 /**
  * \brief         Checkup routine