git.openpandora.org
/
pandora-kernel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge mulgrave-w:git/scsi-misc-2.6
[pandora-kernel.git]
/
arch
/
s390
/
crypto
/
sha256_s390.c
diff --git
a/arch/s390/crypto/sha256_s390.c
b/arch/s390/crypto/sha256_s390.c
index
1ec5e92
..
8e4e675
100644
(file)
--- a/
arch/s390/crypto/sha256_s390.c
+++ b/
arch/s390/crypto/sha256_s390.c
@@
-31,9
+31,9
@@
struct s390_sha256_ctx {
u8 buf[2 * SHA256_BLOCK_SIZE];
};
u8 buf[2 * SHA256_BLOCK_SIZE];
};
-static void sha256_init(
void *ctx
)
+static void sha256_init(
struct crypto_tfm *tfm
)
{
{
- struct s390_sha256_ctx *sctx = c
tx
;
+ struct s390_sha256_ctx *sctx = c
rypto_tfm_ctx(tfm)
;
sctx->state[0] = 0x6a09e667;
sctx->state[1] = 0xbb67ae85;
sctx->state[0] = 0x6a09e667;
sctx->state[1] = 0xbb67ae85;
@@
-44,12
+44,12
@@
static void sha256_init(void *ctx)
sctx->state[6] = 0x1f83d9ab;
sctx->state[7] = 0x5be0cd19;
sctx->count = 0;
sctx->state[6] = 0x1f83d9ab;
sctx->state[7] = 0x5be0cd19;
sctx->count = 0;
- memset(sctx->buf, 0, sizeof(sctx->buf));
}
}
-static void sha256_update(void *ctx, const u8 *data, unsigned int len)
+static void sha256_update(struct crypto_tfm *tfm, const u8 *data,
+ unsigned int len)
{
{
- struct s390_sha256_ctx *sctx = c
tx
;
+ struct s390_sha256_ctx *sctx = c
rypto_tfm_ctx(tfm)
;
unsigned int index;
int ret;
unsigned int index;
int ret;
@@
-108,9
+108,9
@@
static void pad_message(struct s390_sha256_ctx* sctx)
}
/* Add padding and return the message digest */
}
/* Add padding and return the message digest */
-static void sha256_final(
void* ctx
, u8 *out)
+static void sha256_final(
struct crypto_tfm *tfm
, u8 *out)
{
{
- struct s390_sha256_ctx *sctx = c
tx
;
+ struct s390_sha256_ctx *sctx = c
rypto_tfm_ctx(tfm)
;
/* must perform manual padding */
pad_message(sctx);
/* must perform manual padding */
pad_message(sctx);
@@
-127,6
+127,8
@@
static void sha256_final(void* ctx, u8 *out)
static struct crypto_alg alg = {
.cra_name = "sha256",
static struct crypto_alg alg = {
.cra_name = "sha256",
+ .cra_driver_name = "sha256-s390",
+ .cra_priority = CRYPT_S390_PRIORITY,
.cra_flags = CRYPTO_ALG_TYPE_DIGEST,
.cra_blocksize = SHA256_BLOCK_SIZE,
.cra_ctxsize = sizeof(struct s390_sha256_ctx),
.cra_flags = CRYPTO_ALG_TYPE_DIGEST,
.cra_blocksize = SHA256_BLOCK_SIZE,
.cra_ctxsize = sizeof(struct s390_sha256_ctx),