mirror of
https://gitlab.nic.cz/labs/bird.git
synced 2025-03-18 04:17:04 +00:00
SHA512: small changes in code style
This commit is contained in:
parent
a777dff865
commit
5a12cc27f7
14
lib/sha512.c
14
lib/sha512.c
@ -67,33 +67,33 @@ void sha512_update(sha512_context *ctx, const byte *in_buf, size_t in_len)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static inline u64
|
static inline u64
|
||||||
ROTR (u64 x, u64 n)
|
ROTR(u64 x, u64 n)
|
||||||
{
|
{
|
||||||
return((x >> n) | (x << (64 - n)));
|
return ((x >> n) | (x << (64 - n)));
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline u64
|
static inline u64
|
||||||
Ch(u64 x, u64 y, u64 z)
|
Ch(u64 x, u64 y, u64 z)
|
||||||
{
|
{
|
||||||
return((x & y) ^ ( ~x & z));
|
return ((x & y) ^ ( ~x & z));
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline u64
|
static inline u64
|
||||||
Maj(u64 x, u64 y, u64 z)
|
Maj(u64 x, u64 y, u64 z)
|
||||||
{
|
{
|
||||||
return((x & y) ^ (x & z) ^ (y & z));
|
return ((x & y) ^ (x & z) ^ (y & z));
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline u64
|
static inline u64
|
||||||
Sum0 (u64 x)
|
Sum0(u64 x)
|
||||||
{
|
{
|
||||||
return(ROTR (x, 28) ^ ROTR (x, 34) ^ ROTR (x, 39));
|
return (ROTR (x, 28) ^ ROTR (x, 34) ^ ROTR (x, 39));
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline u64
|
static inline u64
|
||||||
Sum1 (u64 x)
|
Sum1 (u64 x)
|
||||||
{
|
{
|
||||||
return(ROTR (x, 14) ^ ROTR (x, 18) ^ ROTR (x, 41));
|
return (ROTR (x, 14) ^ ROTR (x, 18) ^ ROTR (x, 41));
|
||||||
}
|
}
|
||||||
|
|
||||||
static const u64 k[] =
|
static const u64 k[] =
|
||||||
|
Loading…
x
Reference in New Issue
Block a user