FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
node-multi-hashing/whirlpoolx.c at master · gitoido/node-multi-hashing · GitHub
gitoido
node-multi-hashing
Repository navigation
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
node-multi-hashing
/
whirlpoolx.c
Copy path
More file actions
More file actions
Latest commit
History
History
History
33 lines (24 loc) · 717 Bytes
Breadcrumbs
node-multi-hashing
/
whirlpoolx.c
Copy path
File metadata and controls
33 lines (24 loc) · 717 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include
"whirlpoolx.h"
#include
<stdlib.h>
#include
<stdint.h>
#include
<string.h>
#include
<stdio.h>
#include
"sha3/sph_whirlpool.h"
void
whirlpoolx_hash
(
const
char
*
input
,
char
*
output
,
uint32_t
len
)
{
unsigned
char
hash
[
64
];
memset
(
hash
,
0
,
sizeof
(
hash
));
sph_whirlpool_context
ctx_whirlpool
;
sph_whirlpool_init
(
&
ctx_whirlpool
);
sph_whirlpool
(
&
ctx_whirlpool
,
input
,
len
);
sph_whirlpool_close
(
&
ctx_whirlpool
,
hash
);
unsigned
char
hash_xored
[
sizeof
(
hash
) /
2
];
unsigned
int
i
=
0
;
for
(;
i
<
(
sizeof
(
hash
) /
2
);
i
++
)
{
hash_xored
[
i
]
=
hash
[
i
] ^
hash
[
i
+
((
sizeof
(
hash
) /
2
) /
2
)]
;
}
memcpy
(
output
,
hash_xored
,
32
);
}
Back
|
FazBrowse Home
|
New Git URL