projects
/
linux-2.6-microblaze.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge tag 'x86_microcode_for_5.8' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux-2.6-microblaze.git]
/
lib
/
sha1.c
diff --git
a/lib/sha1.c
b/lib/sha1.c
index
1d96d2c
..
49257a9
100644
(file)
--- a/
lib/sha1.c
+++ b/
lib/sha1.c
@@
-9,7
+9,7
@@
#include <linux/kernel.h>
#include <linux/export.h>
#include <linux/bitops.h>
#include <linux/kernel.h>
#include <linux/export.h>
#include <linux/bitops.h>
-#include <
linux/cryptohash
.h>
+#include <
crypto/sha
.h>
#include <asm/unaligned.h>
/*
#include <asm/unaligned.h>
/*
@@
-64,22
+64,24
@@
#define T_60_79(t, A, B, C, D, E) SHA_ROUND(t, SHA_MIX, (B^C^D) , 0xca62c1d6, A, B, C, D, E )
/**
#define T_60_79(t, A, B, C, D, E) SHA_ROUND(t, SHA_MIX, (B^C^D) , 0xca62c1d6, A, B, C, D, E )
/**
- * sha
_transform - single block SHA1 transform
+ * sha
1_transform - single block SHA1 transform (deprecated)
*
* @digest: 160 bit digest to update
* @data: 512 bits of data to hash
* @array: 16 words of workspace (see note)
*
*
* @digest: 160 bit digest to update
* @data: 512 bits of data to hash
* @array: 16 words of workspace (see note)
*
- * This function generates a SHA1 digest for a single 512-bit block.
- * Be warned, it does not handle padding and message digest, do not
- * confuse it with the full FIPS 180-1 digest algorithm for variable
- * length messages.
+ * This function executes SHA-1's internal compression function. It updates the
+ * 160-bit internal state (@digest) with a single 512-bit data block (@data).
+ *
+ * Don't use this function. SHA-1 is no longer considered secure. And even if
+ * you do have to use SHA-1, this isn't the correct way to hash something with
+ * SHA-1 as this doesn't handle padding and finalization.
*
* Note: If the hash is security sensitive, the caller should be sure
* to clear the workspace. This is left to the caller to avoid
* unnecessary clears between chained hashing operations.
*/
*
* Note: If the hash is security sensitive, the caller should be sure
* to clear the workspace. This is left to the caller to avoid
* unnecessary clears between chained hashing operations.
*/
-void sha_transform(__u32 *digest, const char *data, __u32 *array)
+void sha
1
_transform(__u32 *digest, const char *data, __u32 *array)
{
__u32 A, B, C, D, E;
{
__u32 A, B, C, D, E;
@@
-185,13
+187,13
@@
void sha_transform(__u32 *digest, const char *data, __u32 *array)
digest[3] += D;
digest[4] += E;
}
digest[3] += D;
digest[4] += E;
}
-EXPORT_SYMBOL(sha_transform);
+EXPORT_SYMBOL(sha
1
_transform);
/**
/**
- * sha_init - initialize the vectors for a SHA1 digest
+ * sha
1
_init - initialize the vectors for a SHA1 digest
* @buf: vector to initialize
*/
* @buf: vector to initialize
*/
-void sha_init(__u32 *buf)
+void sha
1
_init(__u32 *buf)
{
buf[0] = 0x67452301;
buf[1] = 0xefcdab89;
{
buf[0] = 0x67452301;
buf[1] = 0xefcdab89;
@@
-199,4
+201,4
@@
void sha_init(__u32 *buf)
buf[3] = 0x10325476;
buf[4] = 0xc3d2e1f0;
}
buf[3] = 0x10325476;
buf[4] = 0xc3d2e1f0;
}
-EXPORT_SYMBOL(sha_init);
+EXPORT_SYMBOL(sha
1
_init);