packages feed

crypton-2.3.1 / cbits / tests / endian / README

Does this C give the same answers on a big-endian machine?The cabal file lists s390x and ppc64 among the architectures it builds for.Neither is in the CI matrix, and neither had ever compiled this code, letalone run it.  Eighteen files read their input through the loaders incrypton_align.h -- which were rewritten from word-typed casts to memcpy in#256 -- and eight more decide something from the byte order themselves.  Thatis the largest body of untested endianness-sensitive code in the tree, and theriskiest part of it is the most recently written.The two sides cannot be compared in one run the way the 32-bit harnesscompares two builds, because only one endianness exists on the machine doingthe comparing.  So the answers are frozen instead: vectors.txt is what thiscode gives on a little-endian host, and check mode reads it back and compares.Any machine can run check mode, and a big-endian one that disagrees says soline by line.  cbits/tests/endian/run.sh generate   write vectors.txt from this machine  cbits/tests/endian/run.sh            check this machine against vectors.txtGenerate mode is for a maintainer on a little-endian machine after adding aprimitive, and the file it writes is committed.  It is not run in CI, whereonly check mode makes sense.The first few lines of vectors.txt are published test vectors rather thanwhatever this code happened to produce -- SHA-256 of "abc" and the like --so that a mistake on the generating host is caught rather than frozen in.