@@ -841,6 +841,41 @@ test_point_sub( fd_rng_t * rng FD_PARAM_UNUSED ) {
841841 }
842842}
843843
844+ static void
845+ test_point_mul ( fd_rng_t * rng FD_PARAM_UNUSED ) {
846+ uchar _bufa [32 ]; uchar * bufa = _bufa ;
847+ uchar _bufn [32 ]; uchar * bufn = _bufn ;
848+ uchar _bufr [32 ]; uchar * bufr = _bufr ;
849+ uchar _bufe [32 ]; uchar * bufe = _bufe ;
850+
851+ fd_ed25519_point_t a [1 ];
852+ fd_ed25519_point_t r [1 ];
853+ fd_ed25519_point_t e [1 ];
854+
855+ {
856+ fd_hex_decode ( bufa , "0000000000000000003b0000e8e8e8000000000000000000000000000000ffff" , 32 );
857+ fd_hex_decode ( bufn , "005d0000000000000000000000000000000000000000000015b6b6b6b6000000" , 32 );
858+ fd_hex_decode ( bufe , "7b1e1037cbe6e84f922a9b0651ed50570530d6157853debba755d5904021740e" , 32 );
859+
860+ FD_TEST ( fd_ed25519_scalar_validate ( bufn ) );
861+ FD_TEST ( fd_ed25519_point_frombytes ( a , bufa ) );
862+
863+ FD_TEST ( fd_ed25519_point_frombytes ( e , bufe ) );
864+ {
865+ fd_ed25519_point_tobytes ( bufr , a );
866+ FD_TEST ( fd_memeq ( bufr , bufa , 32UL ) );
867+ }
868+
869+ fd_ed25519_scalar_mul ( r , bufn , a );
870+ fd_ed25519_point_tobytes ( bufr , r );
871+
872+ // FD_LOG_HEXDUMP_WARNING(( "bufr", bufr, 32 ));
873+ // FD_LOG_HEXDUMP_WARNING(( "bufe", bufe, 32 ));
874+
875+ FD_TEST ( fd_memeq ( bufr , bufe , 32UL ) );
876+ }
877+ }
878+
844879/**********************************************************************/
845880
846881void
@@ -1300,6 +1335,7 @@ main( int argc,
13001335 test_point_validate ( rng );
13011336 test_point_frombytes ( rng );
13021337 test_point_sub ( rng );
1338+ test_point_mul ( rng );
13031339
13041340 test_sc_validate ( rng );
13051341 test_sc_reduce ( rng );
0 commit comments