Searched refs:iv (Results 1 - 25 of 259) sorted by relevance

1234567891011

/macosx-10.9.5/passwordserver_sasl-170/cyrus_sasl/mac/libdes/src/
H A Dcfb64enc.c79 /* crypto/des/cfb64enc.c */ /* Copyright (C) 1995-1997 Eric Young (eay@mincom.oz.au) * All rights reserved. * * This package is an SSL implementation written * by Eric Young (eay@mincom.oz.au). * The implementation was written so as to conform with Netscapes SSL. * * This library is free for commercial and non-commercial use as long as * the following conditions are aheared to. The following conditions * apply to all code found in this distribution, be it the RC4, RSA, * lhash, DES, etc., code; not just the SSL code. The SSL documentation * included with this distribution is covered by the same copyright terms * except that the holder is Tim Hudson (tjh@mincom.oz.au). * * Copyright remains Eric Young's, and as such any Copyright notices in * the code are not to be removed. * If this package is used in a product, Eric Young should be given attribution * as the author of the parts of the library used. * This can be in the form of a textual message at program startup or * in documentation (online or textual) provided with the package. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * "This product includes cryptographic software written by * Eric Young (eay@mincom.oz.au)" * The word 'cryptographic' can be left out if the rouines from the library * being used are not cryptographic related :-). * 4. If you include any Windows specific code (or a derivative thereof) from * the apps directory (application code) you must include an acknowledgement: * "This product includes software written by Tim Hudson (tjh@mincom.oz.au)" * * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * The licence and distribution terms for any publically available version or * derivative of this code cannot be changed. i.e. this code cannot simply be * copied and put under another distribution licence * [including the GNU Public Licence.] */ #include "des_locl.h" /* The input and output encrypted as though 64bit cfb mode is being * used. The extra state information to record how much of the * 64bit block we have used is contained in *num; */ void des_cfb64_encrypt(in, out, length, schedule, ivec, num, encrypt) unsigned char *in; unsigned char *out; long length; des_key_schedule schedule; des_cblock (*ivec); int *num; int encrypt; { register DES_LONG v0,v1; register long l=length; register int n= *num; DES_LONG ti[2]; unsigned char *iv,c,cc; iv=(unsigned char *)ivec; if (encrypt) { while (l--) { if (n == 0) { c2l(iv,v0); ti[0]=v0; c2l(iv,v1); ti[1]=v1; des_encrypt((DES_LONG *)ti, schedule,DES_ENCRYPT); iv=(unsigned char *)ivec; v0=ti[0]; l2c(v0,iv); v0=ti[1]; l2c(v0,iv); iv=(unsigned char *)ivec; } c= *(in++)^iv[n]; *(out++)=c; iv[
1 /* crypto/des/cfb64enc.c */ local
[all...]
H A Dcfb64ede.c79 /* crypto/des/cfb64ede.c */ /* Copyright (C) 1995-1997 Eric Young (eay@mincom.oz.au) * All rights reserved. * * This package is an SSL implementation written * by Eric Young (eay@mincom.oz.au). * The implementation was written so as to conform with Netscapes SSL. * * This library is free for commercial and non-commercial use as long as * the following conditions are aheared to. The following conditions * apply to all code found in this distribution, be it the RC4, RSA, * lhash, DES, etc., code; not just the SSL code. The SSL documentation * included with this distribution is covered by the same copyright terms * except that the holder is Tim Hudson (tjh@mincom.oz.au). * * Copyright remains Eric Young's, and as such any Copyright notices in * the code are not to be removed. * If this package is used in a product, Eric Young should be given attribution * as the author of the parts of the library used. * This can be in the form of a textual message at program startup or * in documentation (online or textual) provided with the package. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * "This product includes cryptographic software written by * Eric Young (eay@mincom.oz.au)" * The word 'cryptographic' can be left out if the rouines from the library * being used are not cryptographic related :-). * 4. If you include any Windows specific code (or a derivative thereof) from * the apps directory (application code) you must include an acknowledgement: * "This product includes software written by Tim Hudson (tjh@mincom.oz.au)" * * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * The licence and distribution terms for any publically available version or * derivative of this code cannot be changed. i.e. this code cannot simply be * copied and put under another distribution licence * [including the GNU Public Licence.] */ #include "des_locl.h" /* The input and output encrypted as though 64bit cfb mode is being * used. The extra state information to record how much of the * 64bit block we have used is contained in *num; */ void des_ede3_cfb64_encrypt(in, out, length, ks1,ks2,ks3, ivec, num, encrypt) unsigned char *in; unsigned char *out; long length; des_key_schedule ks1,ks2,ks3; des_cblock (*ivec); int *num; int encrypt; { register DES_LONG v0,v1; register long l=length; register int n= *num; DES_LONG ti[2]; unsigned char *iv,c,cc; iv=(unsigned char *)ivec; if (encrypt) { while (l--) { if (n == 0) { c2l(iv,v0); c2l(iv,v1); ti[0]=v0; ti[1]=v1; des_encrypt3((DES_LONG *)ti,ks1,ks2,ks3); v0=ti[0]; v1=ti[1]; iv=(unsigned char *)ivec; l2c(v0,iv); l2c(v1,iv); iv=(unsigned char *)ivec; } c= *(in++)^iv[n]; *(out++)=c; iv[
1 /* crypto/des/cfb64ede.c */ local
[all...]
H A Dofb64ede.c79 /* crypto/des/ofb64ede.c */ /* Copyright (C) 1995-1997 Eric Young (eay@mincom.oz.au) * All rights reserved. * * This package is an SSL implementation written * by Eric Young (eay@mincom.oz.au). * The implementation was written so as to conform with Netscapes SSL. * * This library is free for commercial and non-commercial use as long as * the following conditions are aheared to. The following conditions * apply to all code found in this distribution, be it the RC4, RSA, * lhash, DES, etc., code; not just the SSL code. The SSL documentation * included with this distribution is covered by the same copyright terms * except that the holder is Tim Hudson (tjh@mincom.oz.au). * * Copyright remains Eric Young's, and as such any Copyright notices in * the code are not to be removed. * If this package is used in a product, Eric Young should be given attribution * as the author of the parts of the library used. * This can be in the form of a textual message at program startup or * in documentation (online or textual) provided with the package. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * "This product includes cryptographic software written by * Eric Young (eay@mincom.oz.au)" * The word 'cryptographic' can be left out if the rouines from the library * being used are not cryptographic related :-). * 4. If you include any Windows specific code (or a derivative thereof) from * the apps directory (application code) you must include an acknowledgement: * "This product includes software written by Tim Hudson (tjh@mincom.oz.au)" * * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * The licence and distribution terms for any publically available version or * derivative of this code cannot be changed. i.e. this code cannot simply be * copied and put under another distribution licence * [including the GNU Public Licence.] */ #include "des_locl.h" /* The input and output encrypted as though 64bit ofb mode is being * used. The extra state information to record how much of the * 64bit block we have used is contained in *num; */ void des_ede3_ofb64_encrypt(in, out, length, k1,k2,k3, ivec, num) register unsigned char *in; register unsigned char *out; long length; des_key_schedule k1,k2,k3; des_cblock (*ivec); int *num; { register DES_LONG v0,v1; register int n= *num; register long l=length; des_cblock d; register char *dp; DES_LONG ti[2]; unsigned char *iv; int save=0; iv=(unsigned char *)ivec; c2l(iv,v0); c2l(iv,v1); ti[0]=v0; ti[1]=v1; dp=(char *)d; l2c(v0,dp); l2c(v1,dp); while (l--) { if (n == 0) { ti[0]=v0; ti[1]=v1; des_encrypt3((DES_LONG *)ti,k1,k2,k3); v0=ti[0]; v1=ti[1]; dp=(char *)d; l2c(v0,dp); l2c(v1,dp); save++; } *(out++)= *(in++)^d[n]; n=(n+1)&0x07; } if (save) { /* v0=ti[0]; v1=ti[1];*/ iv=(unsigned char *)ivec; l2c(v0,iv); l2c(v1,iv); } v0=v1=ti[0]=ti[1]=0; *num=n; } #ifdef undef /* MACRO */ void des_ede2_ofb64_encrypt(in, (…)
1 /* crypto/des/ofb64ede.c */ local
H A Dofb64enc.c79 /* crypto/des/ofb64enc.c */ /* Copyright (C) 1995-1997 Eric Young (eay@mincom.oz.au) * All rights reserved. * * This package is an SSL implementation written * by Eric Young (eay@mincom.oz.au). * The implementation was written so as to conform with Netscapes SSL. * * This library is free for commercial and non-commercial use as long as * the following conditions are aheared to. The following conditions * apply to all code found in this distribution, be it the RC4, RSA, * lhash, DES, etc., code; not just the SSL code. The SSL documentation * included with this distribution is covered by the same copyright terms * except that the holder is Tim Hudson (tjh@mincom.oz.au). * * Copyright remains Eric Young's, and as such any Copyright notices in * the code are not to be removed. * If this package is used in a product, Eric Young should be given attribution * as the author of the parts of the library used. * This can be in the form of a textual message at program startup or * in documentation (online or textual) provided with the package. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * "This product includes cryptographic software written by * Eric Young (eay@mincom.oz.au)" * The word 'cryptographic' can be left out if the rouines from the library * being used are not cryptographic related :-). * 4. If you include any Windows specific code (or a derivative thereof) from * the apps directory (application code) you must include an acknowledgement: * "This product includes software written by Tim Hudson (tjh@mincom.oz.au)" * * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * The licence and distribution terms for any publically available version or * derivative of this code cannot be changed. i.e. this code cannot simply be * copied and put under another distribution licence * [including the GNU Public Licence.] */ #include "des_locl.h" /* The input and output encrypted as though 64bit ofb mode is being * used. The extra state information to record how much of the * 64bit block we have used is contained in *num; */ void des_ofb64_encrypt(in, out, length, schedule, ivec, num) register unsigned char *in; register unsigned char *out; long length; des_key_schedule schedule; des_cblock (*ivec); int *num; { register DES_LONG v0,v1,t; register int n= *num; register long l=length; des_cblock d; register char *dp; DES_LONG ti[2]; unsigned char *iv; int save=0; iv=(unsigned char *)ivec; c2l(iv,v0); c2l(iv,v1); ti[0]=v0; ti[1]=v1; dp=(char *)d; l2c(v0,dp); l2c(v1,dp); while (l--) { if (n == 0) { des_encrypt((DES_LONG *)ti,schedule,DES_ENCRYPT); dp=(char *)d; t=ti[0]; l2c(t,dp); t=ti[1]; l2c(t,dp); save++; } *(out++)= *(in++)^d[n]; n=(n+1)&0x07; } if (save) { v0=ti[0]; v1=ti[1]; iv=(unsigned char *)ivec; l2c(v0,iv); l2c(v1,iv); } t=v0=v1=ti[0]=ti[1]=0; *num=n; }
1 /* crypto/des/ofb64enc.c */ local
H A Dofb_enc.c80 /* crypto/des/ofb_enc.c */ /* Copyright (C) 1995-1997 Eric Young (eay@mincom.oz.au) * All rights reserved. * * This package is an SSL implementation written * by Eric Young (eay@mincom.oz.au). * The implementation was written so as to conform with Netscapes SSL. * * This library is free for commercial and non-commercial use as long as * the following conditions are aheared to. The following conditions * apply to all code found in this distribution, be it the RC4, RSA, * lhash, DES, etc., code; not just the SSL code. The SSL documentation * included with this distribution is covered by the same copyright terms * except that the holder is Tim Hudson (tjh@mincom.oz.au). * * Copyright remains Eric Young's, and as such any Copyright notices in * the code are not to be removed. * If this package is used in a product, Eric Young should be given attribution * as the author of the parts of the library used. * This can be in the form of a textual message at program startup or * in documentation (online or textual) provided with the package. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * "This product includes cryptographic software written by * Eric Young (eay@mincom.oz.au)" * The word 'cryptographic' can be left out if the rouines from the library * being used are not cryptographic related :-). * 4. If you include any Windows specific code (or a derivative thereof) from * the apps directory (application code) you must include an acknowledgement: * "This product includes software written by Tim Hudson (tjh@mincom.oz.au)" * * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * The licence and distribution terms for any publically available version or * derivative of this code cannot be changed. i.e. this code cannot simply be * copied and put under another distribution licence * [including the GNU Public Licence.] */ #include "des_locl.h" /* The input and output are loaded in multiples of 8 bits. * What this means is that if you hame numbits=12 and length=2 * the first 12 bits will be retrieved from the first byte and half * the second. The second 12 bits will come from the 3rd and half the 4th * byte. */ void des_ofb_encrypt(in, out, numbits, length, schedule, ivec) unsigned char *in; unsigned char *out; int numbits; long length; des_key_schedule schedule; des_cblock (*ivec); { register DES_LONG d0,d1,v0,v1,n=(numbits+7)/8; register DES_LONG mask0,mask1; register long l=length; register int num=numbits; DES_LONG ti[2]; unsigned char *iv; if (num > 64) return; if (num > 32) { mask0=0xffffffffL; if (num >= 64) mask1=mask0; else mask1=(1L<<(num-32))-1; } else { if (num == 32) mask0=0xffffffffL; else mask0=(1L<<num)-1; mask1=0x00000000; } iv=(unsigned char *)ivec; c2l(iv,v0); c2l(iv,v1); ti[0]=v0; ti[1]=v1; while (l-- > 0) { des_encrypt((DES_LONG *)ti,schedule,DES_ENCRYPT); c2ln(in,d0,d1,n); in+=n; d0=(d0^ti[0])&mask0; d1=(d1^ti[1])&mask1; l2cn(d0,d1,out,n); out+=n; } v0=ti[0]; v1=ti[1]; iv=(unsigned char *)ivec; l2c(v0,iv); l2c(v1,iv); v0=v1=d0=d1=ti[0]=ti[1]=0; }
1 /* crypto/des/ofb_enc.c */ local
H A Dncbc_enc.c74 /* crypto/des/ncbc_enc.c */ /* Copyright (C) 1995-1997 Eric Young (eay@mincom.oz.au) * All rights reserved. * * This package is an SSL implementation written * by Eric Young (eay@mincom.oz.au). * The implementation was written so as to conform with Netscapes SSL. * * This library is free for commercial and non-commercial use as long as * the following conditions are aheared to. The following conditions * apply to all code found in this distribution, be it the RC4, RSA, * lhash, DES, etc., code; not just the SSL code. The SSL documentation * included with this distribution is covered by the same copyright terms * except that the holder is Tim Hudson (tjh@mincom.oz.au). * * Copyright remains Eric Young's, and as such any Copyright notices in * the code are not to be removed. * If this package is used in a product, Eric Young should be given attribution * as the author of the parts of the library used. * This can be in the form of a textual message at program startup or * in documentation (online or textual) provided with the package. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * "This product includes cryptographic software written by * Eric Young (eay@mincom.oz.au)" * The word 'cryptographic' can be left out if the rouines from the library * being used are not cryptographic related :-). * 4. If you include any Windows specific code (or a derivative thereof) from * the apps directory (application code) you must include an acknowledgement: * "This product includes software written by Tim Hudson (tjh@mincom.oz.au)" * * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * The licence and distribution terms for any publically available version or * derivative of this code cannot be changed. i.e. this code cannot simply be * copied and put under another distribution licence * [including the GNU Public Licence.] */ #include "des_locl.h" void des_ncbc_encrypt(input, output, length, schedule, ivec, encrypt) des_cblock (*input); des_cblock (*output); long length; des_key_schedule schedule; des_cblock (*ivec); int encrypt; { register DES_LONG tin0,tin1; register DES_LONG tout0,tout1,xor0,xor1; register unsigned char *in,*out; register long l=length; DES_LONG tin[2]; unsigned char *iv; in=(unsigned char *)input; out=(unsigned char *)output; iv=(unsigned char *)ivec; if (encrypt) { c2l(iv,tout0); c2l(iv,tout1); for (l-=8; l>=0; l-=8) { c2l(in,tin0); c2l(in,tin1); tin0^=tout0; tin[0]=tin0; tin1^=tout1; tin[1]=tin1; des_encrypt((DES_LONG *)tin,schedule,DES_ENCRYPT); tout0=tin[0]; l2c(tout0,out); tout1=tin[1]; l2c(tout1,out); } if (l != -8) { c2ln(in,tin0,tin1,l+8); tin0^=tout0; tin[0]=tin0; tin1^=tout1; tin[1]=tin1; des_encrypt((DES_LONG *)tin,schedule,DES_ENCRYPT); tout0=tin[0]; l2c(tout0,out); tout1=tin[1]; l2c(tout1,out); } iv=(unsigned char *)ivec; l2c(tout0,iv); l2c(tout1,iv); } else { c2l(iv,xor0); c2l(iv,xor1); for (l-=8; l>=0; l-=8) { c2l(in,tin0); tin[0]=tin0; c2l(in,tin1); tin[1]=tin1; des_encrypt((DES_LONG *)tin,schedule,DES_DECRYPT); tout0=tin[0]^xor0; tout1=tin[1]^xor1; l2c(tout0,out); l2c(tout1,out); xor0=tin0; xor1=tin1; } if (l != -8) { c2l(in,tin0); tin[0]=tin0; c2l(in,tin1); tin[1]=tin1; des_encrypt((DES_LONG *)tin,schedule,DES_DECRYPT); tout0=tin[0]^xor0; tout1=tin[1]^xor1; l2cn(tout0,tout1,out,l+8); xor0=tin0; xor1=tin1; } iv
1 /* crypto/des/ncbc_enc.c */ local
[all...]
H A Dede_enc.c76 /* crypto/des/ede_enc.c */ /* Copyright (C) 1995-1997 Eric Young (eay@mincom.oz.au) * All rights reserved. * * This package is an SSL implementation written * by Eric Young (eay@mincom.oz.au). * The implementation was written so as to conform with Netscapes SSL. * * This library is free for commercial and non-commercial use as long as * the following conditions are aheared to. The following conditions * apply to all code found in this distribution, be it the RC4, RSA, * lhash, DES, etc., code; not just the SSL code. The SSL documentation * included with this distribution is covered by the same copyright terms * except that the holder is Tim Hudson (tjh@mincom.oz.au). * * Copyright remains Eric Young's, and as such any Copyright notices in * the code are not to be removed. * If this package is used in a product, Eric Young should be given attribution * as the author of the parts of the library used. * This can be in the form of a textual message at program startup or * in documentation (online or textual) provided with the package. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * "This product includes cryptographic software written by * Eric Young (eay@mincom.oz.au)" * The word 'cryptographic' can be left out if the rouines from the library * being used are not cryptographic related :-). * 4. If you include any Windows specific code (or a derivative thereof) from * the apps directory (application code) you must include an acknowledgement: * "This product includes software written by Tim Hudson (tjh@mincom.oz.au)" * * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * The licence and distribution terms for any publically available version or * derivative of this code cannot be changed. i.e. this code cannot simply be * copied and put under another distribution licence * [including the GNU Public Licence.] */ #include "des_locl.h" void des_ede3_cbc_encrypt(input, output, length, ks1, ks2, ks3, ivec, encrypt) des_cblock (*input); des_cblock (*output); long length; des_key_schedule ks1; des_key_schedule ks2; des_key_schedule ks3; des_cblock (*ivec); int encrypt; { register DES_LONG tin0,tin1; register DES_LONG tout0,tout1,xor0,xor1; register unsigned char *in,*out; register long l=length; DES_LONG tin[2]; unsigned char *iv; in=(unsigned char *)input; out=(unsigned char *)output; iv=(unsigned char *)ivec; if (encrypt) { c2l(iv,tout0); c2l(iv,tout1); for (l-=8; l>=0; l-=8) { c2l(in,tin0); c2l(in,tin1); tin0^=tout0; tin1^=tout1; tin[0]=tin0; tin[1]=tin1; des_encrypt3((DES_LONG *)tin,ks1,ks2,ks3); tout0=tin[0]; tout1=tin[1]; l2c(tout0,out); l2c(tout1,out); } if (l != -8) { c2ln(in,tin0,tin1,l+8); tin0^=tout0; tin1^=tout1; tin[0]=tin0; tin[1]=tin1; des_encrypt3((DES_LONG *)tin,ks1,ks2,ks3); tout0=tin[0]; tout1=tin[1]; l2c(tout0,out); l2c(tout1,out); } iv=(unsigned char *)ivec; l2c(tout0,iv); l2c(tout1,iv); } else { register DES_LONG t0,t1; c2l(iv,xor0); c2l(iv,xor1); for (l-=8; l>=0; l-=8) { c2l(in,tin0); c2l(in,tin1); t0=tin0; t1=tin1; tin[0]=tin0; tin[1]=tin1; des_decrypt3((DES_LONG *)tin,ks1,ks2,ks3); tout0=tin[0]; tout1=tin[1]; tout0^=xor0; tout1^=xor1; l2c(tout0,out); l2c(tout1,out); xor0=t0; xor1=t1; } if (l != -8) { c2l(in,tin0); c2l(in,tin1); t0=tin0; t1=tin1; tin[0]=tin0; tin[1]=tin1; des_decrypt3((DES_LONG *)tin,ks1,ks2,ks3); tout0=tin[0]; tout1=tin[1]; tout0^=xor0; tout1^=xor1; l2cn(tout0,tout1,out,l+8); xor0=t0; xor1=t1; } iv
1 /* crypto/des/ede_enc.c */ local
[all...]
H A Dpcbc_enc.c71 /* crypto/des/pcbc_enc.c */ /* Copyright (C) 1995-1997 Eric Young (eay@mincom.oz.au) * All rights reserved. * * This package is an SSL implementation written * by Eric Young (eay@mincom.oz.au). * The implementation was written so as to conform with Netscapes SSL. * * This library is free for commercial and non-commercial use as long as * the following conditions are aheared to. The following conditions * apply to all code found in this distribution, be it the RC4, RSA, * lhash, DES, etc., code; not just the SSL code. The SSL documentation * included with this distribution is covered by the same copyright terms * except that the holder is Tim Hudson (tjh@mincom.oz.au). * * Copyright remains Eric Young's, and as such any Copyright notices in * the code are not to be removed. * If this package is used in a product, Eric Young should be given attribution * as the author of the parts of the library used. * This can be in the form of a textual message at program startup or * in documentation (online or textual) provided with the package. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * "This product includes cryptographic software written by * Eric Young (eay@mincom.oz.au)" * The word 'cryptographic' can be left out if the rouines from the library * being used are not cryptographic related :-). * 4. If you include any Windows specific code (or a derivative thereof) from * the apps directory (application code) you must include an acknowledgement: * "This product includes software written by Tim Hudson (tjh@mincom.oz.au)" * * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * The licence and distribution terms for any publically available version or * derivative of this code cannot be changed. i.e. this code cannot simply be * copied and put under another distribution licence * [including the GNU Public Licence.] */ #include "des_locl.h" void des_pcbc_encrypt(input, output, length, schedule, ivec, encrypt) des_cblock (*input); des_cblock (*output); long length; des_key_schedule schedule; des_cblock (*ivec); int encrypt; { register DES_LONG sin0,sin1,xor0,xor1,tout0,tout1; DES_LONG tin[2]; unsigned char *in,*out,*iv; in=(unsigned char *)input; out=(unsigned char *)output; iv=(unsigned char *)ivec; if (encrypt) { c2l(iv,xor0); c2l(iv,xor1); for (; length>0; length-=8) { if (length >= 8) { c2l(in,sin0); c2l(in,sin1); } else c2ln(in,sin0,sin1,length); tin[0]=sin0^xor0; tin[1]=sin1^xor1; des_encrypt((DES_LONG *)tin,schedule,DES_ENCRYPT); tout0=tin[0]; tout1=tin[1]; xor0=sin0^tout0; xor1=sin1^tout1; l2c(tout0,out); l2c(tout1,out); } } else { c2l(iv,xor0); c2l(iv,xor1); for (; length>0; length-=8) { c2l(in,sin0); c2l(in,sin1); tin[0]=sin0; tin (…)
1 /* crypto/des/pcbc_enc.c */ local
/macosx-10.9.5/CommonCrypto-60049/test/CommonCrypto/
H A DCommonCryptoSymXTS.c36 byteBuffer key, tweak, iv;
52 iv = hexStringToBytes(ivStr);
59 if((retval = CCCryptorEncryptDataBlock(encCryptorRef, iv->bytes, pt->bytes, dataLen, dataOut)) == kCCSuccess) {
66 if((retval = CCCryptorDecryptDataBlock(encCryptorRef, iv->bytes, ct->bytes, dataLen, dataOut)) == kCCSuccess) {
83 free(iv);
92 char *iv;
103 iv = "72f3b054cbdc2f9e3c5bc551d44ddba0";
108 doXTSTestCase(caseNumber, direction, dataLen, iv, cipherText, plainText, combinedKey);
113 iv = "68882783652436c4857a88c0c373417e";
118 doXTSTestCase(caseNumber, direction, dataLen, iv, cipherTex
[all...]
H A DCommonCryptoSymCFB.c38 char *iv;
54 iv = "80000000000000000000000000000000";
56 retval = CCModeTestCase(keyStr, iv, mode, alg, padding, cipherText, plainText);
61 iv = "c0000000000000000000000000000000";
63 retval = CCModeTestCase(keyStr, iv, mode, alg, padding, cipherText, plainText);
68 iv = "ffffffffffffffffffffffc000000000";
70 retval = CCModeTestCase(keyStr, iv, mode, alg, padding, cipherText, plainText);
76 iv = "cf75d0cae8dbce85e0bc0e58eb4e82c0";
78 retval = CCModeTestCase(keyStr, iv, mode, alg, padding, cipherText, plainText);
84 iv
[all...]
H A DCommonCryptoSymGCM.c48 char *iv;
64 iv = "000000000000000000000000";
69 retval = CCCryptorGCMTestCase(keyStr, iv, adata, tag, alg, cipherText, plainText);
74 retval = CCCryptorGCMDiscreetTestCase(keyStr, iv, adata, tag, alg, cipherText, plainText);
83 iv = "000000000000000000000000";
88 retval = CCCryptorGCMTestCase(keyStr, iv, adata, tag, alg, cipherText, plainText);
91 retval = CCCryptorGCMDiscreetTestCase(keyStr, iv, adata, tag, alg, cipherText, plainText);
99 iv = "cafebabefacedbaddecaf888";
104 retval = CCCryptorGCMTestCase(keyStr, iv, adata, tag, alg, cipherText, plainText);
107 retval = CCCryptorGCMDiscreetTestCase(keyStr, iv, adat
[all...]
H A DCommonCryptoSymCBC.c44 char *iv;
53 iv = "0f0e0d0c0b0a09080706050403020100";
63 retval = CCCryptTestCase(keyStr, iv, alg, options, cipherText, plainText);
66 retval = CCMultiCryptTestCase(keyStr, iv, alg, options, cipherText, plainText);
73 retval = CCCryptTestCase(keyStr, iv, alg, options, cipherText, plainText);
76 retval = CCMultiCryptTestCase(keyStr, iv, alg, options, cipherText, plainText);
83 retval = CCCryptTestCase(keyStr, iv, alg, options, cipherText, plainText);
86 retval = CCMultiCryptTestCase(keyStr, iv, alg, options, cipherText, plainText);
93 retval = CCCryptTestCase(keyStr, iv, alg, options, cipherText, plainText);
96 retval = CCMultiCryptTestCase(keyStr, iv, al
[all...]
H A DCommonCryptoSymZeroLength.c18 char *iv;
28 iv = "0f0e0d0c0b0a09080706050403020100";
33 retval = CCCryptTestCase(keyStr, iv, kCCAlgorithmAES128, kCCOptionPKCS7Padding, cipherText, plainText);
41 retval = CCCryptTestCase(keyStr, iv, kCCAlgorithmAES128, kCCOptionPKCS7Padding, cipherText, plainText);
48 iv = NULL;
53 retval = CCCryptTestCase(keyStr, iv, kCCAlgorithmAES128, kCCOptionPKCS7Padding, cipherText, plainText);
61 retval = CCCryptTestCase(keyStr, iv, kCCAlgorithmAES128, kCCOptionPKCS7Padding, cipherText, plainText);
H A DCommonCryptoSymOFB.c38 char *iv;
47 iv = "0f0e0d0c0b0a09080706050403020100";
57 retval = CCModeTestCase(keyStr, iv, mode, alg, padding, cipherText, plainText);
64 retval = CCModeTestCase(keyStr, iv, mode, alg, padding, cipherText, plainText);
71 retval = CCModeTestCase(keyStr, iv, mode, alg, padding, cipherText, plainText);
77 iv = "80000000000000000000000000000000";
83 retval = CCModeTestCase(keyStr, iv, mode, alg, padding, cipherText, plainText);
89 iv = "fffc0000000000000000000000000000";
95 retval = CCModeTestCase(keyStr, iv, mode, alg, padding, cipherText, plainText);
H A DCommonCryptoSymRC2.c50 char *iv;
60 iv = NULL;
69 retval = CCCryptTestCase(keyStr, iv, alg, options, cipherText, plainText);
72 retval = CCMultiCryptTestCase(keyStr, iv, alg, options, cipherText, plainText);
81 retval = CCCryptTestCase(keyStr, iv, alg, options, cipherText, plainText);
84 retval = CCMultiCryptTestCase(keyStr, iv, alg, options, cipherText, plainText);
93 retval = CCCryptTestCase(keyStr, iv, alg, options, cipherText, plainText);
96 retval = CCMultiCryptTestCase(keyStr, iv, alg, options, cipherText, plainText);
106 retval = CCCryptTestCase(keyStr, iv, alg, options, cipherText, plainText);
109 retval = CCMultiCryptTestCase(keyStr, iv, al
[all...]
H A DCommonCryptoCTSPadding.c43 char *iv;
54 iv = "0f0e0d0c0b0a09080706050403020100";
65 retval = CCModeTestCase(keyStr, iv, mode, alg, padding, cipherText, plainText);
73 retval = CCModeTestCase(keyStr, iv, mode, alg, padding, cipherText, plainText);
81 retval = CCModeTestCase(keyStr, iv, mode, alg, padding, cipherText, plainText);
92 retval = CCModeTestCase(keyStr, iv, mode, alg, padding, cipherText, plainText);
100 retval = CCModeTestCase(keyStr, iv, mode, alg, padding, cipherText, plainText);
108 retval = CCModeTestCase(keyStr, iv, mode, alg, padding, cipherText, plainText);
118 retval = CCModeTestCase(keyStr, iv, mode, alg, padding, cipherText, plainText);
126 retval = CCModeTestCase(keyStr, iv, mod
[all...]
/macosx-10.9.5/Heimdal-323.92.1/lib/hcrypto/
H A Daes.c79 unsigned char *iv, int forward_encrypt)
87 tmp[i] = in[i] ^ iv[i];
89 memcpy(iv, out, AES_BLOCK_SIZE);
96 tmp[i] = in[i] ^ iv[i];
98 tmp[i] = iv[i];
100 memcpy(iv, out, AES_BLOCK_SIZE);
107 out[i] ^= iv[i];
108 memcpy(iv, tmp, AES_BLOCK_SIZE);
117 out[i] ^= iv[i];
118 memcpy(iv, tm
77 AES_cbc_encrypt(const unsigned char *in, unsigned char *out, unsigned long size, const AES_KEY *key, unsigned char *iv, int forward_encrypt) argument
124 AES_cfb8_encrypt(const unsigned char *in, unsigned char *out, unsigned long size, const AES_KEY *key, unsigned char *iv, int forward_encrypt) argument
[all...]
H A Dcamellia.c74 unsigned char *iv, int mode_encrypt)
82 tmp[i] = in[i] ^ iv[i];
84 memcpy(iv, out, CAMELLIA_BLOCK_SIZE);
91 tmp[i] = in[i] ^ iv[i];
93 tmp[i] = iv[i];
95 memcpy(iv, out, CAMELLIA_BLOCK_SIZE);
102 out[i] ^= iv[i];
103 memcpy(iv, tmp, CAMELLIA_BLOCK_SIZE);
112 out[i] ^= iv[i];
113 memcpy(iv, tm
72 CAMELLIA_cbc_encrypt(const unsigned char *in, unsigned char *out, unsigned long size, const CAMELLIA_KEY *key, unsigned char *iv, int mode_encrypt) argument
[all...]
/macosx-10.9.5/BerkeleyDB-21/db/perl/DB_File/
H A Dfallback.xs11 IV iv;
18 /* Change this to constant(aTHX_ s, len, &iv, &nv);
20 type = constant(aTHX_ s, len, &iv);
36 PUSHi(iv);
60 PUSHp(pv, iv);
75 PUSHu((UV)iv);
/macosx-10.9.5/OpenSSH-186/openssh/
H A Dcipher-3des1.c67 ssh1_3des_init(EVP_CIPHER_CTX *ctx, const u_char *key, const u_char *iv, argument
149 ssh1_3des_iv(EVP_CIPHER_CTX *evp, int doset, u_char *iv, int len) argument
154 fatal("%s: bad 3des iv length: %d", __func__, len);
159 memcpy(c->k1.iv, iv, 8);
160 memcpy(c->k2.iv, iv + 8, 8);
161 memcpy(c->k3.iv, iv + 16, 8);
164 memcpy(iv,
[all...]
/macosx-10.9.5/BerkeleyDB-21/db/perl/BerkeleyDB/
H A Dconstants.xs11 IV iv;
18 /* Change this to constant(aTHX_ s, len, &iv, &nv);
20 type = constant(aTHX_ s, len, &iv, &pv);
36 PUSHi(iv);
59 PUSHp(pv, iv);
74 PUSHu((UV)iv);
/macosx-10.9.5/ruby-104/ruby/test/openssl/
H A Dtest_cipher.rb29 @iv = "\0\0\0\0\0\0\0\0"
40 @c1.encrypt.pkcs5_keyivgen(@key, @iv)
41 @c2.encrypt.pkcs5_keyivgen(@key, @iv)
46 @c1.decrypt.pkcs5_keyivgen(@key, @iv)
47 @c2.decrypt.pkcs5_keyivgen(@key, @iv)
64 @c1.iv = @iv
74 @c1.iv = @iv
148 cipher, key, iv
[all...]
/macosx-10.9.5/Security-55471.14.18/include/security_keychain/
H A DSecPkcs8Templates.h72 CSSM_DATA iv; // 8 bytes member in struct:__anon3760
84 CSSM_DATA iv; // optional, default is all zeroes member in struct:__anon3761
/macosx-10.9.5/Security-55471.14.18/libsecurity_keychain/Security/
H A DSecPkcs8Templates.h72 CSSM_DATA iv; // 8 bytes member in struct:__anon4646
84 CSSM_DATA iv; // optional, default is all zeroes member in struct:__anon4647
/macosx-10.9.5/Security-55471.14.18/libsecurity_keychain/lib/
H A DSecPkcs8Templates.h72 CSSM_DATA iv; // 8 bytes member in struct:__anon4733
84 CSSM_DATA iv; // optional, default is all zeroes member in struct:__anon4734

Completed in 272 milliseconds

1234567891011