MCPcopy Create free account
hub / github.com/cgsecurity/testdisk / VerifyBlock

Function VerifyBlock

src/apfs_common.c:67–76  ·  view source on GitHub ↗

@ @ requires size >= 8; @ requires \valid_read((char *)block+ (0 .. size-1)); @ assigns \nothing; @*/

Source from the content-addressed store, hash-verified

65 @ assigns \nothing;
66 @*/
67static uint64_t VerifyBlock(const void *block, const size_t size)
68{
69 uint64_t cs;
70 const uint32_t *data = (const uint32_t *)block;
71 const size_t size4 = size / sizeof(uint32_t);
72
73 cs = fletcher64(data + 2, size4 - 2, 0);
74 cs = fletcher64(data, 2, cs);
75 return cs;
76}
77
78int test_APFS(const nx_superblock_t *sb, const partition_t *partition)
79{

Callers 1

test_APFSFunction · 0.85

Calls 1

fletcher64Function · 0.85

Tested by 1

test_APFSFunction · 0.68