Skip to content

Commit 7178382

Browse files
committed
N-02: make state variables private
1 parent 4075232 commit 7178382

File tree

3 files changed

+15
-14
lines changed

3 files changed

+15
-14
lines changed

src/P256.sol

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ pragma solidity 0.8.21;
88
* @custom:security-contact [email protected]
99
**/
1010
library P256 {
11-
address constant PRECOMPILE = address(0x100);
12-
address constant VERIFIER = 0xc2b78104907F722DABAc4C69f826a522B2754De4;
11+
address public constant PRECOMPILE = address(0x100);
12+
address public constant VERIFIER =
13+
0xc2b78104907F722DABAc4C69f826a522B2754De4;
1314

1415
function verifySignatureAllowMalleability(
1516
bytes32 message_hash,

src/P256Verifier.sol

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,27 +42,27 @@ contract P256Verifier {
4242

4343
// Parameters for the sec256r1 (P256) elliptic curve
4444
// Curve prime field modulus
45-
uint256 constant p =
45+
uint256 private constant p =
4646
0xFFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF;
4747
// Short weierstrass first coefficient
48-
uint256 constant a = // The assumption a == -3 (mod p) is used throughout the codebase
48+
uint256 private constant a = // The assumption a == -3 (mod p) is used throughout the codebase
4949
0xFFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC;
5050
// Short weierstrass second coefficient
51-
uint256 constant b =
51+
uint256 private constant b =
5252
0x5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B;
5353
// Generating point affine coordinates
54-
uint256 constant GX =
54+
uint256 private constant GX =
5555
0x6B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C296;
56-
uint256 constant GY =
56+
uint256 private constant GY =
5757
0x4FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5;
5858
// Curve order (number of points)
59-
uint256 constant n =
59+
uint256 private constant n =
6060
0xFFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551;
6161
// -2 mod p constant, used to speed up inversion and doubling (avoid negation)
62-
uint256 constant minus_2modp =
62+
uint256 private constant minus_2modp =
6363
0xFFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFD;
6464
// -2 mod n constant, used to speed up inversion
65-
uint256 constant minus_2modn =
65+
uint256 private constant minus_2modn =
6666
0xFFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC63254F;
6767

6868
/**

src/WebAuthn.sol

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ library WebAuthn {
3333
return true;
3434
}
3535

36-
bytes1 constant AUTH_DATA_FLAGS_UP = 0x01; // Bit 0
37-
bytes1 constant AUTH_DATA_FLAGS_UV = 0x04; // Bit 2
38-
bytes1 constant AUTH_DATA_FLAGS_BE = 0x08; // Bit 3
39-
bytes1 constant AUTH_DATA_FLAGS_BS = 0x10; // Bit 4
36+
bytes1 private constant AUTH_DATA_FLAGS_UP = 0x01; // Bit 0
37+
bytes1 private constant AUTH_DATA_FLAGS_UV = 0x04; // Bit 2
38+
bytes1 private constant AUTH_DATA_FLAGS_BE = 0x08; // Bit 3
39+
bytes1 private constant AUTH_DATA_FLAGS_BS = 0x10; // Bit 4
4040

4141
/// Verifies the authFlags in authenticatorData. Numbers in inline comment
4242
/// correspond to the same numbered bullets in

0 commit comments

Comments
 (0)