ajout tp2
This commit is contained in:
24
tp/tp2/src/lib/spn.h
Normal file
24
tp/tp2/src/lib/spn.h
Normal file
@@ -0,0 +1,24 @@
|
||||
#ifndef _SPN_H
|
||||
#define _SPN_H
|
||||
|
||||
void calc_inv_perm(unsigned char perm[8],unsigned char inv_perm[8]);
|
||||
void calc_inv_subst(unsigned char subst[16],unsigned char inv_subst[16]);
|
||||
|
||||
unsigned char do_perm(unsigned char w,unsigned char perm[8]);
|
||||
unsigned char do_subst(unsigned char w,unsigned char subst[16]);
|
||||
|
||||
unsigned char encrypt(
|
||||
unsigned char w,
|
||||
unsigned int key,
|
||||
unsigned char perm[8],
|
||||
unsigned char subst[16]
|
||||
);
|
||||
|
||||
unsigned char decrypt(
|
||||
unsigned char w,
|
||||
unsigned int key,
|
||||
unsigned char perm[8],
|
||||
unsigned char subst[16]
|
||||
);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user