Add Solaris crypto API calls to SPL layer, translating into Linux
crypto API. This code was not easy to work out, Linux crypto API
lacks any documentation.

However, there appears to be a "maximum length" limitation with
Linux scatterlist. It is better to use recordsize=512 when creating
encrypted filesystems for now.

Possibly large crypt calls need to be split up into more scatterlist
entries.

Code currently does not use ASYNC calls, as original ZFS appears not to.

'iv' is computed the same as Open Solaris sources.

The ctx_template functions should probably be used to acquire the tfm
instead of calling crypto_alloc_aead() each and every time.

Note this code is littered with debug prints.
Merge pull request #1 from lundman/master

SPL add crypto functions
Merge branch 'master' of git://github.com/zfsonlinux/spl
scatterwalk() will cause panic when using multiple output buffers, so
now we allocate a new linear memory for output, then call
sg_copy_from_buffer() to copy back to scatterlist. Note that using
scatterwalk_map_and_copy() instead will cause panic.

This fixes the recordsize=512 limit, all recordsizes work.

Fixed crypto_map_buffers() which took static 2 buffers to be dynamic. It
turns out ZFS will chain events, and was using over 28 on my tests.

ZFS-crypto can now do a simple bonnie run without crashing.

Created MACRO to crypto debug messages. Default is off. Removed old
cipher code, but left 3 alternate calls. AEAD (default), blkcipher, and
memcopy.

TODO: Solve the panic which scatterlists to remove the need to allocate
      dst temporary buffer.
Merge pull request #2 from lundman/master

Fix scatterlists temporarily with tmp buffer
Add a new cipher module "sun-ccm" which is an identical copy of
ccm + ctr + blkcipher, just to avoid a bug in blkcipher.

It allows us to skip the heavy block-copy.
Merge pull request #4 from lundman/master

Add new cipher module to fix copyblock problem.
Missing Makefile, sorry.
The scatterwalk_map and unmap API has changed parameters so
adding them to the module.
Merge branch 'master' of github.com:lundman/spl-crypto
Merge pull request #5 from lundman/master

Linux 3.2 has different number parameters to scatterwalk_map and unmap
spl-crypto rework.

Split sun-ctr out of sun-ccm to make own module,
Added sun-gcm cipher method (also uses sun-ctr).
Made ciphers to be configurable from commandline, and pick right cipher when
used.
Added testing (ensuring cipher exists) on creation, so it can fail cleanly
when sun-ccm module has not been loaded.
Added crypto_mac function, even though it has yet to be called.
Ensured keylen commandline changes work.
spl-crypto rework.

Split sun-ctr out of sun-ccm to make own module,
Added sun-gcm cipher method (also uses sun-ctr).
Made ciphers to be configurable from commandline, and pick right cipher when
used.
Added testing (ensuring cipher exists) on creation, so it can fail cleanly
when sun-ccm module has not been loaded.
Added crypto_mac function, even though it has yet to be called.
Ensured keylen commandline changes work.
Merge branch 'master' of github.com:lundman/spl-crypto

Conflicts:
	module/sun-ctr/ctr.c
Merge pull request #6 from lundman/master

 spl-crypto rework.
crypto_decrypt should return CRYPTO_INVALID_MAC when auth fails, so that
mount can fail cleanly.
Merge pull request #7 from lundman/master

crypto_decrypt should return CRYPTO_INVALID_MAC
Change so that the type of cipher used, aead or blk, is picked on the fly
as ZVOL needs blkciphers.
Merge pull request #8 from lundman/master

Pick ciphers dynamically.
Merge branch 'master' of git://github.com/zfsonlinux/spl