CL:3825558 changes all vb2_digest and vb2_hash functions to take a new
hwcrypto_allowed argument, to potentially let them try to call the
vb2ex_hwcrypto API for hash calculation. This change will open hardware
crypto acceleration up to all hash calculations in coreboot (most
notably CBFS verification). As part of this change, the
vb2_digest_buffer() function has been removed, so replace existing
instances in coreboot with the newer vb2_hash_calculate() API.
Due to the circular dependency of these changes with vboot, this patch
also needs to update the vboot submodule:
Updating from commit id 18cb85b5:
    2load_kernel.c: Expose load kernel as vb2_api
to commit id b827ddb9:
    tests: Ensure auxfw sync runs after EC sync
This brings in 15 new commits.
Signed-off-by: Julius Werner <jwerner@chromium.org>
Change-Id: I287d8dac3c49ad7ea3e18a015874ce8d610ec67e
Reviewed-on: https://review.coreboot.org/c/coreboot/+/66561
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Jakub Czapiga <jacz@semihalf.com>
		
	
		
			
				
	
	
		
			29 lines
		
	
	
		
			615 B
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			29 lines
		
	
	
		
			615 B
		
	
	
	
		
			C
		
	
	
	
	
	
| /* SPDX-License-Identifier: GPL-2.0-only */
 | |
| 
 | |
| #ifndef _CBFS_GLUE_H_
 | |
| #define _CBFS_GLUE_H_
 | |
| 
 | |
| #include "cbfs_image.h"
 | |
| 
 | |
| #define CBFS_ENABLE_HASHING 1
 | |
| #define CBFS_HASH_HWCRYPTO 0
 | |
| 
 | |
| typedef const struct cbfs_image *cbfs_dev_t;
 | |
| 
 | |
| static inline ssize_t cbfs_dev_read(cbfs_dev_t dev, void *buffer, size_t offset, size_t size)
 | |
| {
 | |
| 	if (buffer_size(&dev->buffer) < offset ||
 | |
| 	    buffer_size(&dev->buffer) - offset < size)
 | |
| 		return -1;
 | |
| 
 | |
| 	memcpy(buffer, buffer_get(&dev->buffer) + offset, size);
 | |
| 	return size;
 | |
| }
 | |
| 
 | |
| static inline size_t cbfs_dev_size(cbfs_dev_t dev)
 | |
| {
 | |
| 	return buffer_size(&dev->buffer);
 | |
| }
 | |
| 
 | |
| #endif	/* _CBFS_GLUE_H_ */
 |