openbmc/build/tmp/deploy/sdk/witherspoon-2019-08-08/sysroots/armv6-openbmc-linux-gnueabi/usr/src/debug/libgcrypt/1.8.4-r0/libgcrypt-1.8.4/mpi/ec.c
void _gcry_mpi_point_log(const char* name, mpi_point_t point, mpi_ec_t ctx)
{
    gcry_mpi_t x, y;
    char buf[100];

    if (!point)
    {
        snprintf(buf, sizeof buf - 1, "%s.*", name);
        log_mpidump(buf, NULL);
        return;
    }
    snprintf(buf, sizeof buf - 1, "%s.X", name);

    if (ctx)
    {
        x = mpi_new(0);
        y = mpi_new(0);
    }
    if (!ctx || _gcry_mpi_ec_get_affine(x, y, point, ctx))
    {
        log_mpidump(buf, point->x);
        buf[strlen(buf) - 1] = 'Y';
        log_mpidump(buf, point->y);
        buf[strlen(buf) - 1] = 'Z';
        log_mpidump(buf, point->z);
    }
    else
    {
        buf[strlen(buf) - 1] = 'x';
        log_mpidump(buf, x);
        buf[strlen(buf) - 1] = 'y';
        log_mpidump(buf, y);
    }
    if (ctx)
    {
        _gcry_mpi_release(x);
        _gcry_mpi_release(y);
    }
}
/* Print a point using the log functions.  If CTX is not NULL affine
   coordinates will be printed.  */
Print a point using the log functions.  If CTX is not NULL affine
coordinates will be printed.
Print a point using the log functions . If CTX is not NULL affine coordinates will be printed .
void _gcry_mpi_point_log(const char* name, mpi_point_t point, mpi_ec_t ctx)
{
    gcry_mpi_t x, y;
    char buf[100];
    if (!point)
    {
        snprintf(buf, sizeof buf - 1, "%s.*", name);
        log_mpidump(buf, NULL);
        return;
    }
    snprintf(buf, sizeof buf - 1, "%s.X", name);
    if (ctx)
    {
        x = mpi_new(0);
        y = mpi_new(0);
    }
    if (!ctx || _gcry_mpi_ec_get_affine(x, y, point, ctx))
    {
        log_mpidump(buf, point->x);
        buf[strlen(buf) - 1] = 'Y';
        log_mpidump(buf, point->y);
        buf[strlen(buf) - 1] = 'Z';
        log_mpidump(buf, point->z);
    }
    else
    {
        buf[strlen(buf) - 1] = 'x';
        log_mpidump(buf, x);
        buf[strlen(buf) - 1] = 'y';
        log_mpidump(buf, y);
    }
    if (ctx)
    {
        _gcry_mpi_release(x);
        _gcry_mpi_release(y);
    }
}
void _gcry_mpi_point_log ( const char * name , mpi_point_t point , mpi_ec_t ctx ) { gcry_mpi_t x , y ; char buf [ 100 ] ; if ( ! point ) { snprintf ( buf , sizeof buf - 1 , " " , name ) ; log_mpidump ( buf , NULL ) ; return ; } snprintf ( buf , sizeof buf - 1 , " " , name ) ; if ( ctx ) { x = mpi_new ( 0 ) ; y = mpi_new ( 0 ) ; } if ( ! ctx || _gcry_mpi_ec_get_affine ( x , y , point , ctx ) ) { log_mpidump ( buf , point -> x ) ; buf [ strlen ( buf ) - 1 ] = ' ' ; log_mpidump ( buf , point -> y ) ; buf [ strlen ( buf ) - 1 ] = ' ' ; log_mpidump ( buf , point -> z ) ; } else { buf [ strlen ( buf ) - 1 ] = ' ' ; log_mpidump ( buf , x ) ; buf [ strlen ( buf ) - 1 ] = ' ' ; log_mpidump ( buf , y ) ; } if ( ctx ) { _gcry_mpi_release ( x ) ; _gcry_mpi_release ( y ) ; } }
Print a point using the log functions.
Print a point using the log functions .