-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathhashaliases.c
69 lines (59 loc) · 1.41 KB
/
hashaliases.c
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/*
* OS X compilers seem to have trouble resolving MAKE_CLONE()es,
* so just make explicit wrapper functions.
*/
#include <sha2.h>
/* MAKE_CLONE(SHA224Transform, SHA256Transform); */
void
SHA224Transform(u_int32_t state[8], const u_int8_t data[SHA256_BLOCK_LENGTH])
{
SHA256Transform(state, data);
}
/* MAKE_CLONE(SHA224Update, SHA256Update); */
void
SHA224Update(SHA2_CTX *context, const u_int8_t *data, size_t len)
{
SHA256Update(context, data, len);
}
/* MAKE_CLONE(SHA224Pad, SHA256Pad); */
void
SHA224Pad(SHA2_CTX *context)
{
SHA256Pad(context);
}
/* MAKE_CLONE(SHA384Transform, SHA512Transform); */
void
SHA384Transform(u_int64_t state[8], const u_int8_t data[SHA512_BLOCK_LENGTH])
{
SHA512Transform(state, data);
}
/* MAKE_CLONE(SHA384Update, SHA512Update); */
void
SHA384Update(SHA2_CTX *context, const u_int8_t *data, size_t len)
{
SHA512Update(context, data, len);
}
/* MAKE_CLONE(SHA384Pad, SHA512Pad); */
void
SHA384Pad(SHA2_CTX *context)
{
SHA512Pad(context);
}
/* MAKE_CLONE(SHA512_256Transform, SHA512Transform); */
void
SHA512_256Transform(u_int64_t state[8], const u_int8_t data[SHA512_BLOCK_LENGTH])
{
SHA512Transform(state, data);
}
/* MAKE_CLONE(SHA512_256Update, SHA512Update); */
void
SHA512_256Update(SHA2_CTX *context, const u_int8_t *data, size_t len)
{
SHA512Update(context, data, len);
}
/* MAKE_CLONE(SHA512_256Pad, SHA512Pad); */
void
SHA512_256Pad(SHA2_CTX *context)
{
SHA512Pad(context);
}