mirror of
				https://source.denx.de/u-boot/u-boot.git
				synced 2025-10-26 14:01:50 +01:00 
			
		
		
		
	This mostly crossports crypto/hash.[ch] from btrfs-progs. The differences are: - No blake2 support No blake2 related library in U-Boot yet. - Use uboot xxhash/sha256 directly No need to implement the code as U-Boot has already provided the interface. This adds the support for the following csums: - SHA256 - XXHASH Signed-off-by: Qu Wenruo <wqu@suse.com> Reviewed-by: Marek Behún <marek.behun@nic.cz>
		
			
				
	
	
		
			18 lines
		
	
	
		
			421 B
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			18 lines
		
	
	
		
			421 B
		
	
	
	
		
			C
		
	
	
	
	
	
| #ifndef CRYPTO_HASH_H
 | |
| #define CRYPTO_HASH_H
 | |
| 
 | |
| #include <linux/types.h>
 | |
| 
 | |
| #define CRYPTO_HASH_SIZE_MAX	32
 | |
| 
 | |
| void btrfs_hash_init(void);
 | |
| int hash_crc32c(const u8 *buf, size_t length, u8 *out);
 | |
| int hash_xxhash(const u8 *buf, size_t length, u8 *out);
 | |
| int hash_sha256(const u8 *buf, size_t length, u8 *out);
 | |
| 
 | |
| u32 crc32c(u32 seed, const void * data, size_t len);
 | |
| 
 | |
| /* Blake2B is not yet supported due to lack of library */
 | |
| 
 | |
| #endif
 |