Project

General

Profile

Actions

Bug #5098

open

LeafTests/LeafDigest fails on s390x

Added by Davide Pesavento about 4 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Start date:
Due date:
% Done:

0%

Estimated time:

Description

../tests/unit-tests/test-leaf.cpp(60): error: in "LeafTests/LeafDigest": check result == ndn::toHex(digest->data(), digest->size(), false) has failed [05fe7f728d3341e9eff82526277b02171044124d0a52e8c4610982261c20de2b != 78534cf9d72d77670ca306e3678f7ef9b8cd02dc193798e849c230af8efec9c2]

This seems to be an endianness bug in the way the digest is calculated. chronosync::Leaf adds the sequence number (a uint64_t) to the digest via ndn-cxx's util::Sha256 class, which uses the host endianness to compute the hash of a uint64_t and is therefore not portable. To be fair, uint64_t support in util::Sha256 is probably ill-designed, or its documentation should at least state that it's not endian-safe and thus the result is not suitable for network protocols.

No data to display

Actions

Also available in: Atom PDF