Skip to content

Commit a3f462d

Browse files
author
Docs Syncer
committed
CI: 79f75d8
1 parent 1210af9 commit a3f462d

File tree

1 file changed

+79
-0
lines changed

1 file changed

+79
-0
lines changed
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# ECDSA256
2+
3+
## Overview
4+
5+
#### License: MIT
6+
7+
```solidity
8+
library ECDSA256
9+
```
10+
11+
Cryptography module
12+
13+
This library provides functionality for ECDSA verification over any 256-bit curve.
14+
15+
For more information, please refer to the OpenZeppelin documentation.
16+
## Structs info
17+
18+
### Parameters
19+
20+
```solidity
21+
struct Parameters {
22+
uint256 a;
23+
uint256 b;
24+
uint256 gx;
25+
uint256 gy;
26+
uint256 p;
27+
uint256 n;
28+
uint256 lowSmax;
29+
}
30+
```
31+
32+
256-bit curve parameters.
33+
### _JPoint
34+
35+
```solidity
36+
struct _JPoint {
37+
uint256 x;
38+
uint256 y;
39+
uint256 z;
40+
}
41+
```
42+
43+
44+
### _Inputs
45+
46+
```solidity
47+
struct _Inputs {
48+
uint256 r;
49+
uint256 s;
50+
uint256 x;
51+
uint256 y;
52+
}
53+
```
54+
55+
56+
## Functions info
57+
58+
### verify
59+
60+
```solidity
61+
function verify(
62+
ECDSA256.Parameters memory curveParams_,
63+
bytes32 hashedMessage_,
64+
bytes memory signature_,
65+
bytes memory pubKey_
66+
) internal view returns (bool)
67+
```
68+
69+
The function to verify the ECDSA signature
70+
71+
72+
Parameters:
73+
74+
| Name | Type | Description |
75+
| :------------- | :------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
76+
| curveParams_ | struct ECDSA256.Parameters | the 256-bit curve parameters. `lowSmax` is `n / 2`. |
77+
| hashedMessage_ | bytes32 | the already hashed message to be verified. |
78+
| signature_ | bytes | the ECDSA signature. Equals to `bytes(r) + bytes(s)`. |
79+
| pubKey_ | bytes | the full public key of a signer. Equals to `bytes(x) + bytes(y)`. Note that signatures only from the lower part of the curve are accepted. If your `s > n / 2`, change it to `s = n - s`. |

0 commit comments

Comments
 (0)