]> Repositorios git - scryer-prolog.git/commitdiff
use (slightly) better variable names
authorMarkus Triska <[email protected]>
Sat, 3 Sep 2022 18:04:28 +0000 (20:04 +0200)
committerMark Thom <[email protected]>
Thu, 27 Oct 2022 05:36:07 +0000 (23:36 -0600)
src/lib/crypto.pl

index 6473e0d1ad11d55b314d12f55d9cf09de7affc40..42ce8f5d79f47c42208779c9823ec068f06c00e8 100644 (file)
@@ -761,15 +761,15 @@ crypto_curve_scalar_mult(Curve, Scalar, point(X,Y), point(RX, RY)) :-
         curve_name(Curve, Name),
         curve_field_length(Curve, L0),
         L #= 2*L0, % for hex encoding
-        phrase(format_("04~|~`0t~16r~*+~`0t~16r~*+", [X,L,Y,L]), Hex),
-        hex_bytes(Hex, PointBytes),
+        phrase(format_("04~|~`0t~16r~*+~`0t~16r~*+", [X,L,Y,L]), PointHex),
+        hex_bytes(PointHex, PointBytes),
         once(bytes_integer(ScalarBytes, Scalar)),
         '$crypto_curve_scalar_mult'(Name, ScalarBytes, PointBytes, [_|Us]),
         maplist(char_code, Us, Bs),
-        length(BXs0, 32),
-        append(BXs0, BYs0, Bs),
-        maplist(reverse, [BXs0,BYs0], Rs),
-        maplist(bytes_integer, Rs, [RX,RY]).
+        length(XBs, 32),
+        append(XBs, YBs, Bs),
+        maplist(reverse, [XBs,YBs], RBs),
+        maplist(bytes_integer, RBs, [RX,RY]).
 
 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 ?- crypto_name_curve(secp256k1, Curve),