summaryrefslogtreecommitdiffstats
path: root/src/lib/crypto/des/f_cbc.c
Commit message (Collapse)AuthorAgeFilesLines
* Crypto modularity proj: Separate files under crypto directory based on their ↵Zhanna Tsitkov2009-08-031-274/+0
| | | | | | | | functionality. Move Kerberos specific files into krb subdir and MIT specific - into builtin subdir. Place all tests into crypto_tests subfolder. bigredbutton: whitespace git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22477 dc483132-0cff-0310-8789-dd5450dbe970
* If CONFIG_SMALL_NO_CRYPTO is defined, turn off CONFIG_SMALL changes for ↵Ken Raeburn2008-08-121-1/+1
| | | | | | crypto code only git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20648 dc483132-0cff-0310-8789-dd5450dbe970
* Update copyright notices to reflect donation of DES implementation byTom Yu2008-08-121-5/+24
| | | | | | | | Dennis Ferguson. ticket: 6070 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20642 dc483132-0cff-0310-8789-dd5450dbe970
* Allow compile-time specification that small code space is desiredKen Raeburn2005-04-131-10/+23
| | | | | | | | | | | | | | | | | | | | | * d3_cbc.c (krb5int_des3_cbc_encrypt, krb5int_des3_cbc_decrypt): Don't declare left and right variables as registers. * f_cksum.c (mit_des_cbc_cksum): Likewise. * f_cbc.c (krb5int_des_cbc_encrypt, krb5int_des_cbc_decrypt): Likewise. (krb5int_des_cbc_encrypt): For full blocks, use GET_HALF_BLOCK to read and then xor, instead of processing each byte individually. (krb5int_des_do_encrypt_2, krb5int_des_do_decrypt_2) [CONFIG_SMALL]: New functions, wrapping large macros with the DES inner loops. * f_tables.h (DES_DO_ENCRYPT_1, DES_DO_DECRYPT_1): Renamed from non-_1 names. (krb5int_des_do_encrypt_2, krb5int_des_do_decrypt_2): Declare if CONFIG_SMALL is defined. (DES_DO_ENCRYPT, DES_DO_DECRYPT): Expand to _1 macros or _2 function calls depending on whether CONFIG_SMALL is defined. With CONFIG_SMALL defined, on x86/gcc/glibc, this drops about 5K (25%) of the code/table space. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17183 dc483132-0cff-0310-8789-dd5450dbe970
* protoizeKen Raeburn2004-02-191-7/+3
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16102 dc483132-0cff-0310-8789-dd5450dbe970
* * f_tables.h (DES_DO_ENCRYPT, DES_DO_DECRYPT): Allocate temporary variableKen Raeburn2004-02-171-4/+2
| | | | | | | | | | | locally instead of taking the extra argument. * d3_cbc.c (krb5int_des3_cbc_encrypt): Don't pass the extra argument, and delete the automatic variable. (krb5int_des3_cbc_decrypt): Likewise. * f_cbc.c (krb5int_des_cbc_encrypt, krb5int_des_cbc_decrypt): Likewise. * f_cksum.c (mit_des_cbc_cksum): Likewise. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16095 dc483132-0cff-0310-8789-dd5450dbe970
* Replace the array of 8 mit_des_cblock object 'mit_des_zeroblock' definedKen Raeburn2003-12-201-0/+2
| | | | | | | locally in multiple files with one defined in f_cbc.c; make it a single element rather than an array. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@15945 dc483132-0cff-0310-8789-dd5450dbe970
* * f_cbc.c (krb5int_des_cbc_decrypt): Move declarations that were afterKen Raeburn2003-07-221-2/+2
| | | | | | | statements after flattening blocks is previous change. * d3_cbc.c (krb5int_des3_cbc_decrypt): Likewise. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@15706 dc483132-0cff-0310-8789-dd5450dbe970
* Separate the DES encrypt and decrypt operations into separate functions,Ken Raeburn2003-07-171-133/+160
| | | | | | | | | | | | | | | | since they have almost no code in common. * f_cbc.c (krb5int_des_cbc_encrypt, krb5int_des_cbc_decrypt): New functions broken out from mit_des_cbc_encrypt. (mit_des_cbc_encrypt): Call them. * d3_cbc.c (krb5int_des3_cbc_encrypt, krb5int_des3_cbc_decrypt): New functions broken out from mit_des3_cbc_encrypt. (mit_des3_cbc_encrypt): Call them. * des_int.h (krb5int_des_cbc_encrypt, krb5int_des_cbc_decrypt, krb5int_des3_cbc_encrypt, krb5int_des3_cbc_decrypt): Declare. (mit_des_cbc_encrypt, mit_des3_cbc_encrypt): New macros. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@15692 dc483132-0cff-0310-8789-dd5450dbe970
* Danilo also says we can get rid of _MSDOS (Win16) tests, and explicit ↵Ken Raeburn2001-10-061-2/+2
| | | | | | FAR/NEAR specs git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13786 dc483132-0cff-0310-8789-dd5450dbe970
* * f_cbc.c (mit_des_cbc_encrypt): Do not use a variable named "encrypt".Ezra Peisach2001-05-311-3/+3
| | | | | | * d3_cbc.c (mit_des3_cbc_encrypt): Likewise. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13251 dc483132-0cff-0310-8789-dd5450dbe970
* more cleanup - add const, reduce castingKen Raeburn2001-04-101-6/+6
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13169 dc483132-0cff-0310-8789-dd5450dbe970
* use const for some inputs (when practical) without changing apiKen Raeburn2001-04-101-7/+8
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13164 dc483132-0cff-0310-8789-dd5450dbe970
* * des_int.h: Change prototypes for mit_des_cbc_encrypt(),Ezra Peisach2000-10-171-1/+1
| | | | | | | | | | | | | | | | | | | | mit_des_cbc_cksum(), and mit_des3_cbc_encrypt() to take unsigned long lengths. * d3_cbc.c (mit_des3_cbc_encrypt): Length argument now takes an unsigned long. * f_cbc.c (mit_des_cbc_encrypt): Length argument now takes an unsigned long. * f_cksum.c (mit_des_cbc_cksum): Length argument now takes an unsigned long. * string2key.c: Unsigned/signed int cleanup. Test for a salt-length of SALT_TYPE_AFS_LENGTH or -1 (for backwards compatibilty) for use of mit_afs_string_to_key(). git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@12774 dc483132-0cff-0310-8789-dd5450dbe970
* * d3_cbc.c, des.h, des_int.h, f_cbc.c, f_cksum.c, f_ecb.c,Tom Yu1997-10-271-7/+6
| | | | | | | | | | | f_pcbc.c, f_sched.c, f_tables.c, f_tables.h: Change KRB_INT32 to DES_INT32 to avoid temptation to misuse. * d3_cbc.c, d3_ecb.c, f_cbc.c, f_cksum.c, f_ecb.c, f_parity.c, f_pcbc.c, f_sched.c, f_tables.c: Don't include des.h; it's broken in ways. Use only des_int.h instead. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@10252 dc483132-0cff-0310-8789-dd5450dbe970
* * f_cksum.c: Change code to match prototypesEzra Peisach1995-08-261-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * f_cbc.c, f_ecb, f_parity, f_pcbc: Change des_cblock to mit_des_cblock and des_key_schedule to mit_des_key_schedule. Also include des_int.h. * destest.c: Change des_cblock to mit_des_cblock and add local prototypes. * cs_entry.c: Remove prototypes for mit_des_cbc_cksum and mit_des_cbc_cksum. Now in des_int.h. * cbc_cksum.c, string2key.c: Remove casts in call to mit_des_cbc_cksum * des_int.h: Add prototype for mit_des_cbc_verf_cksum. Change return code for mit_des_cbc_cksum to match source. * des.h: Remove unused structures and defines. Short end - fix des_int.h to reflect reality (i.e. source code) and then fix rest of code to agree. Also removed the use of old structures such as des_cblock and des_key_schedule. Instead the the newer mit_des_cblock and mit_des_schedule are used. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@6598 dc483132-0cff-0310-8789-dd5450dbe970
* Windows global stuff:Keith Vetter1995-04-141-1/+1
| | | | | | | | | o removed INTERFACE from non-api functions o add FAR to pointers visible to the world o made the tests for __STDC__ also check for _WINDOWS o creates GSSAPI.DLL & GSSAPI.LIB as per spec. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@5354 dc483132-0cff-0310-8789-dd5450dbe970
* Bring in portability fixes from Cygnus K4 releaseJohn Gilmore1995-03-281-15/+15
| | | | | | | | | | | | | * f_cbc.c, f_cksum.c, f_pcbc.c: Replace individual casts with simpler solution. * f_tables.h: Insert debugging code, and circumvention for MPW compiler bug. * key_sched.c: Remove ancient (microvax??!) comments, and dup prototype. * verify.c: Small hack for MS-Windows scrolling. Fix spelling. "register x" -> "register int x". git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@5288 dc483132-0cff-0310-8789-dd5450dbe970
* Two changes in the crypto directory: 1) 16 vs 32 bit errors in DES and 2)Keith Vetter1995-03-151-15/+15
| | | | | | removed crud for making a DLL (will be done at a higher level.) git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@5123 dc483132-0cff-0310-8789-dd5450dbe970
* Added the files and changes needed to create a dll out of libcryptoKeith Vetter1995-03-031-8/+8
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@5068 dc483132-0cff-0310-8789-dd5450dbe970
* Made the CRYPTO directories work on the PC by adding INTERFACE to all theKeith Vetter1995-02-211-1/+1
| | | | | | functions and prototypes, and updating the Makefile.in. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@4956 dc483132-0cff-0310-8789-dd5450dbe970
* Remove declarations of the cryptosystem specific structures toTheodore Tso1994-10-141-1/+1
| | | | | | | raw-des.c and des-crc.c in the parent directory. They're strictly speaking not DES specific. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@4506 dc483132-0cff-0310-8789-dd5450dbe970
* Removed MIT DES implementation; only use Fergeson DESTheodore Tso1994-09-301-0/+20
| | | | | | | | | Fix destest and verify so that they work with the new DES libraries. "make check" will run the DES test suite. (Note that all of the krb5 libraries have to be built, since they depend on them.) git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@4393 dc483132-0cff-0310-8789-dd5450dbe970
* add ferguson des code, to simplify autoconfMark Eichin1994-06-101-0/+198
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@3693 dc483132-0cff-0310-8789-dd5450dbe970