]> Repositorios git - scryer-prolog.git/commitdiff
ENHANCED: more extensive type checking in curve25519_scalar_mult/3
authorMarkus Triska <[email protected]>
Sun, 20 Aug 2023 12:42:34 +0000 (14:42 +0200)
committerMarkus Triska <[email protected]>
Sun, 20 Aug 2023 12:43:14 +0000 (14:43 +0200)
src/lib/crypto.pl

index 71c0420ee200d1af1fe2f9f032de43f9e3c18f3a..bec12d514187c355199fb468e51d3b44b62f6504 100644 (file)
@@ -711,6 +711,8 @@ curve25519_scalar_mult(Scalar, Point, Result) :-
             must_be_bytes(ScalarBytes, curve25519_scalar_mult/3),
             length(ScalarBytes, 32)
         ),
+        must_be(chars, Point),
+        length(Point, 32),
         maplist(char_code, Point, PointBytes),
         '$curve25519_scalar_mult'(ScalarBytes, PointBytes, Result).