Closed Bug 345779 Opened 18 years ago Closed 18 years ago

Useless assignment statements in ec_GF2m_pt_mul_mont

Categories

(NSS :: Libraries, defect)

3.11
defect
Not set
trivial

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: wtc, Unassigned)

Details

Attachments

(1 file)

In lib/freebl/ec/ec2_mont.c, function ec_GF2m_pt_mul_mont has
two useless assignment statements.

In rev. 1.2 of the file, we have:

208     MP_CHECKOK(mp_copy(rx, &x2));   /* x2 = rx */
209     MP_CHECKOK(mp_copy(ry, &z2));   /* z2 = ry */
210 
211     MP_CHECKOK(mp_copy(px, &x1));   /* x1 = px */
212     MP_CHECKOK(mp_set_int(&z1, 1)); /* z1 = 1 */
213     MP_CHECKOK(group->meth->field_sqr(&x1, &z2, group->meth));  /* z2 =
214                                                                  * x1^2 =
215                                                                  * x2^2 */
216     MP_CHECKOK(group->meth->field_sqr(&z2, &x2, group->meth));

The value assigned to x2 in line 208 is never used.  It is
discarded in line 216.

The value assigned to z2 in line 209 is never used.  It is
discarded in line 213.

So the assignment statements in lines 208 and 209 can be removed.
Also, the comment in line 215 should say px^2 instead of x2^2.
Attached patch Proposed patchSplinter Review
Attachment #230495 - Flags: review?(douglas)
Attachment #230495 - Flags: review?(douglas) → review+
I checked in the proposed patch on the NSS trunk (NSS 3.12).

Checking in ec2_mont.c;
/cvsroot/mozilla/security/nss/lib/freebl/ecl/ec2_mont.c,v  <--  ec2_mont.c
new revision: 1.3; previous revision: 1.2
done
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Target Milestone: --- → 3.12
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: