MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / cbm_sha256_update

Function cbm_sha256_update

src/foundation/sha256.c:76–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

74}
75
76void cbm_sha256_update(cbm_sha256_ctx *c, const void *data, size_t len) {
77 const uint8_t *p = (const uint8_t *)data;
78 for (size_t i = 0; i < len; i++) {
79 c->buf[c->buflen++] = p[i];
80 if (c->buflen == 64) {
81 sha256_transform(c, c->buf);
82 c->bitlen += 512;
83 c->buflen = 0;
84 }
85 }
86}
87
88void cbm_sha256_final(cbm_sha256_ctx *c, uint8_t out[CBM_SHA256_DIGEST_LEN]) {
89 c->bitlen += (uint64_t)c->buflen * 8;

Calls 1

sha256_transformFunction · 0.85

Tested by

no test coverage detected