Blame mini-gmp/tests/hex-random.h

Packit 5c3484
/*
Packit 5c3484
Packit 5c3484
Copyright 2011, Free Software Foundation, Inc.
Packit 5c3484
Packit 5c3484
This file is part of the GNU MP Library test suite.
Packit 5c3484
Packit 5c3484
The GNU MP Library test suite is free software; you can redistribute it
Packit 5c3484
and/or modify it under the terms of the GNU General Public License as
Packit 5c3484
published by the Free Software Foundation; either version 3 of the License,
Packit 5c3484
or (at your option) any later version.
Packit 5c3484
Packit 5c3484
The GNU MP Library test suite is distributed in the hope that it will be
Packit 5c3484
useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 5c3484
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
Packit 5c3484
Public License for more details.
Packit 5c3484
Packit 5c3484
You should have received a copy of the GNU General Public License along with
Packit 5c3484
the GNU MP Library test suite.  If not, see https://www.gnu.org/licenses/.  */
Packit 5c3484
Packit 5c3484
enum hex_random_op
Packit 5c3484
  {
Packit 5c3484
    OP_ADD, OP_SUB, OP_MUL, OP_SQR,
Packit 5c3484
    OP_CDIV, OP_FDIV, OP_TDIV,
Packit 5c3484
    OP_CDIV_Q_2, OP_CDIV_R_2,
Packit 5c3484
    OP_FDIV_Q_2, OP_FDIV_R_2,
Packit 5c3484
    OP_TDIV_Q_2,  OP_TDIV_R_2,
Packit 5c3484
    OP_GCD, OP_LCM, OP_POWM, OP_AND, OP_IOR, OP_XOR,
Packit 5c3484
    OP_SETBIT, OP_CLRBIT, OP_COMBIT,
Packit 5c3484
    OP_SCAN0, OP_SCAN1,
Packit 5c3484
  };
Packit 5c3484
Packit 5c3484
void hex_random_init (void);
Packit 5c3484
char *hex_urandomb (unsigned long bits);
Packit 5c3484
char *hex_rrandomb (unsigned long bits);
Packit 5c3484
char *hex_rrandomb_export (void *dst, size_t *countp,
Packit 5c3484
			   int order, size_t size, int endian,
Packit 5c3484
			   unsigned long bits);
Packit 5c3484
Packit 5c3484
void hex_random_op2 (enum hex_random_op op,  unsigned long maxbits,
Packit 5c3484
		     char **ap, char **rp);
Packit 5c3484
void hex_random_op3 (enum hex_random_op op,  unsigned long maxbits,
Packit 5c3484
		     char **ap, char **bp, char **rp);
Packit 5c3484
void hex_random_op4 (enum hex_random_op op,  unsigned long maxbits,
Packit 5c3484
		     char **ap, char **bp, char **rp, char **qp);
Packit 5c3484
void hex_random_bit_op (enum hex_random_op op, unsigned long maxbits,
Packit 5c3484
			char **ap, unsigned long *b, char **rp);
Packit 5c3484
void hex_random_scan_op (enum hex_random_op op, unsigned long maxbits,
Packit 5c3484
			char **ap, unsigned long *b, unsigned long *r);
Packit 5c3484
void hex_random_str_op (unsigned long maxbits,
Packit 5c3484
			int base, char **ap, char **rp);