| 90 | } |
| 91 | |
| 92 | bool |
| 93 | pg_md5_binary(const void *buff, size_t len, void *outbuf) |
| 94 | { |
| 95 | pg_cryptohash_ctx *ctx; |
| 96 | |
| 97 | ctx = pg_cryptohash_create(PG_MD5); |
| 98 | if (ctx == NULL) |
| 99 | return false; |
| 100 | |
| 101 | if (pg_cryptohash_init(ctx) < 0 || |
| 102 | pg_cryptohash_update(ctx, buff, len) < 0 || |
| 103 | pg_cryptohash_final(ctx, outbuf, MD5_DIGEST_LENGTH) < 0) |
| 104 | { |
| 105 | pg_cryptohash_free(ctx); |
| 106 | return false; |
| 107 | } |
| 108 | |
| 109 | pg_cryptohash_free(ctx); |
| 110 | return true; |
| 111 | } |
| 112 | |
| 113 | |
| 114 | /* |
no test coverage detected