Commit c7f36a27 authored by David S. Miller's avatar David S. Miller Committed by James Morris

[CRYPTO]: Fix compiler warnings and build failures.

- Add missing includes of asm/byteorder.h
- Fix sha1.c compiler crash with egcs-2.92.x
- Use correct printf format for size_t types.
parent b99b66de
......@@ -58,16 +58,16 @@ static int c_show(struct seq_file *m, void *p)
seq_printf(m, "name : %s\n", alg->cra_name);
seq_printf(m, "id : 0x%08x\n", alg->cra_id);
seq_printf(m, "blocksize : %d\n", alg->cra_blocksize);
seq_printf(m, "blocksize : %Zd\n", alg->cra_blocksize);
switch (alg->cra_id & CRYPTO_TYPE_MASK) {
case CRYPTO_TYPE_CIPHER:
seq_printf(m, "keysize : %d\n", alg->cra_cipher.cia_keysize);
seq_printf(m, "ivsize : %d\n", alg->cra_cipher.cia_ivsize);
seq_printf(m, "keysize : %Zd\n", alg->cra_cipher.cia_keysize);
seq_printf(m, "ivsize : %Zd\n", alg->cra_cipher.cia_ivsize);
break;
case CRYPTO_TYPE_DIGEST:
seq_printf(m, "digestsize : %d\n",
seq_printf(m, "digestsize : %Zd\n",
alg->cra_digest.dia_digestsize);
break;
}
......
......@@ -12,6 +12,7 @@
#ifndef _CRYPTO_INTERNAL_H
#define _CRYPTO_INTERNAL_H
#include <linux/mm.h>
#include <linux/highmem.h>
#include <asm/hardirq.h>
#include <asm/softirq.h>
......
......@@ -20,6 +20,8 @@
#include <linux/string.h>
#include <linux/crypto.h>
#include <asm/byteorder.h>
#define MD5_DIGEST_SIZE 16
#define MD5_HMAC_BLOCK_SIZE 64
#define MD5_BLOCK_WORDS 16
......
......@@ -22,11 +22,15 @@
#include <linux/mm.h>
#include <linux/crypto.h>
#include <asm/scatterlist.h>
#include <asm/byteorder.h>
#define SHA1_DIGEST_SIZE 20
#define SHA1_HMAC_BLOCK_SIZE 64
#define rol(value, bits) (((value) << (bits)) | ((value) >> (32 - (bits))))
static inline u32 rol(u32 value, u32 bits)
{
return (((value) << (bits)) | ((value) >> (32 - (bits))));
}
/* blk0() and blk() perform the initial expand. */
/* I got the idea of expanding during the round function from SSLeay */
......
......@@ -70,7 +70,7 @@ static void test_md5(void)
tsize = sizeof(md5_tv_template);
if (tsize > TVMEMSIZE) {
printk("template (%d) too big for tvmem (%d)\n", tsize, TVMEMSIZE);
printk("template (%Zd) too big for tvmem (%d)\n", tsize, TVMEMSIZE);
return;
}
......@@ -127,7 +127,7 @@ static void test_md5(void)
tsize = sizeof(hmac_md5_tv_template);
if (tsize > TVMEMSIZE) {
printk("template (%d) too big for tvmem (%d)\n", tsize, TVMEMSIZE);
printk("template (%Zd) too big for tvmem (%d)\n", tsize, TVMEMSIZE);
return;
}
......@@ -190,7 +190,7 @@ static void test_sha1(void)
tsize = sizeof(sha1_tv_template);
if (tsize > TVMEMSIZE) {
printk("template (%d) too big for tvmem (%d)\n", tsize, TVMEMSIZE);
printk("template (%Zd) too big for tvmem (%d)\n", tsize, TVMEMSIZE);
return;
}
......@@ -247,7 +247,7 @@ static void test_sha1(void)
tsize = sizeof(hmac_sha1_tv_template);
if (tsize > TVMEMSIZE) {
printk("template (%d) too big for tvmem (%d)\n", tsize, TVMEMSIZE);
printk("template (%Zd) too big for tvmem (%d)\n", tsize, TVMEMSIZE);
return;
}
......@@ -310,7 +310,7 @@ void test_des(void)
tsize = sizeof(des_enc_tv_template);
if (tsize > TVMEMSIZE) {
printk("template (%d) too big for tvmem (%d)\n", tsize, TVMEMSIZE);
printk("template (%Zd) too big for tvmem (%d)\n", tsize, TVMEMSIZE);
return;
}
......@@ -735,7 +735,7 @@ void test_des(void)
tsize = sizeof(des_dec_tv_template);
if (tsize > TVMEMSIZE) {
printk("template (%d) too big for tvmem (%d)\n", tsize, TVMEMSIZE);
printk("template (%Zd) too big for tvmem (%d)\n", tsize, TVMEMSIZE);
return;
}
memcpy(tvmem, des_dec_tv_template, tsize);
......@@ -893,7 +893,7 @@ void test_des(void)
tsize = sizeof(des_cbc_enc_tv_template);
if (tsize > TVMEMSIZE) {
printk("template (%d) too big for tvmem (%d)\n", tsize, TVMEMSIZE);
printk("template (%Zd) too big for tvmem (%d)\n", tsize, TVMEMSIZE);
return;
}
memcpy(tvmem, des_cbc_enc_tv_template, tsize);
......@@ -994,7 +994,7 @@ void test_des(void)
tsize = sizeof(des_cbc_dec_tv_template);
if (tsize > TVMEMSIZE) {
printk("template (%d) too big for tvmem (%d)\n", tsize, TVMEMSIZE);
printk("template (%Zd) too big for tvmem (%d)\n", tsize, TVMEMSIZE);
return;
}
memcpy(tvmem, des_cbc_dec_tv_template, tsize);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment