@@ -1803,12 +1803,11 @@ static void sc_muladd(uint8_t *s, const uint8_t *a, const uint8_t *b,
1803
1803
}
1804
1804
1805
1805
#include <caml/memory.h>
1806
- #define _st_uint8_off (st , off ) ((uint8_t*) String_val (st) + Long_val (off))
1807
1806
1808
- CAMLprim value mc_x25519_scalar_mult_generic (value out , value scalar , value soff , value point , value poff )
1807
+ CAMLprim value mc_x25519_scalar_mult_generic (value out , value scalar , value point )
1809
1808
{
1810
- CAMLparam5 (out , scalar , soff , point , poff );
1811
- x25519_scalar_mult_generic (Bytes_val (out ), _st_uint8_off (scalar , soff ), _st_uint8_off (point , poff ));
1809
+ CAMLparam3 (out , scalar , point );
1810
+ x25519_scalar_mult_generic (Bytes_val (out ), Bytes_val (scalar ), Bytes_val (point ));
1812
1811
CAMLreturn (Val_unit );
1813
1812
}
1814
1813
@@ -1836,9 +1835,9 @@ CAMLprim value mc_25519_muladd(value out, value a, value b, value c)
1836
1835
CAMLreturn (Val_unit );
1837
1836
}
1838
1837
1839
- CAMLprim value mc_25519_double_scalar_mult (value out , value k , value key , value c , value coff )
1838
+ CAMLprim value mc_25519_double_scalar_mult (value out , value k , value key , value c )
1840
1839
{
1841
- CAMLparam5 (out , k , key , c , coff );
1840
+ CAMLparam4 (out , k , key , c );
1842
1841
ge_p2 R ;
1843
1842
ge_p3 B ;
1844
1843
fe_loose t ;
@@ -1848,7 +1847,7 @@ CAMLprim value mc_25519_double_scalar_mult(value out, value k, value key, value
1848
1847
fe_carry (& B .X , & t );
1849
1848
fe_neg (& t , & B .T );
1850
1849
fe_carry (& B .T , & t );
1851
- ge_double_scalarmult_vartime (& R , Bytes_val (k ), & B , _st_uint8_off ( c , coff ));
1850
+ ge_double_scalarmult_vartime (& R , Bytes_val (k ), & B , Bytes_val ( c ));
1852
1851
x25519_ge_tobytes (Bytes_val (out ), & R );
1853
1852
CAMLreturn (Val_bool (success ));
1854
1853
}
0 commit comments