Re: [PATCH 1/2] Fixing NX data alignment with nx_sg list

2015-04-25 Thread Herbert Xu
On Thu, Apr 23, 2015 at 05:40:30PM -0300, Leonidas S. Barbosa wrote: > In NX we need to pass always a 16 multiple size nx_sg_list to > co processor. Trim function handle with this assuring all nx_sg_lists > are 16 multiple size, although data was not being considerated when > crop was done. It was

Re: [PATCH] crypto: sha1-mb - Remove pointless cast

2015-04-25 Thread Herbert Xu
On Thu, Apr 23, 2015 at 06:12:10PM +0800, Firo Yang wrote: > Since kzalloc() returns a void pointer, we don't need to cast the > return value in arch/x86/crypto/sha-mb/sha1_mb.c::sha1_mb_mod_init(). > > Signed-off-by: Firo Yang Applied. -- Email: Herbert Xu Home Page: http://gondor.apana.org.a

[PATCH v2] SP800-38F / RFC3394 key wrapping

2015-04-25 Thread Stephan Mueller
Hi, Please note that this patch will conflict with the DRBG patch for additional seeding sent earlier today. Both add test vectors in testmgr.c between the existing hmac() and lrw() due to the ordering requirements of testmgr.c. Changes v2: * Turn kw() into a blkcipher as suggested by Herbert Xu.

[PATCH v2] crypto: add key wrapping block chaining mode

2015-04-25 Thread Stephan Mueller
This patch implements the AES key wrapping as specified in NIST SP800-38F and RFC3394. The implementation covers key wrapping without padding. The caller may provide an IV. If no IV is provided, the default IV defined in SP800-38F is used for key wrapping and unwrapping. The key wrapping is an au

[PATCH v2 0/6] Seeding DRBG with more entropy

2015-04-25 Thread Stephan Mueller
Hi, as of now, the DRBG is only seeded from get_random_bytes. In various circumstances, the nonblocking_pool behind get_random_bytes may not be fully seeded from hardware events at the time the DRBG requires to be seeded. Based on the discussion in [1], the DRBG seeding is updated such that it doe

[PATCH v2 1/6] random: Addition of kernel_pool

2015-04-25 Thread Stephan Mueller
The kernel pool is intended to serve kernel-internal callers only. Its purpose and usage is identical to the blocking_pool. As the kernel_pool is not available to user space, user space cannot directly interfere with the blocking behavior when obtaining data from the kernel_pool. Thus, if entropy

[PATCH v2 2/6] random: Async and sync API for accessing kernel_pool

2015-04-25 Thread Stephan Mueller
The kernel_pool is intended to be the in-kernel equivalent to the blocking_pool, i.e. requests for random data may be blocked if insufficient entropy is present. The added API calls provide a synchronous function call get_blocking_random_bytes where the caller is blocked. In addition, an asynchro

[PATCH v2 4/6] crypto: drbg - add async seeding operation

2015-04-25 Thread Stephan Mueller
The async seeding operation is triggered during initalization right after the first non-blocking seeding is completed. As required by the asynchronous operation of random.c, a callback function is provided that is triggered by random.c once entropy is available. That callback function performs the

[PATCH v2 3/6] crypto: drbg - prepare for async seeding

2015-04-25 Thread Stephan Mueller
In order to prepare for the addition of the asynchronous seeding call, the invocation of seeding the DRBG is moved out into a helper function. In addition, a block of memory is allocated during initialization time that will be used as a scratchpad for obtaining entropy. That scratchpad is used for

[PATCH v2 6/6] crypto: add jitterentropy RNG

2015-04-25 Thread Stephan Mueller
The CPU Jitter RNG provides a source of good entropy by collecting CPU executing time jitter. The entropy in the CPU execution time jitter is magnified by the CPU Jitter Random Number Generator. The CPU Jitter Random Number Generator uses the CPU execution timing jitter to generate a bit stream whi

[PATCH v2 5/6] crypto: drbg - use Jitter RNG to obtain seed

2015-04-25 Thread Stephan Mueller
During initialization, the DRBG now tries to allocate a handle of the Jitter RNG. If such a Jitter RNG is available during seeding, the DRBG pulls the required entropy/nonce string from get_random_bytes and concatenates it with a string of equal size from the Jitter RNG. That combined string is now

[PATCH v3 3/5] target: handle odd SG mapping for data transfer memory

2015-04-25 Thread Akinobu Mita
sbc_dif_generate() and sbc_dif_verify() currently assume that each SG element for data transfer memory doesn't straddle the block size boundary. However, when using SG_IO ioctl, we can choose the data transfer memory which doesn't satisfy that alignment requirement. In order to handle such cases

[PATCH v3 2/5] lib: introduce crc_t10dif_update()

2015-04-25 Thread Akinobu Mita
This introduces crc_t10dif_update() which enables to calculate CRC for a block which straddles multiple SG elements by calling multiple times. Signed-off-by: Akinobu Mita Cc: Tim Chen Cc: Herbert Xu Cc: "David S. Miller" Cc: linux-crypto@vger.kernel.org Cc: Nicholas Bellinger Cc: Sagi Grimber

[PATCH v3 0/5] target: Fix several problems related to T10-PI support

2015-04-25 Thread Akinobu Mita
This patchset aims to fix several problems related to T10-PI support. These patches can be applied on top of Sagi's "[v1] Simlify dif_verify routines and fixup fileio protection information code" patchset. * Changes from v2: - Introduces crc_t10dif_update() to calculate CRC by mutiple calls - Han

[PATCH -next] crypto: api: Do not access module name directly from module structure

2015-04-25 Thread Guenter Roeck
'struct module' is only fully declared if CONFIG_MODULES is configured. If not, the build fails with crypto/algapi.c: In function 'crypto_check_module_sig': crypto/algapi.c:49:12: error: dereferencing pointer to incomplete type Fixes: 59afdc7b3214 ("crypto: api - Move module sig ifdef into access

Re: [PATCH -next] crypto: api: Do not access module name directly from module structure

2015-04-25 Thread Guenter Roeck
On Sat, Apr 25, 2015 at 06:38:03AM +0800, Herbert Xu wrote: > On Fri, Apr 24, 2015 at 08:58:03AM -0700, Guenter Roeck wrote: > > 'struct module' is only fully declared if CONFIG_MODULES is configured. > > If not, the build fails with > > > > crypto/algapi.c: In function 'crypto_check_module_sig':

Crypto Fixes for 4.1

2015-04-25 Thread Herbert Xu
Hi Linus: This push fixes a build problem with img-hash under non-standard configurations and a serious regression with sha512_ssse3 which can lead to boot failures. Please pull from git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6.git or master.kernel.org:/pub/scm/linux/kernel