intel / isa-l_crypto

Other
271 stars 80 forks source link

sha256_mb_mgr_ce: 'state->ldata[idx].job_in_lane->len' incorrect update #113

Open zqd96 opened 1 year ago

zqd96 commented 1 year ago

sha256_mb/aarch64/sha256_mb_mgr_ce.c: In block( line 169- 175), local variable 'len' shows 'block_num << 4', while 'state->ldata[idx].job_in_lane->len' stands for 'block_num'.

In this way, an assignment error occurred in line 172 'state->ldata[i].job_in_lane->len -= len'. Would this issue cause potential problems? Look forward to anyone's response.

chenxuqiang commented 1 year ago
    for (i = 0; i < SHA256_MAX_LANES; i++) {
        if (LANE_IS_NOT_FINISHED(state, i)) {
            state->lens[i] -= len;
            state->ldata[i].job_in_lane->len -= len;   /* this */
            state->ldata[i].job_in_lane->buffer += len << 2;
        }
    }
gbtucker commented 1 year ago

I'm not sure how this works in the arm portion. job.len is used elsewhere as length in number of blocks. Have you seen it cause any issues?

zqd96 commented 1 year ago

Thanks. No issues have been found so far. It's just that I have doubts when reading the source code.