16 Jul, 2008
2 commits
-
* git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
Revert crypto: prng - Deterministic CPRNG
15 Jul, 2008
1 commit
-
This patch is clearly not ready yet for prime time.
Signed-off-by: Herbert Xu
11 Jul, 2008
1 commit
-
Conflicts:
include/linux/rculist.h
kernel/rcupreempt.cSigned-off-by: Ingo Molnar
10 Jul, 2008
30 commits
-
All new crypto interfaces should go into individual files as much
as possible in order to ensure that crypto.h does not collapse under
its own weight.This patch moves the ahash code into crypto/hash.h and crypto/internal/hash.h
respectively.Signed-off-by: Herbert Xu
-
This patch reimplements crc32c using the ahash interface. This
allows one tfm to be used by an unlimited number of users provided
that they all use the same key (which all current crc32c users do).Signed-off-by: Herbert Xu
-
This patch adds the walking helpers for hash algorithms akin to
those of block ciphers. This is a necessary step before we can
reimplement existing hash algorithms using the new ahash interface.Signed-off-by: Herbert Xu
-
This patch adds a cryptographic pseudo-random number generator
based on CTR(AES-128). It is meant to be used in cases where a
deterministic CPRNG is required.One of the first applications will be as an input in the IPsec IV
generation process.Signed-off-by: Neil Horman
Signed-off-by: Herbert Xu -
The base field in ahash_tfm appears to have been cut-n-pasted from
ablkcipher. It isn't needed here at all. Similarly, the info field
in ahash_request also appears to have originated from its cipher
counter-part and is vestigial.Signed-off-by: Herbert Xu
-
The digest size check on hash algorithms is incorrect. It's
perfectly valid for hash algorithms to have a digest length
longer than their block size. For example crc32c has a block
size of 1 and a digest size of 4. Rather than having it lie
about its block size, this patch fixes the checks to do what
they really should which is to bound the digest size so that
code placing the digest on the stack continue to work.HMAC however still needs to check this as it's only defined
for such algorithms.Signed-off-by: Herbert Xu
-
Similar to the rmd128.c annotations, significantly cuts down on the
noise.Signed-off-by: Harvey Harrison
Signed-off-by: Herbert Xu -
Signed-off-by: Harvey Harrison
Signed-off-by: Herbert Xu -
Remove the private implementation of 32-bit rotation and unaligned
access with byteswapping.As a bonus, fixes sparse warnings:
crypto/camellia.c:602:2: warning: cast to restricted __be32
crypto/camellia.c:603:2: warning: cast to restricted __be32
crypto/camellia.c:604:2: warning: cast to restricted __be32
crypto/camellia.c:605:2: warning: cast to restricted __be32
crypto/camellia.c:710:2: warning: cast to restricted __be32
crypto/camellia.c:711:2: warning: cast to restricted __be32
crypto/camellia.c:712:2: warning: cast to restricted __be32
crypto/camellia.c:713:2: warning: cast to restricted __be32
crypto/camellia.c:714:2: warning: cast to restricted __be32
crypto/camellia.c:715:2: warning: cast to restricted __be32
crypto/camellia.c:716:2: warning: cast to restricted __be32
crypto/camellia.c:717:2: warning: cast to restricted __be32Signed-off-by: Harvey Harrison
Signed-off-by: Herbert Xu -
Noticed by Neil Horman: we are doing unnecessary kmap/kunmap calls
on kmalloced memory. This patch removes them. For the purposes of
testing SG construction, the underlying crypto code already does plenty
of kmap/kunmap calls anyway.Signed-off-by: Herbert Xu
-
Patch to add checking of DES3 test vectors using CBC mode. FIPS-140-2
compliance mandates that any supported mode of operation must include a self
test. This satisfies that requirement for cbc(des3_ede). The included test
vector was generated by me using openssl. Key/IV was generated with the
following command:openssl enc -des_ede_cbc -P
input and output values were generated by repeating the string "Too many
secrets" a few times over, truncating it to 128 bytes, and encrypting it with
openssl using the aformentioned key. Tested successfully by myselfSigned-off-by: Neil Horman
Acked-by: Adrian-Ken Rueegsegger
Signed-off-by: Herbert Xu -
This patch converts the relevant code in the rmd implementations to
use the pointer form of the endian swapping operations. This allows
certain architectures to generate more optimised code. For example,
on sparc64 this more than halves the CPU cycles on a typical hashing
operation.Based on a patch by David Miller.
Signed-off-by: Herbert Xu
-
This patch fixes endian issues making rmd320 work
properly on big-endian machines.Signed-off-by: Adrian-Ken Rueegsegger
Acked-by: Sebastian Siewior
Signed-off-by: Herbert Xu -
This patch fixes endian issues making rmd256 work
properly on big-endian machines.Signed-off-by: Adrian-Ken Rueegsegger
Acked-by: Sebastian Siewior
Signed-off-by: Herbert Xu -
This patch fixes endian issues making rmd160 work
properly on big-endian machines.Signed-off-by: Adrian-Ken Rueegsegger
Acked-by: Sebastian Siewior
Signed-off-by: Herbert Xu -
This patch is based on Sebastian Siewior's patch and
fixes endian issues making rmd128 work properly on
big-endian machines.Signed-off-by: Adrian-Ken Rueegsegger
Acked-by: Sebastian Siewior
Signed-off-by: Herbert Xu -
This patch changes tcrypt to use the new asynchronous hash interface
for testing hash algorithm correctness. The speed tests will continue
to use the existing interface for now.Signed-off-by: Loc Ho
Signed-off-by: Herbert Xu -
This patch adds asynchronous hash support to crypto daemon.
Signed-off-by: Loc Ho
Signed-off-by: Herbert Xu -
This patch adds asynchronous hash and digest support.
Signed-off-by: Loc Ho
Signed-off-by: Herbert Xu -
This patch adds Kconfig entries for RIPEMD-256 and RIPEMD-320.
Signed-off-by: Adrian-Ken Rueegsegger
Signed-off-by: Herbert Xu -
This patch adds test vectors for RIPEMD-256 and
RIPEMD-320 hash algorithms.The test vectors are taken from
Signed-off-by: Adrian-Ken Rueegsegger
Signed-off-by: Herbert Xu -
This patch adds support for the extended RIPEMD hash
algorithms RIPEMD-256 and RIPEMD-320.Signed-off-by: Adrian-Ken Rueegsegger
Signed-off-by: Herbert Xu -
This patch puts all common RIPEMD values in the
appropriate header file. Initial values and constants
are the same for all variants of RIPEMD.Signed-off-by: Adrian-Ken Rueegsegger
Signed-off-by: Herbert Xu -
Check whether the destination buffer is written to beyond the last
byte contained in the scatterlist.Also change IDX1 of the cross-page access offsets to a multiple of 4.
This triggers a corruption in the HIFN driver and doesn't seem to
negatively impact other testcases.Signed-off-by: Patrick McHardy
Signed-off-by: Herbert Xu -
Change logs should be kept in source control systems, not the source.
This patch removes the change log from tcrpyt to stop people from
extending it any more.Signed-off-by: Herbert Xu
-
This patch adds Kconfig entries for RIPEMD-128 and RIPEMD-160.
Signed-off-by: Adrian-Ken Rueegsegger
Signed-off-by: Herbert Xu -
This patch adds test vectors for RIPEMD-128 and
RIPEMD-160 hash algorithms and digests (HMAC).The test vectors are taken from ISO:IEC 10118-3 (2004)
and RFC2286.Signed-off-by: Adrian-Ken Rueegsegger
Signed-off-by: Herbert Xu -
This patch adds support for RIPEMD-128 and RIPEMD-160
hash algorithms.Signed-off-by: Adrian-Ken Rueegsegger
Signed-off-by: Herbert Xu -
The EINPROGRESS notifications should be done just like the final
call-backs, i.e., with BH off. This patch fixes the call in cryptd
since previously it was called with BH on.Signed-off-by: Herbert Xu
-
When chainiv postpones requests it never calls their completion functions.
This causes symptoms such as memory leaks when IPsec is in use.Signed-off-by: Herbert Xu
08 Jul, 2008
1 commit
-
Coverity CID: 2306 & 2307 RESOURCE_LEAK
In the second for loop in test_cipher(), data is allocated space with
kzalloc() and is only ever freed in an error case.
Looking at this loop, data is written to this memory but nothing seems
to read from it.
So here is a patch removing the allocation, I think this is the right
fix.Only compile tested.
Signed-off-by: Darren Jenkins
Signed-off-by: Herbert Xu
16 Jun, 2008
1 commit
02 Jun, 2008
1 commit
-
Steps to reproduce:
modprobe tcrypt # with CONFIG_DEBUG_SG=y
testing cts(cbc(aes)) encryption
test 1 (128 bit key):
------------[ cut here ]------------
kernel BUG at include/linux/scatterlist.h:65!
invalid opcode: 0000 [1] PREEMPT SMP DEBUG_PAGEALLOC
CPU 0
Modules linked in: tea xts twofish twofish_common tcrypt(+) [maaaany]
Pid: 16151, comm: modprobe Not tainted 2.6.26-rc4-fat #7
RIP: 0010:[] [] :cts:cts_cbc_encrypt+0x151/0x355
RSP: 0018:ffff81016f497a88 EFLAGS: 00010286
RAX: ffffe20009535d58 RBX: ffff81016f497af0 RCX: 0000000087654321
RDX: ffff8100010d4f28 RSI: ffff81016f497ee8 RDI: ffff81016f497ac0
RBP: ffff81016f497c38 R08: 0000000000000000 R09: 0000000000000011
R10: ffffffff00000008 R11: ffff8100010d4f28 R12: ffff81016f497ac0
R13: ffff81016f497b30 R14: 0000000000000010 R15: 0000000000000010
FS: 00007fac6fa276f0(0000) GS:ffffffff8060e000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
CR2: 00007f12ca7cc000 CR3: 000000016f441000 CR4: 00000000000026e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff4ff0 DR7: 0000000000000400
Process modprobe (pid: 16151, threadinfo ffff81016f496000, task ffff8101755b4ae0)
Stack: 0000000000000001 ffff81016f496000 ffffffff80719f78 0000000000000001
0000000000000001 ffffffff8020c87c ffff81016f99c918 20646c756f772049
65687420656b696c 0000000000000020 0000000000000000 0000000033341102
Call Trace:
[] ? restore_args+0x0/0x30
[] ? :aes_generic:crypto_aes_expand_key+0x311/0x369
[] ? check_object+0x15a/0x213
[] ? init_object+0x6e/0x76
[] ? __slab_free+0xfc/0x371
[] :cts:crypto_cts_encrypt+0xbb/0xca
[] ? :crypto_blkcipher:setkey+0xc7/0xec
[] :crypto_blkcipher:async_encrypt+0x38/0x3a
[] :tcrypt:test_cipher+0x261/0x7c6
[] :tcrypt:tcrypt_mod_init+0x9df/0x1b30
[] sys_init_module+0x9e/0x1b2
[] system_call_after_swapgs+0x8a/0x8f
Code: 45 c0 e8 aa 24 63 df 48 c1 e8 0c 48 b9 00 00 00 00 00 e2 ff ff 48 8b 55 88 48 6b c0 68 48 01 c8 b9 21 43 65 87 48 39 4d 80 74 04 0b eb fe f6 c2 01 74 04 0f 0b eb fe 83 e2 03 4c 89 ef 44 89
RIP [] :cts:cts_cbc_encrypt+0x151/0x355
RSP
---[ end trace e8bahiarjand37fd ]---Signed-off-by: Alexey Dobriyan
Signed-off-by: Herbert Xu
19 May, 2008
1 commit
-
Move rcu-protected lists from list.h into a new header file rculist.h.
This is done because list are a very used primitive structure all over the
kernel and it's currently impossible to include other header files in this
list.h without creating some circular dependencies.For example, list.h implements rcu-protected list and uses rcu_dereference()
without including rcupdate.h. It actually compiles because users of
rcu_dereference() are macros. Others RCU functions could be used too but
aren't probably because of this.Therefore this patch creates rculist.h which includes rcupdates without to
many changes/troubles.Signed-off-by: Franck Bui-Huu
Acked-by: Paul E. McKenney
Acked-by: Josh Triplett
Signed-off-by: Andrew Morton
Signed-off-by: Ingo Molnar
07 May, 2008
1 commit
-
When HMAC gets a key longer than the block size of the hash, it needs
to feed it as input to the hash to reduce it to a fixed length. As
it is HMAC converts the key to a scatter and gather list. However,
this doesn't work on certain platforms if the key is not allocated
via kmalloc. For example, the keys from tcrypt are stored in the
rodata section and this causes it to fail with HMAC on x86-64.This patch fixes this by copying the key to memory obtained via
kmalloc before hashing it.Signed-off-by: Herbert Xu
01 May, 2008
1 commit
-
Normally, kzalloc returns NULL or a valid pointer value, not a value to be
tested using IS_ERR.Signed-off-by: Julia Lawall
Signed-off-by: Herbert Xu