Showing the changes to test/decoder_test.cpp (1 of 6 files). Show all
Unified · Split
| @@ -11,17 +11,7 @@ · 10 unmodified lines | |||
| 11 | #include "codec_api.h" | 11 | #include "codec_api.h" |
| 12 | 12 | ||
| 13 | #include "utils/BufferedData.h" | 13 | #include "utils/BufferedData.h" |
| 14 | 14 | #include "utils/HashFunctions.h" | |
| 15 | static bool CompareHash(unsigned char(&digest)[SHA_DIGEST_LENGTH], | ||
| 16 | const char* hashStr) { | ||
| 17 | |||
| 18 | char hashStrCmp[SHA_DIGEST_LENGTH * 2 + 1]; | ||
| 19 | for (int i = 0; i < SHA_DIGEST_LENGTH; ++i) { | ||
| 20 | sprintf(&hashStrCmp[i*2], "%.2x", digest[i]); | ||
| 21 | } | ||
| 22 | hashStrCmp[SHA_DIGEST_LENGTH * 2] = '\0'; | ||
| 23 | return strncmp(hashStr, hashStrCmp, SHA_DIGEST_LENGTH * 2) == 0; | ||
| 24 | } | ||
| 25 | 15 | ||
| 26 | static void UpdateHashFromPlane(SHA_CTX* ctx, const uint8_t* plane, | 16 | static void UpdateHashFromPlane(SHA_CTX* ctx, const uint8_t* plane, |
| 27 | int width, int height, int stride) { | 17 | int width, int height, int stride) { |