-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsha3.h
34 lines (29 loc) · 1.19 KB
/
sha3.h
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
29
30
31
32
33
34
/* Implement the following API. Do NOT modify the given prototypes. */
#include <inttypes.h>
/* Compute the SHA-3 hash for a message.
*
* d - the output buffer (allocated by the caller)
* s - size of the output buffer in bits
* m - the input message
* l - size of the input message in bits
*/
void sha3(unsigned char *d, unsigned int s, const unsigned char *m,
unsigned int l);
/* You can add your own functions below this line.
* Do NOT modify anything above. */
// String To State and State To String
void string_state(unsigned char *n , unsigned char z[5][5][64],unsigned int size);
void state_string(unsigned char *n , unsigned char z[5][5][64]);
// RND Functions
void theta( uint64_t *a );
void rho( uint64_t *a );
void pi( uint64_t *a );
void chi( uint64_t *a );
void iota( uint64_t *a , unsigned long ir);
void keccakp(unsigned char *s , unsigned int b ,unsigned long nr ,unsigned char* op);
void sponge(unsigned char *out, unsigned int out_len, unsigned char* m , unsigned int l );
// Print Functions
void printstring(unsigned char* s,unsigned int length);
void print(unsigned char a[5][5][64]);
void print_in_pairs(unsigned char a[5][5][64]);
void print_2d(unsigned char *a, int l, int m);