curve: use shamir trick for multiplication