Lines Matching refs:ctx
36 sha1_context *ctx = malloc(sizeof(sha1_context)); in hash_init_sha1() local
37 sha1_starts(ctx); in hash_init_sha1()
38 *ctxp = ctx; in hash_init_sha1()
42 static int hash_update_sha1(struct hash_algo *algo, void *ctx, const void *buf, in hash_update_sha1() argument
45 sha1_update((sha1_context *)ctx, buf, size); in hash_update_sha1()
49 static int hash_finish_sha1(struct hash_algo *algo, void *ctx, void *dest_buf, in hash_finish_sha1() argument
55 sha1_finish((sha1_context *)ctx, dest_buf); in hash_finish_sha1()
56 free(ctx); in hash_finish_sha1()
64 sha256_context *ctx = malloc(sizeof(sha256_context)); in hash_init_sha256() local
65 sha256_starts(ctx); in hash_init_sha256()
66 *ctxp = ctx; in hash_init_sha256()
70 static int hash_update_sha256(struct hash_algo *algo, void *ctx, in hash_update_sha256() argument
73 sha256_update((sha256_context *)ctx, buf, size); in hash_update_sha256()
77 static int hash_finish_sha256(struct hash_algo *algo, void *ctx, void in hash_finish_sha256() argument
83 sha256_finish((sha256_context *)ctx, dest_buf); in hash_finish_sha256()
84 free(ctx); in hash_finish_sha256()
91 uint32_t *ctx = malloc(sizeof(uint32_t)); in hash_init_crc32() local
92 *ctx = 0; in hash_init_crc32()
93 *ctxp = ctx; in hash_init_crc32()
97 static int hash_update_crc32(struct hash_algo *algo, void *ctx, in hash_update_crc32() argument
100 *((uint32_t *)ctx) = crc32(*((uint32_t *)ctx), buf, size); in hash_update_crc32()
104 static int hash_finish_crc32(struct hash_algo *algo, void *ctx, void *dest_buf, in hash_finish_crc32() argument
110 *((uint32_t *)dest_buf) = *((uint32_t *)ctx); in hash_finish_crc32()
111 free(ctx); in hash_finish_crc32()