mirror of
https://github.com/saymrwulf/betrusted-curve25519-dalek-source.git
synced 2026-09-06 20:41:11 +00:00
make our fix parallel to the patch sent upstream
remove const generics so we don't affect their mininum rust version requirement
This commit is contained in:
parent
279bbc5287
commit
b8f968b6e4
1 changed files with 4 additions and 1 deletions
|
|
@ -915,8 +915,11 @@ impl Scalar {
|
|||
|
||||
let mut naf = [0i8; 256];
|
||||
|
||||
// work-around for https://github.com/rust-lang/rust/issues/86693
|
||||
// riscv32i targets mis-align u64 types, leading to the lower 32 bits being aliased to the upper 32 bits
|
||||
// the AlignedU64Slice wrapper forces the enclosed structure to be aligned, thus avoiding this problem.
|
||||
#[repr(align(32))]
|
||||
struct AlignedU64Slice<const N: usize>([u64; N]);
|
||||
struct AlignedU64Slice([u64; 5]);
|
||||
|
||||
let mut x_u64 = AlignedU64Slice([0u64; 5]);
|
||||
LittleEndian::read_u64_into(&self.bytes, &mut x_u64.0[0..4]);
|
||||
|
|
|
|||
Loading…
Reference in a new issue