1 /* SPDX-License-Identifier: GPL-2.0-only */
6 #include "cbfs_image.h"
8 #define CBFS_ENABLE_HASHING 1
9 #define CBFS_HASH_HWCRYPTO 0
11 typedef const struct cbfs_image
*cbfs_dev_t
;
13 static inline ssize_t
cbfs_dev_read(cbfs_dev_t dev
, void *buffer
, size_t offset
, size_t size
)
15 if (buffer_size(&dev
->buffer
) < offset
||
16 buffer_size(&dev
->buffer
) - offset
< size
)
19 memcpy(buffer
, buffer_get(&dev
->buffer
) + offset
, size
);
23 static inline size_t cbfs_dev_size(cbfs_dev_t dev
)
25 return buffer_size(&dev
->buffer
);
28 #endif /* _CBFS_GLUE_H_ */