@@ -11,46 +11,23 @@ library ComputableComponents {
11
11
/// @notice Computes the resource commitment.
12
12
/// @param resource The resource object.
13
13
/// @return cm The computed commitment.
14
- function commitment (Resource calldata resource ) internal pure returns (bytes32 cm ) {
14
+ function commitment (Resource memory resource ) internal pure returns (bytes32 cm ) {
15
15
cm = sha256 (abi.encode (resource));
16
16
}
17
17
18
- /// @notice Computes the resource commitment.
19
- /// @param resource The resource object.
20
- /// @return cm The computed commitment.
21
- function commitment_ (Resource memory resource ) internal pure returns (bytes32 cm ) {
22
- cm = sha256 (abi.encode (resource));
23
- }
24
-
25
- /// @notice Computes the resource nullifier given a nullifier key.
26
- /// @param resource The resource object.
27
- /// @param nullifierKey The nullifier key.
28
- /// @return nf The computed nullifier.
29
- /// @dev This methods does not check that the nullifier key commitment matches the nullifier key.
30
- function nullifier (Resource calldata resource , bytes32 nullifierKey ) internal pure returns (bytes32 nf ) {
31
- nf = sha256 (abi.encode (resource, nullifierKey));
32
- }
33
-
34
18
/// @notice Computes the resource nullifier given a nullifier key.
35
19
/// @param resource The resource object.
36
20
/// @param nullifierKey The nullifier key.
37
21
/// @return nf The computed nullifier.
38
22
/// @dev This methods does not check that the nullifier key commitment matches the nullifier key.
39
- function nullifier_ (Resource memory resource , bytes32 nullifierKey ) internal pure returns (bytes32 nf ) {
23
+ function nullifier (Resource memory resource , bytes32 nullifierKey ) internal pure returns (bytes32 nf ) {
40
24
nf = sha256 (abi.encode (resource, nullifierKey));
41
25
}
42
26
43
27
/// @notice Computes the resource kind.
44
28
/// @param resource The resource object.
45
29
/// @return k The computed kind.
46
- function kind (Resource calldata resource ) internal pure returns (bytes32 k ) {
47
- k = sha256 (abi.encode (resource.logicRef, resource.labelRef));
48
- }
49
-
50
- /// @notice Computes the resource kind.
51
- /// @param resource The resource object.
52
- /// @return k The computed kind.
53
- function kind_ (Resource memory resource ) internal pure returns (bytes32 k ) {
30
+ function kind (Resource memory resource ) internal pure returns (bytes32 k ) {
54
31
k = sha256 (abi.encode (resource.logicRef, resource.labelRef));
55
32
}
56
33
0 commit comments