aboutsummaryrefslogtreecommitdiff
path: root/src/lib/crypto/builtin
AgeCommit message (Collapse)AuthorFilesLines
2009-12-10Restructure the crypto checksum implementation to minimizeGreg Hudson6-33/+119
dependencies on the internals of modules. * Keyhash providers are gone. * The cksumtypes table contains checksum and verify functions, similar to the etypes encrypt and decrypt functions. New checksum functions parallel the old keyhash providers, and there are also functions for unkeyed and derived-key HMAC checksums. * The flags field is now used to indicate whether a checksum is unkeyed, but not whether it is a derived-key HMAC checksum. * The descbc checksum is handled through a new enc_provider function which calculates a CBC MAC. The OpenSSL module does not implement the CBC MAC function (it didn't implement descbc before). builtin/des could probably get rid of f_cksum.c (the old DES CBC routine) with some alterations to string2key.c. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23462 dc483132-0cff-0310-8789-dd5450dbe970
2009-12-06Initialize ihash_iov in case fall through to cleanup handler and tryEzra Peisach1-1/+1
to free garbarge. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23453 dc483132-0cff-0310-8789-dd5450dbe970
2009-12-06Make dependGreg Hudson1-26/+32
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23451 dc483132-0cff-0310-8789-dd5450dbe970
2009-12-06Make the libk5crypto hash_provider interface take crypto_iov listsGreg Hudson7-161/+113
instead of lists of krb5_data. Make the base HMAC APIs take crypto_iov lists and drop the _iov variants. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23450 dc483132-0cff-0310-8789-dd5450dbe970
2009-12-06In the built-in des3 provider, remove the unused version ofGreg Hudson1-29/+3
validate_and_schedule, and drop the _iov suffix from the one we do use. (Cleanup from r23444.) git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23449 dc483132-0cff-0310-8789-dd5450dbe970
2009-12-04Consolidate the IOV and non-IOV encryption/decryption code paths, andGreg Hudson17-906/+213
drop the _iov suffix from most encryption- and decryption-related functions. The enc_provider encrypt and decrypt functions take IOVs, as do the enctype entries in etypes.c, and there are no separate encrypt_iov or decrypt_iov functions. aead_provider is gone. Enctype functions now take pointers to the enctype entry instead of pointers to the enc/hash/aead providers; this allows dk_encrypt and dk_decrypt to be polymorphic in the length function they use now that AES and DES3 can't differentiate by aead provider. aes_string_to_key needed to be moved into the krb/ fold for this since it's an enctype function; it was duplicated between builtin/ and openssl/ before. This leaves openssl/aes empty; the build system currently demands that all modules have the same directory structure, so the directory and Makefile will stick around for now. Three separate copies of the derive_random logic are also now consolidated into one. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23444 dc483132-0cff-0310-8789-dd5450dbe970
2009-12-03Revert r23442. Revert r23436 changes unrelated to comment reformattingTom Yu1-12/+139
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23443 dc483132-0cff-0310-8789-dd5450dbe970
2009-12-02Reformat new block comment per coding styleGreg Hudson1-152/+26
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23436 dc483132-0cff-0310-8789-dd5450dbe970
2009-12-02Perform the AES-CBC XOR operations 4 bytes at a time, using the helperKen Raeburn1-2/+18
functions for loading and storing potentially-unaligned values. Improves bulk AES encryption performance by 2% or so on 32-bit x86 with gcc 4. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23432 dc483132-0cff-0310-8789-dd5450dbe970
2009-12-02Speed up the per-block loops of AES, DES3, and DES IOV encryption byGreg Hudson3-196/+111
avoiding function calls and copies in the case where the next block is wholly contained within the current buffer. To do this, introduce two new inline functions in aead.h called iov_next_block and iov_store_block. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23430 dc483132-0cff-0310-8789-dd5450dbe970
2009-12-02Clean up the AES enc_provider code a bit. Chiefly, work with unsignedGreg Hudson1-80/+64
char blocks, casting input->data and output->data once each upon entry to the non-IOV encrypt and decrypt functions, rather than casting our working buffers each time we need to work with an outside function. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23428 dc483132-0cff-0310-8789-dd5450dbe970
2009-11-30Fix ivec chaining for DES iov encryptionGreg Hudson1-2/+5
krb5int_des_cbc_decrypt_iov was using a plaintext block to update the ivec. Fix it to use the last cipher block, borrowing from the corresponding des3 function. The impact of this bug is not serious since ivec chaining is not typically used with IOV encryption in 1.7. ticket: 6588 tags: pullup target_version: 1.7.1 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23389 dc483132-0cff-0310-8789-dd5450dbe970
2009-11-30In the des enc_provider decrypt_iov function, count header blocks asGreg Hudson1-1/+1
well as data and padding blocks when checking for correctly padded input. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23387 dc483132-0cff-0310-8789-dd5450dbe970
2009-11-30Make the crc32 hash provider correctly chain multiple input buffers,Greg Hudson1-5/+3
so that it returns the same result if you pass it one big buffer or many small buffers containing the same data. To do this, change the contract of mit_crc32 so that the cksum parameter is in-out. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23386 dc483132-0cff-0310-8789-dd5450dbe970
2009-11-29Add do-while(0) around multi-statement macros in f_tables.h for moreGreg Hudson1-44/+48
consistent and elegant emacs auto-formatting. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23379 dc483132-0cff-0310-8789-dd5450dbe970
2009-11-28Mark and reindent lib/cryptoGreg Hudson42-3883/+3904
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23374 dc483132-0cff-0310-8789-dd5450dbe970
2009-11-27Move the arcfour directory from the crypto module dirs into krb. ThisGreg Hudson10-899/+15
directory contains the token encryption code (similar to dk, old, and raw) which is Kerberos-specific. The actual stream cipher lives in enc_provider/rc4.c, which is still in the module dirs. arcfour/arcfour-int.h contained the definitions of some structures used only in enc_provider/rc4.c. Move those definitions into that source file so that everything in arcfour is at the right level of abstraction to live in krb. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23367 dc483132-0cff-0310-8789-dd5450dbe970
2009-11-22Consolidate Makefile variables now that we have only a single globalGreg Hudson18-267/+250
configure script: $(SRCTOP) --> $(top_srcdir) $(srcdir)/$(thisconfigdir) --> $(top_srcdir) $(thisconfigdir) --> $(BUILDTOP) $(myfulldir) --> $(mydir) ticket: 6583 status: open git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23308 dc483132-0cff-0310-8789-dd5450dbe970
2009-11-02Clean up a bunch of signed/unsigned comparison warningsGreg Hudson1-1/+1
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23120 dc483132-0cff-0310-8789-dd5450dbe970
2009-10-31make mark-cstyleTom Yu42-434/+426
make reindent git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23100 dc483132-0cff-0310-8789-dd5450dbe970
2009-10-28Replace krb5_ with krb5Int_ prefix for non-API functionsZhanna Tsitkov13-45/+46
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23079 dc483132-0cff-0310-8789-dd5450dbe970
2009-10-28Remove "verify" on make cleanEzra Peisach1-1/+1
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23076 dc483132-0cff-0310-8789-dd5450dbe970
2009-10-27Do not include com_err.h - not used hereEzra Peisach1-2/+0
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23060 dc483132-0cff-0310-8789-dd5450dbe970
2009-10-25make dependTom Yu9-75/+58
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23030 dc483132-0cff-0310-8789-dd5450dbe970
2009-10-24Resurrect deleted test files. Adjust Makefile.in files to correctlyTom Yu4-0/+729
define RUN_SETUP. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23029 dc483132-0cff-0310-8789-dd5450dbe970
2009-10-23Changed the crypto make system to add build flexibility. The update cancels ↵Zhanna Tsitkov24-201/+917
the requirement for the dir structures to be identical in all crypto implementation and supports impl. dependent tests. Also, minor libk5crypto.exports list reduction ( from f_tables) git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22995 dc483132-0cff-0310-8789-dd5450dbe970
2009-10-20Fix memory leaks in enc-perf workGreg Hudson1-0/+1
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22949 dc483132-0cff-0310-8789-dd5450dbe970
2009-10-19Implement new APIs to allow improved crypto performanceGreg Hudson10-165/+228
Merge branches/enc-perf to trunk. Adds the krb5_key opaque type, the krb5_k_* APIs to use them, and caching of derived keys when krb5_k_* functions are used. Updates the krb5 auth context and GSS id-rec to use krb5_keys. ticket: 6576 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22944 dc483132-0cff-0310-8789-dd5450dbe970
2009-10-16Fix the value of ivec in aes_decrypt_iovZhanna Tsitkov1-3/+3
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22905 dc483132-0cff-0310-8789-dd5450dbe970
2009-10-10Move destest to builtin/des, because it depends on overriding someTom Yu12-119/+577
internals. Make depend. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22877 dc483132-0cff-0310-8789-dd5450dbe970
2009-10-09Get aes-gen to build again (for the default back end, at least)Greg Hudson1-1/+1
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22873 dc483132-0cff-0310-8789-dd5450dbe970
2009-10-06Fix object file pathZhanna Tsitkov1-5/+5
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22856 dc483132-0cff-0310-8789-dd5450dbe970
2009-10-01CleanupZhanna Tsitkov1-7/+17
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22819 dc483132-0cff-0310-8789-dd5450dbe970
2009-09-30Crypto modularity proj: SHS_INFO structure is defined differently for crypto ↵Zhanna Tsitkov10-3/+384
impl's. Files hash_sha1.c and yhash.h are affected by this difference. Move hash_provider into the backend The following bigredbutton is used to suppress svn complains about the trailing spaces in the moved/copied dirs. bigredbutton: whitespace git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22815 dc483132-0cff-0310-8789-dd5450dbe970
2009-09-29Fix include path to pick up the correct headersZhanna Tsitkov1-1/+1
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22814 dc483132-0cff-0310-8789-dd5450dbe970
2009-09-29Remove OBJS.ST from SUBDIROBJLISTS so that running make does notEzra Peisach1-1/+1
rebuild shared library when running make from the top. (make otherwise thinks that OBJS.ST depends on "all-recurse" - which does not exist, and rebuilds it all the time. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22806 dc483132-0cff-0310-8789-dd5450dbe970
2009-09-16Re-run make depend without autoconf.h in the source treeGreg Hudson8-209/+199
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22775 dc483132-0cff-0310-8789-dd5450dbe970
2009-09-16Crypto modularity proj.: Move prf and random-to-key ops from backend to krbZhanna Tsitkov19-378/+237
bigredbutton: whitespace git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22769 dc483132-0cff-0310-8789-dd5450dbe970
2009-09-03Crypto modularity proj: OpemSSL crypto feed for ↵Zhanna Tsitkov1-9/+11
hmac/md5/md4/sha1/rc4/des/des3(w/o iov) bigredbutton: whitespace git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22709 dc483132-0cff-0310-8789-dd5450dbe970
2009-09-02Crypto modularity proj: Move enc_provider into builtin dir. Adjust builtin ↵Zhanna Tsitkov13-81/+1318
make system to handle new crypto implementations git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22707 dc483132-0cff-0310-8789-dd5450dbe970
2009-08-03Re-run make depend. (I am not certain why the dependencies fromGreg Hudson7-173/+159
r22477 didn't work for me.) git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22482 dc483132-0cff-0310-8789-dd5450dbe970
2009-08-03Crypto modularity proj: Separate files under crypto directory based on their ↵Zhanna Tsitkov63-0/+11030
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