-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathnum_utils.h
More file actions
28 lines (15 loc) · 709 Bytes
/
num_utils.h
File metadata and controls
28 lines (15 loc) · 709 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#ifndef BLOCK_CIPHER_NUM_UTILS_H
#define BLOCK_CIPHER_NUM_UTILS_H
#define two_power(n) (1u << (n))
#define array_size(a) (sizeof(a) / sizeof(*a))
unsigned int array_max(unsigned int *, unsigned int);
unsigned int log_2(unsigned int);
unsigned int nbits(unsigned int);
unsigned int parity(unsigned int);
unsigned int hamming_weight(unsigned int);
double correlation(unsigned int *, unsigned int *, unsigned int);
unsigned int **alloc_uint_matrix(unsigned int, unsigned int);
void print_uint_matrix(unsigned int **, unsigned int, unsigned int);
float **alloc_float_matrix(unsigned int, unsigned int);
void print_float_matrix(float **, unsigned int, unsigned int);
#endif //BLOCK_CIPHER_NUM_UTILS_H