Skip to content

Commit abe87b0

Browse files
Serialize the graph and hash
1 parent 12017df commit abe87b0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pydatastructs/graphs/graph.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ def pedersen_commitment(graph, g, h, p, q, include_weights=True):
6767
raise ValueError("q must divide (p - 1).")
6868
if pow(g, q, p) != 1 or pow(h, q, p) != 1:
6969
raise ValueError("g and h must be generators of a subgroup of order q.")
70-
70+
data = serialize_graph(graph, include_weights)
71+
m = int(hashlib.sha256(data.encode()).hexdigest(), 16) % q
7172

7273

7374
__all__ = [

0 commit comments

Comments
 (0)