btrfs-progs: free-space-cache: Enhance free space cache free space check
[platform/upstream/btrfs-progs.git] / tests / sha-private.h
1 /************************ sha-private.h ************************/
2 /***************** See RFC 6234 for details. *******************/
3 /* Copyright (c) 2011 IETF Trust and the persons identified as */
4 /* authors of the code.  All rights reserved.                  */
5 /* See sha.h for terms of use and redistribution.              */
6
7 #ifndef _SHA_PRIVATE__H
8 #define _SHA_PRIVATE__H
9 /*
10  * These definitions are defined in FIPS 180-3, section 4.1.
11  * Ch() and Maj() are defined identically in sections 4.1.1,
12  * 4.1.2, and 4.1.3.
13  *
14  * The definitions used in FIPS 180-3 are as follows:
15  */
16
17 #ifndef USE_MODIFIED_MACROS
18 #define SHA_Ch(x,y,z)        (((x) & (y)) ^ ((~(x)) & (z)))
19 #define SHA_Maj(x,y,z)       (((x) & (y)) ^ ((x) & (z)) ^ ((y) & (z)))
20 #else /* USE_MODIFIED_MACROS */
21 /*
22  * The following definitions are equivalent and potentially faster.
23  */
24
25 #define SHA_Ch(x, y, z)      (((x) & ((y) ^ (z))) ^ (z))
26 #define SHA_Maj(x, y, z)     (((x) & ((y) | (z))) | ((y) & (z)))
27
28 #endif /* USE_MODIFIED_MACROS */
29
30 #define SHA_Parity(x, y, z)  ((x) ^ (y) ^ (z))
31
32 #endif /* _SHA_PRIVATE__H */