| 27 | #include "password.h" |
| 28 | |
| 29 | void SQL_CRYPT::init(ulong *rand_nr) |
| 30 | { |
| 31 | uint i; |
| 32 | randominit(&rand,rand_nr[0],rand_nr[1]); |
| 33 | |
| 34 | for (i=0 ; i<=255; i++) |
| 35 | decode_buff[i]= (char) i; |
| 36 | |
| 37 | for (i=0 ; i<= 255 ; i++) |
| 38 | { |
| 39 | int idx= (uint) (my_rnd(&rand)*255.0); |
| 40 | char a= decode_buff[idx]; |
| 41 | decode_buff[idx]= decode_buff[i]; |
| 42 | decode_buff[+i]=a; |
| 43 | } |
| 44 | for (i=0 ; i <= 255 ; i++) |
| 45 | encode_buff[(uchar) decode_buff[i]]=i; |
| 46 | org_rand=rand; |
| 47 | shift=0; |
| 48 | } |
| 49 | |
| 50 | |
| 51 | void SQL_CRYPT::encode(char *str,uint length) |
nothing calls this directly
no test coverage detected