23 #include <openssl/md5.h> 32 #define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_CLIENT 45 #define DATA_UNIT_COUNT 10 46 #define OBJ_CONTAINER 0x123 127 char seed_str[64] = {
'\0'};
129 unsigned char *seed_sum;
130 unsigned char *unseed_final_sum;
137 rc = MD5_Init(&curr_ctx);
149 sizeof(MD5_CTX)) == 0);
152 rc = MD5_Final(unseed_final_sum, &curr_ctx);
155 MD5_DIGEST_LENGTH) == 0);
162 memcpy((
void *)&tmp_ctx,(
void *)
curr_context[j],
sizeof(MD5_CTX));
165 seed.pis_obj_id.f_container,
seed.pis_obj_id.f_key,
166 seed.pis_data_unit_offset);
168 rc = MD5_Update(&tmp_ctx, (
unsigned char *)seed_str,
171 rc = MD5_Final(seed_sum, &tmp_ctx);
174 MD5_DIGEST_LENGTH) == 0);
178 MD5_DIGEST_LENGTH) == 0);
238 memcpy(
seeded_sum[j],
pi.pimd5c_value, MD5_DIGEST_LENGTH);
265 unsigned char seeded_final_chunks_value[MD5_DIGEST_LENGTH];
296 memcpy(
seeded_sum[j],
pi.pimd5c_value, MD5_DIGEST_LENGTH);
299 memcpy(&seeded_final_chunks_value,
pi.pimd5c_value, MD5_DIGEST_LENGTH);
311 MD5_DIGEST_LENGTH) == 0);
330 #undef M0_TRACE_SUBSYSTEM
#define M0_ALLOC_ARR(arr, nr)
M0_INTERNAL int pi_init(void)
unsigned char * curr_context[DATA_UNIT_COUNT]
static void ut_test_pi_api_case_one_two(void)
struct m0_bufvec * user_data
static void ut_test_pi_api_case_third(void)
int m0_client_calculate_pi(struct m0_generic_pi *pi, struct m0_pi_seed *seed, struct m0_bufvec *bvec, enum m0_pi_calc_flag flag, unsigned char *curr_context, unsigned char *pi_value_without_seed)
struct m0_ut_suite ut_suite_pi
M0_INTERNAL int pi_fini(void)
struct m0_bufvec * big_user_data
unsigned char * big_curr_context
M0_INTERNAL int m0_bufvec_alloc(struct m0_bufvec *bufvec, uint32_t num_segs, m0_bcount_t seg_size)
M0_INTERNAL void m0_bufvec_free(struct m0_bufvec *bufvec)
unsigned char * seeded_sum[DATA_UNIT_COUNT]
M0_INTERNAL void m0_fid_set(struct m0_fid *fid, uint64_t container, uint64_t key)
unsigned char * big_final_sum
M0_INTERNAL void ut_shuffle_test_order(struct m0_ut_suite *suite)
struct m0_pdclust_instance pi
void verify_case_one_two(void)
unsigned char * final_sum