1
0
Fork 0
mirror of https://github.com/BLAKE3-team/BLAKE3 synced 2024-05-09 15:56:23 +02:00

Compare commits

...

3 Commits

Author SHA1 Message Date
Patrick Stewart c355712898
Merge 36ecfb829b into 4ec3be8bfa 2024-04-06 12:03:45 +08:00
Jack O'Connor 4ec3be8bfa format the state matrix better in reference_impl.rs 2024-03-20 15:44:05 -07:00
Patrick Stewart 36ecfb829b Add #ifdef guards to enable multi-arch compilation on macOS 2022-05-31 16:57:25 +01:00
7 changed files with 21 additions and 17 deletions

View File

@ -1,3 +1,4 @@
#if defined(__x86_64__)
#if defined(__ELF__) && defined(__linux__)
.section .note.GNU-stack,"",%progbits
#endif
@ -1813,3 +1814,4 @@ CMP_MSB_MASK:
BLAKE3_IV:
.long 0x6A09E667, 0xBB67AE85, 0x3C6EF372, 0xA54FF53A
#endif

View File

@ -1,3 +1,4 @@
#if defined(__x86_64__)
#if defined(__ELF__) && defined(__linux__)
.section .note.GNU-stack,"",%progbits
#endif
@ -2583,3 +2584,5 @@ BLAKE3_IV_2:
.long 0x3C6EF372
BLAKE3_IV_3:
.long 0xA54FF53A
#endif

View File

@ -38,7 +38,7 @@ enum blake3_flags {
#define IS_X86_32
#endif
#if defined(__aarch64__) || defined(_M_ARM64)
#if defined(__aarch64__) || defined(_M_ARM64) || defined(__arm64__)
#define IS_AARCH64
#endif

View File

@ -1,4 +1,5 @@
#include "blake3_impl.h"
#if BLAKE3_USE_NEON
#include <arm_neon.h>
@ -364,3 +365,5 @@ void blake3_hash_many_neon(const uint8_t *const *inputs, size_t num_inputs,
out = &out[BLAKE3_OUT_LEN];
}
}
#endif

View File

@ -1,3 +1,4 @@
#if defined(__x86_64__)
#if defined(__ELF__) && defined(__linux__)
.section .note.GNU-stack,"",%progbits
#endif
@ -2289,3 +2290,5 @@ PBLENDW_0x3F_MASK:
.long 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x00000000
PBLENDW_0xC0_MASK:
.long 0x00000000, 0x00000000, 0x00000000, 0xFFFFFFFF
#endif

View File

@ -1,3 +1,4 @@
#if defined(__x86_64__)
#if defined(__ELF__) && defined(__linux__)
.section .note.GNU-stack,"",%progbits
#endif
@ -2026,3 +2027,4 @@ BLAKE3_BLOCK_LEN:
.long 64, 64, 64, 64
CMP_MSB_MASK:
.long 0x80000000, 0x80000000, 0x80000000, 0x80000000
#endif

View File

@ -78,23 +78,14 @@ fn compress(
block_len: u32,
flags: u32,
) -> [u32; 16] {
let counter_low = counter as u32;
let counter_high = (counter >> 32) as u32;
#[rustfmt::skip]
let mut state = [
chaining_value[0],
chaining_value[1],
chaining_value[2],
chaining_value[3],
chaining_value[4],
chaining_value[5],
chaining_value[6],
chaining_value[7],
IV[0],
IV[1],
IV[2],
IV[3],
counter as u32,
(counter >> 32) as u32,
block_len,
flags,
chaining_value[0], chaining_value[1], chaining_value[2], chaining_value[3],
chaining_value[4], chaining_value[5], chaining_value[6], chaining_value[7],
IV[0], IV[1], IV[2], IV[3],
counter_low, counter_high, block_len, flags,
];
let mut block = *block_words;