We propose to write Scheme code that unifies DSA and ECDSA which is sort of described in X9.63. The input to the code is a computational Abelian group. The 2014 Feb 8 version of this is our inspiration. Such a group is presented as (eq op I G inv n) where
eq | is the equality predicate for comparing two group elements, in case representation is not canonical | (eq a a) (eq a b) → (eq b a) if (eq a b) then (if φ(a) then φ(b)) |
op | a function of type g×g→g
where g is the set of group values | (eq (op a (op b c)) (op (op a b) c)) (eq (op a b) (op b a)) |
I | is the group identity | (eq (op I a) a) (eq (op a I) a) |
G | is some generator of the group | |
inv | is the inverse of the operation | (eq (op x (inv x)) I) |
n | number of elements in group | nG = I |
I could be computed as (((fileVal "expt") op #f #f) G n) or (op G (inv G)) but that seems unnecessary.
n could be computed as
(let c ((N 0)(g G)) (if (eq g I) N (+ 1 (c (op G g)))) but then this would not qualify for the informal term “computational group”.