| /* Copyright lowRISC contributors. */ |
| /* Licensed under the Apache License, Version 2.0, see LICENSE for details. */ |
| /* SPDX-License-Identifier: Apache-2.0 */ |
| * Standalone elliptic curve P-256 ECDSA sign test |
| * Uses OTBN ECC P-256 lib to perform an ECDSA signing operation. |
| * An example message digest, the private signing key and a random value k are |
| * provided in the .data section below. Note that this test does not yet use |
| * OTBN's entropy interface as a source for the random value in the ECDSA |
| * Resulting R and S of the signature are copied to the wide registers. See |
| * comment at the end of the file for expected values. |
| /* set dmem pointer to nonce k */ |
| /* set dmem pointer to point to blinding parameter */ |
| /* set dmem pointer to point to message */ |
| /* set dmem pointer to point to private key d */ |
| /* set dmem pointer to point to signature */ |
| /* call ECDSA signing subroutine in P-256 lib */ |
| /* load signature to wregs for comparison with reference */ |
| /* random number for blinding */ |
| /* Expected values wide register file (w0=R, w1=S): |
| w0 = 0x815215ad7dd27f336b35843cbe064de299504edd0c7d87dd1147ea5680a9674a |
| w1 = 0xa3991e01c444042086e30cd999e589ad4dad9404e90a6d17d0b1051ec93fd605 |