MCPcopy Create free account
hub / github.com/apple/foundationdb / digest

Method digest

flow/BlobCipher.cpp:743–756  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

741}
742
743StringRef HmacSha256DigestGen::digest(const unsigned char* data, size_t len, Arena& arena) {
744 CODE_PROBE(true, "Digest generation");
745 unsigned int digestLen = HMAC_size(ctx);
746 auto digest = new (arena) unsigned char[digestLen];
747 if (HMAC_Update(ctx, data, len) != 1) {
748 throw encrypt_ops_error();
749 }
750
751 if (HMAC_Final(ctx, digest, &digestLen) != 1) {
752 throw encrypt_ops_error();
753 }
754
755 return StringRef(arena, digest, digestLen);
756}
757
758StringRef computeAuthToken(const uint8_t* payload,
759 const int payloadLen,

Callers 2

computeAuthTokenFunction · 0.45

Calls 1

StringRefClass · 0.50

Tested by

no test coverage detected