ext/lib/crypto/tinycrypt/source/ecc.c
/* Ellptic curve scalar multiplication with result in Jacobi coordinates */
/* p_result = p_scalar * p_point */
Ellptic curve scalar multiplication with result in Jacobi coordinates
p_result = p_scalar * p_point
Ellptic curve scalar multiplication with result in Jacobi coordinates p_result = p_scalar * p_point
void EccPoint_mult_unsafe(EccPointJacobi *p_result, EccPoint *p_point, uint32_t *p_scalar)
{
  int i;
  EccPointJacobi p_point_jacobi;
  EccPoint_fromAffine(p_result, p_point);
  EccPoint_fromAffine(&p_point_jacobi, p_point);
  for(i = vli_numBits(p_scalar) - 2; i >= 0; i--)
  {
    EccPoint_double(p_result);
    if (vli_testBit(p_scalar, i))
    {
      EccPoint_add(p_result, &p_point_jacobi);
    }
  }
}
void EccPoint_mult_unsafe ( EccPointJacobi * p_result , EccPoint * p_point , uint32_t * p_scalar ) { int i ; EccPointJacobi p_point_jacobi ; EccPoint_fromAffine ( p_result , p_point ) ; EccPoint_fromAffine ( & p_point_jacobi , p_point ) ; for ( i = vli_numBits ( p_scalar ) - 2 ; i >= 0 ; i -- ) { EccPoint_double ( p_result ) ; if ( vli_testBit ( p_scalar , i ) ) { EccPoint_add ( p_result , & p_point_jacobi ) ; } } }
Ellptic curve scalar multiplication with result in Jacobi coordinates
p_result = p_scalar * p_point
Ellptic curve scalar multiplication with result in Jacobi coordinates p_result = p_scalar * p_point