blob: da443472e5be58eae04c55d89d790d5b497b048e [file] [log] [blame]
Austin Schuhdace2a62020-08-18 10:56:48 -07001/*
2
3Copyright 2011, 2018 Free Software Foundation, Inc.
4
5This file is part of the GNU MP Library test suite.
6
7The GNU MP Library test suite is free software; you can redistribute it
8and/or modify it under the terms of the GNU General Public License as
9published by the Free Software Foundation; either version 3 of the License,
10or (at your option) any later version.
11
12The GNU MP Library test suite is distributed in the hope that it will be
13useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
15Public License for more details.
16
17You should have received a copy of the GNU General Public License along with
18the GNU MP Library test suite. If not, see https://www.gnu.org/licenses/. */
19
20enum hex_random_op
21 {
22 OP_ADD, OP_SUB, OP_MUL, OP_SQR,
23 OP_CDIV, OP_FDIV, OP_TDIV,
24 OP_CDIV_Q_2, OP_CDIV_R_2,
25 OP_FDIV_Q_2, OP_FDIV_R_2,
26 OP_TDIV_Q_2, OP_TDIV_R_2,
27 OP_GCD, OP_LCM, OP_POWM, OP_AND, OP_IOR, OP_XOR,
28 OP_SETBIT, OP_CLRBIT, OP_COMBIT,
29 OP_SCAN0, OP_SCAN1,
30 };
31
32void hex_random_init (void);
33char *hex_urandomb (unsigned long bits);
34char *hex_rrandomb (unsigned long bits);
35char *hex_rrandomb_export (void *dst, size_t *countp,
36 int order, size_t size, int endian,
37 unsigned long bits);
38
39void hex_random_op2 (enum hex_random_op op, unsigned long maxbits,
40 char **ap, char **rp);
41void hex_random_op3 (enum hex_random_op op, unsigned long maxbits,
42 char **ap, char **bp, char **rp);
43void hex_random_op4 (enum hex_random_op op, unsigned long maxbits,
44 char **ap, char **bp, char **rp, char **qp);
45void hex_random_bit_op (enum hex_random_op op, unsigned long maxbits,
46 char **ap, unsigned long *b, char **rp);
47void hex_random_scan_op (enum hex_random_op op, unsigned long maxbits,
48 char **ap, unsigned long *b, unsigned long *r);
49void hex_random_str_op (unsigned long maxbits,
50 int base, char **ap, char **rp);
51void hex_random_lucm_op (unsigned long maxbits,
52 char **vp, char **qp, char **mp,
53 long *Q, unsigned long *b0, int *res);
54void hex_mpq_random_str_op (unsigned long maxbits,
55 int base, char **ap, char **rp);