Skip to content

Instantly share code, notes, and snippets.

%% schnorr grops
%% a basic sketch of zero-knowledge proofs [secret_sum/4]
%% 347, 173, 2
% (+P, +Q, -G)
schnorr_generator(P, Q, G) :-
R is (P - 1) / Q,
min_h(P, Q, H),
G is powm(H, R, P). %% G = H^R mod P