Add ability to build on OS X

This commit is contained in:
unkernet
2017-08-27 19:39:34 +03:00
parent 9598dc1b6c
commit c3f2c015c4
7 changed files with 47 additions and 26 deletions

View File

@ -22,7 +22,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#include <malloc.h>
#include <stdlib.h>
#include "crypto1_bs_crack.h"
inline uint64_t crack_states_bitsliced(uint32_t **task){
@ -134,9 +134,10 @@ inline uint64_t crack_states_bitsliced(uint32_t **task){
}
#ifdef EXACT_COUNT
bucket_states_tested += bucket_size[block_idx];
// Fix a "1000000% bug". Looks like here is a problem with OS X gcc
bucket_states_tested += bucket_size[block_idx] > MAX_BITSLICES ? MAX_BITSLICES : bucket_size[block_idx];
#ifdef ONLINE_COUNT
__atomic_fetch_add(&total_states_tested, bucket_size[block_idx], __ATOMIC_RELAXED);
__atomic_fetch_add(&total_states_tested, bucket_size[block_idx] > MAX_BITSLICES ? MAX_BITSLICES : bucket_size[block_idx], __ATOMIC_RELAXED);
#endif
#else
#ifdef ONLINE_COUNT