13 croak("%s not implemented on this architecture", s);
17 MODULE = DES PACKAGE = DES PREFIX = des_
25 des_set_odd_parity(key)
32 sv_setpvn(s,(char *)key,8);
33 des_set_odd_parity((des_cblock *)SvPV(s,na));
45 des_set_key(key,RETVAL);
50 des_ecb_encrypt(input,ks,encrypt)
55 des_ecb_encrypt(input,&RETVAL,*ks,encrypt);
60 des_cbc_encrypt(input,ks,ivec,encrypt)
72 len=((((unsigned long)l)+7)/8)*8;
78 des_cbc_encrypt((des_cblock *)input,(des_cblock *)c,
80 sv_setpvn(ST(2),(char *)c[len-8],8);
85 des_cbc3_encrypt(input,ks1,ks2,ivec1,ivec2,encrypt)
87 des_key_schedule * ks1
88 des_key_schedule * ks2
98 len=((((unsigned long)l)+7)/8)*8;
103 des_3cbc_encrypt((des_cblock *)input,(des_cblock *)SvPV(s,na),
104 l,*ks1,*ks2,ivec1,ivec2,encrypt);
105 sv_setpvn(ST(3),(char *)ivec1,8);
106 sv_setpvn(ST(4),(char *)ivec2,8);
111 des_cbc_cksum(input,ks,ivec)
113 des_key_schedule * ks
125 des_cbc_cksum((des_cblock *)input,(des_cblock *)c,
127 i1=c[4]|(c[5]<<8)|(c[6]<<16)|(c[7]<<24);
128 i2=c[0]|(c[1]<<8)|(c[2]<<16)|(c[3]<<24);
131 sv_setpvn(ST(2),(char *)c,8);
137 des_cfb_encrypt(input,numbits,ks,ivec,encrypt)
140 des_key_schedule * ks
154 c=(char *)SvPV(s,na);
155 des_cfb_encrypt((unsigned char *)input,(unsigned char *)c,
156 (int)numbits,(long)len,*ks,ivec,encrypt);
157 sv_setpvn(ST(3),(char *)ivec,8);
162 des_ecb3_encrypt(input,ks1,ks2,encrypt)
164 des_key_schedule * ks1
165 des_key_schedule * ks2
171 des_ecb3_encrypt((des_cblock *)input,(des_cblock *)&c,
179 des_ofb_encrypt(input,numbits,ks,ivec)
180 unsigned char * input
182 des_key_schedule * ks
195 c=(unsigned char *)SvPV(s,na);
196 des_ofb_encrypt((unsigned char *)input,(unsigned char *)c,
197 numbits,len,*ks,ivec);
198 sv_setpvn(ST(3),(char *)ivec,8);
203 des_pcbc_encrypt(input,ks,ivec,encrypt)
205 des_key_schedule * ks
215 len=((((unsigned long)l)+7)/8)*8;
220 c=(char *)SvPV(s,na);
221 des_pcbc_encrypt((des_cblock *)input,(des_cblock *)c,
223 sv_setpvn(ST(2),(char *)c[len-8],8);
240 des_string_to_key(str)
246 des_string_to_key(str,&c);
253 des_string_to_2keys(str)
260 des_string_to_2keys(str,&c1,&c2);
263 sv_setpvn(s1,(char *)c1,8);
265 sv_setpvn(s2,(char *)c2,8);