Skip to content

Commit

Permalink
[crypto] Rename variable of verification result in P-384 Verify
Browse files Browse the repository at this point in the history
Signed-off-by: Moritz Wettermann <[email protected]>
  • Loading branch information
wettermo authored and sameo committed Jun 17, 2024
1 parent 19832be commit 8423507
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions sw/otbn/crypto/p384_ecdsa_verify.s
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ start:
* @param[in] dmem[s]: s part of signature
* @param[in] dmem[x]: x-coordinate of public key
* @param[in] dmem[y]: y-coordinate of public key
* @param[out] dmem[rnd]: x1 coordinate to be compared to rs
* @param[out] dmem[x_r]: x1 coordinate to be compared to rs
*
* !!! Attention !!! - before signature verification p384_curve_point_valid
* binary has to be executed to check if the provided public key is valid.
Expand All @@ -53,9 +53,9 @@ ecdsa_verify:
.bss

/* result of verify (x1 coordinate) */
.globl rnd
.globl x_r
.balign 32
rnd:
x_r:
.zero 64

.data
Expand Down
12 changes: 6 additions & 6 deletions sw/otbn/crypto/p384_verify.s
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ store_proj:
* @param[in] dmem[msg]: message to be verified in dmem
* @param[in] dmem[x]: x-coordinate of public key in dmem
* @param[in] dmem[y]: y-coordinate of public key in dmem
* @param[out] dmem[rnd]: verification result: reduced affine x1-coordinate
* @param[out] dmem[x_r]: verification result: reduced affine x1-coordinate
*
* Scratchpad memory layout:
* The routine expects at least 896 bytes of scratchpad memory at dmem
Expand Down Expand Up @@ -131,7 +131,7 @@ p384_verify:
la x7, s

/* get dmem pointer of verification result (x1-coordinate) */
la x8, rnd
la x8, x_r

/* get dmem pointer of message */
la x9, msg
Expand Down Expand Up @@ -405,7 +405,7 @@ p384_verify:
bn.sel w4, w16, w4, C
bn.sel w5, w17, w5, C

/* store affine x-coordinate in dmem: dmem[dptr_rnd] <= x1 = [w5,w4] */
/* store affine x-coordinate in dmem: dmem[x_r] <= x1 = [w5,w4] */
li x2, 4
bn.sid x2++, 0(x8)
bn.sid x2++, 32(x8)
Expand Down Expand Up @@ -457,9 +457,9 @@ y:
.zero 64

/* verification result (x1-coordinate) */
.globl rnd
.weak rnd
rnd:
.globl x_r
.weak x_r
x_r:
.zero 64

/* Scratchpad memory */
Expand Down
8 changes: 4 additions & 4 deletions sw/otbn/crypto/tests/p384_ecdsa_verify_test.s
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ p384_ecdsa_verify_test:

/* load signature to wregs for comparison with reference */
li x2, 0
la x3, rnd
la x3, x_r
bn.lid x2++, 0(x3)
bn.lid x2, 32(x3)

Expand Down Expand Up @@ -113,7 +113,7 @@ y:
.word 0xaaafcad2
.zero 16

/* signature verification result x_res (rnd) */
.globl rnd
rnd:
/* signature verification result x_res (x_r) */
.globl x_r
x_r:
.zero 64

0 comments on commit 8423507

Please sign in to comment.