Skip to content

BLAKE2: issue with endianness? #702

Closed
@cobratbq

Description

@cobratbq

Hi, I've been going through tht BLAKE2 code-base and I stumbled onto this thing that bothers me.

*v = $word::from_ne_bytes(chunk.try_into().unwrap());

Notice how the block is loaded in 32-bit chunks in native-endianness? This seems to correspond to the spec (RFC 7693) at top of page 24 where it says "get little-endian words".

Given that the data being loaded is raw data from the block-buffer, it seems that native-endianness can never be correct. I would guess this mistake is caused by wanting to convert into native-endianness, i.e. properly processing as u32, but that's a given. The source-buffer is simply interpreted as little-endian by convenient, AFAICT.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions