Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r61682 - in sandbox/hash: boost/hash boost/hash/detail libs/hash/test
From: me22.ca+boost_at_[hidden]
Date: 2010-04-29 15:53:50


Author: smcmurray
Date: 2010-04-29 15:53:47 EDT (Thu, 29 Apr 2010)
New Revision: 61682
URL: http://svn.boost.org/trac/boost/changeset/61682

Log:
hash: clarify byte (CHAR_BIT bits) vs octet (8 bits) in existing code
Added:
   sandbox/hash/boost/hash/stream_endian.hpp
      - copied, changed from r61670, /sandbox/hash/boost/hash/bitstream_endian.hpp
Removed:
   sandbox/hash/boost/hash/bitstream_endian.hpp
Text files modified:
   sandbox/hash/boost/hash/cubehash.hpp | 4
   sandbox/hash/boost/hash/detail/exploder.hpp | 36 +++++-----
   sandbox/hash/boost/hash/detail/imploder.hpp | 36 +++++-----
   sandbox/hash/boost/hash/digest.hpp | 22 +++---
   sandbox/hash/boost/hash/md4.hpp | 4
   sandbox/hash/boost/hash/md5.hpp | 4
   sandbox/hash/boost/hash/pack.hpp | 18 ++--
   sandbox/hash/boost/hash/sha.hpp | 4
   sandbox/hash/boost/hash/sha1.hpp | 4
   sandbox/hash/boost/hash/sha2.hpp | 4
   sandbox/hash/boost/hash/stream_endian.hpp | 49 +++++++++++++--
   sandbox/hash/boost/hash/stream_preprocessor.hpp | 5 -
   sandbox/hash/libs/hash/test/md.cpp | 8 +-
   sandbox/hash/libs/hash/test/pack.cpp | 122 ++++++++++++++++++++--------------------
   sandbox/hash/libs/hash/test/shacal.cpp | 32 +++++-----
   sandbox/hash/libs/hash/test/threefish.cpp | 2
   16 files changed, 190 insertions(+), 164 deletions(-)

Deleted: sandbox/hash/boost/hash/bitstream_endian.hpp
==============================================================================
--- sandbox/hash/boost/hash/bitstream_endian.hpp 2010-04-29 15:53:47 EDT (Thu, 29 Apr 2010)
+++ (empty file)
@@ -1,26 +0,0 @@
-
-//
-// Copyright 2010 Scott McMurray.
-// Distributed under the Boost Software License, Version 1.0.
-// (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-//
-
-#ifndef BOOST_HASH_BITSTREAM_ENDIAN_HPP
-#define BOOST_HASH_BITSTREAM_ENDIAN_HPP
-
-namespace boost {
-namespace hash {
-
-namespace bitstream_endian {
- struct big_byte_big_bit {};
- struct little_byte_big_bit {};
- struct big_byte_little_bit {};
- struct little_byte_little_bit {};
- struct platform {};
-}
-
-} // namespace hash
-} // namespace boost
-
-#endif // BOOST_HASH_BITSTREAM_ENDIAN_HPP

Modified: sandbox/hash/boost/hash/cubehash.hpp
==============================================================================
--- sandbox/hash/boost/hash/cubehash.hpp (original)
+++ sandbox/hash/boost/hash/cubehash.hpp 2010-04-29 15:53:47 EDT (Thu, 29 Apr 2010)
@@ -96,13 +96,13 @@
                 typename policy_type::iv_generator,
                 cubehash_compressor<r, b, h>,
                 digest_from_state<digest<policy_type::digest_bits>,
- bitstream_endian::little_byte_big_bit>,
+ stream_endian::little_octet_big_bit>,
                 cubehash_finalizer<r, b, h>
> block_hash_type;
     template <unsigned value_bits>
     struct stream_hash {
         typedef stream_preprocessor<
- bitstream_endian::little_byte_big_bit,
+ stream_endian::little_octet_big_bit,
                     value_bits,
                     0, // No length padding!
                     block_hash_type

Modified: sandbox/hash/boost/hash/detail/exploder.hpp
==============================================================================
--- sandbox/hash/boost/hash/detail/exploder.hpp (original)
+++ sandbox/hash/boost/hash/detail/exploder.hpp 2010-04-29 15:53:47 EDT (Thu, 29 Apr 2010)
@@ -9,7 +9,7 @@
 #ifndef BOOST_HASH_DETAIL_EXPLODER_HPP
 #define BOOST_HASH_DETAIL_EXPLODER_HPP
 
-#include <boost/hash/bitstream_endian.hpp>
+#include <boost/hash/stream_endian.hpp>
 #include <boost/hash/detail/unbounded_shift.hpp>
 #include <boost/static_assert.hpp>
 
@@ -27,7 +27,7 @@
 
 template <int InputBits, int OutputBits,
           int k>
-struct exploder<bitstream_endian::big_byte_big_bit,
+struct exploder<stream_endian::big_octet_big_bit,
                 InputBits, OutputBits, k> {
     template <typename OutputValue, typename InputValue>
     static void step(OutputValue &z, InputValue x) {
@@ -37,13 +37,13 @@
     template <typename OutputType, typename InputValue>
     static void explode1_array(OutputType &out, unsigned &i, InputValue x) {
         step(out[i++], x);
- exploder<bitstream_endian::big_byte_big_bit,
+ exploder<stream_endian::big_octet_big_bit,
                 InputBits, OutputBits, k+OutputBits>
          ::explode1_array(out, i, x);
     }
 };
 template <int InputBits, int OutputBits>
-struct exploder<bitstream_endian::big_byte_big_bit,
+struct exploder<stream_endian::big_octet_big_bit,
                 InputBits, OutputBits, InputBits> {
     template <typename OutputType, typename IntputValue>
     static void explode1_array(OutputType &, unsigned &, IntputValue) {}
@@ -51,10 +51,10 @@
 
 template <int InputBits, int OutputBits,
           int k>
-struct exploder<bitstream_endian::little_byte_big_bit,
+struct exploder<stream_endian::little_octet_big_bit,
                 InputBits, OutputBits, k> {
     // Mixed-endian pack explode can only handle bitwidths that are
- // multiples or fractions of bytes
+ // multiples or fractions of octets
     BOOST_STATIC_ASSERT((InputBits % 8 == 0 || 8 % InputBits == 0) &&
                         (OutputBits % 8 == 0 || 8 % OutputBits == 0));
     template <typename OutputValue, typename InputValue>
@@ -71,13 +71,13 @@
     template <typename OutputType, typename InputValue>
     static void explode1_array(OutputType &out, unsigned &i, InputValue x) {
         step(out[i++], x);
- exploder<bitstream_endian::little_byte_big_bit,
+ exploder<stream_endian::little_octet_big_bit,
                 InputBits, OutputBits, k+OutputBits>
          ::explode1_array(out, i, x);
     }
 };
 template <int InputBits, int OutputBits>
-struct exploder<bitstream_endian::little_byte_big_bit,
+struct exploder<stream_endian::little_octet_big_bit,
                 InputBits, OutputBits, InputBits> {
     template <typename OutputType, typename IntputValue>
     static void explode1_array(OutputType &, unsigned &, IntputValue) {}
@@ -85,10 +85,10 @@
 
 template <int InputBits, int OutputBits,
           int k>
-struct exploder<bitstream_endian::big_byte_little_bit,
+struct exploder<stream_endian::big_octet_little_bit,
                 InputBits, OutputBits, k> {
     // Mixed-endian pack explode can only handle bitwidths that are
- // multiples or fractions of bytes
+ // multiples or fractions of octets
     BOOST_STATIC_ASSERT((InputBits % 8 == 0 || 8 % InputBits == 0) &&
                         (OutputBits % 8 == 0 || 8 % OutputBits == 0));
     template <typename OutputValue, typename InputValue>
@@ -105,13 +105,13 @@
     template <typename OutputType, typename InputValue>
     static void explode1_array(OutputType &out, unsigned &i, InputValue x) {
         step(out[i++], x);
- exploder<bitstream_endian::big_byte_little_bit,
+ exploder<stream_endian::big_octet_little_bit,
                 InputBits, OutputBits, k+OutputBits>
          ::explode1_array(out, i, x);
     }
 };
 template <int InputBits, int OutputBits>
-struct exploder<bitstream_endian::big_byte_little_bit,
+struct exploder<stream_endian::big_octet_little_bit,
                 InputBits, OutputBits, InputBits> {
     template <typename OutputType, typename IntputValue>
     static void explode1_array(OutputType &, unsigned &, IntputValue) {}
@@ -119,7 +119,7 @@
 
 template <int InputBits, int OutputBits,
           int k>
-struct exploder<bitstream_endian::little_byte_little_bit,
+struct exploder<stream_endian::little_octet_little_bit,
                 InputBits, OutputBits, k> {
     template <typename OutputValue, typename InputValue>
     static void step(OutputValue &z, InputValue x) {
@@ -129,13 +129,13 @@
     template <typename OutputType, typename InputValue>
     static void explode1_array(OutputType &out, unsigned &i, InputValue x) {
         step(out[i++], x);
- exploder<bitstream_endian::little_byte_little_bit,
+ exploder<stream_endian::little_octet_little_bit,
                 InputBits, OutputBits, k+OutputBits>
          ::explode1_array(out, i, x);
     }
 };
 template <int InputBits, int OutputBits>
-struct exploder<bitstream_endian::little_byte_little_bit,
+struct exploder<stream_endian::little_octet_little_bit,
                 InputBits, OutputBits, InputBits> {
     template <typename OutputType, typename IntputValue>
     static void explode1_array(OutputType &, unsigned &, IntputValue) {}
@@ -143,7 +143,7 @@
 
 template <int InputBits, int OutputBits,
           int k>
-struct exploder<bitstream_endian::platform,
+struct exploder<stream_endian::host_byte,
                 InputBits, OutputBits, k> {
     BOOST_STATIC_ASSERT(InputBits % CHAR_BIT == 0);
     BOOST_STATIC_ASSERT(OutputBits % CHAR_BIT == 0);
@@ -154,13 +154,13 @@
     template <typename OutputType, typename InputValue>
     static void explode1_array(OutputType &out, unsigned &i, InputValue x) {
         step(out[i++], x);
- exploder<bitstream_endian::platform,
+ exploder<stream_endian::host_byte,
                 InputBits, OutputBits, k+OutputBits>
          ::explode1_array(out, i, x);
     }
 };
 template <int InputBits, int OutputBits>
-struct exploder<bitstream_endian::platform,
+struct exploder<stream_endian::host_byte,
                 InputBits, OutputBits, InputBits> {
     template <typename OutputType, typename IntputValue>
     static void explode1_array(OutputType &, unsigned &, IntputValue) {}

Modified: sandbox/hash/boost/hash/detail/imploder.hpp
==============================================================================
--- sandbox/hash/boost/hash/detail/imploder.hpp (original)
+++ sandbox/hash/boost/hash/detail/imploder.hpp 2010-04-29 15:53:47 EDT (Thu, 29 Apr 2010)
@@ -9,7 +9,7 @@
 #ifndef BOOST_HASH_DETAIL_IMPLODER_HPP
 #define BOOST_HASH_DETAIL_IMPLODER_HPP
 
-#include <boost/hash/bitstream_endian.hpp>
+#include <boost/hash/stream_endian.hpp>
 #include <boost/hash/detail/unbounded_shift.hpp>
 #include <boost/static_assert.hpp>
 
@@ -27,7 +27,7 @@
 
 template <int InputBits, int OutputBits,
           int k>
-struct imploder<bitstream_endian::big_byte_big_bit,
+struct imploder<stream_endian::big_octet_big_bit,
                 InputBits, OutputBits, k> {
     template <typename InputValue, typename OutputValue>
     static void step(InputValue z, OutputValue &x) {
@@ -37,13 +37,13 @@
     template <typename InputType, typename OutputValue>
     static void implode1_array(InputType const &in, unsigned &i, OutputValue &x) {
         step(in[i++], x);
- imploder<bitstream_endian::big_byte_big_bit,
+ imploder<stream_endian::big_octet_big_bit,
                 InputBits, OutputBits, k+InputBits>
          ::implode1_array(in, i, x);
     }
 };
 template <int InputBits, int OutputBits>
-struct imploder<bitstream_endian::big_byte_big_bit,
+struct imploder<stream_endian::big_octet_big_bit,
                 InputBits, OutputBits, OutputBits> {
     template <typename InputType, typename OutputValue>
     static void implode1_array(InputType const &, unsigned &, OutputValue &) {}
@@ -51,10 +51,10 @@
 
 template <int InputBits, int OutputBits,
           int k>
-struct imploder<bitstream_endian::little_byte_big_bit,
+struct imploder<stream_endian::little_octet_big_bit,
                 InputBits, OutputBits, k> {
     // Mixed-endian pack explode can only handle bitwidths that are
- // multiples or fractions of bytes
+ // multiples or fractions of octets
     BOOST_STATIC_ASSERT((InputBits % 8 == 0 || 8 % InputBits == 0) &&
                         (OutputBits % 8 == 0 || 8 % OutputBits == 0));
     template <typename InputValue, typename OutputValue>
@@ -71,13 +71,13 @@
     template <typename InputType, typename OutputValue>
     static void implode1_array(InputType const &in, unsigned &i, OutputValue &x) {
         step(in[i++], x);
- imploder<bitstream_endian::little_byte_big_bit,
+ imploder<stream_endian::little_octet_big_bit,
                 InputBits, OutputBits, k+InputBits>
          ::implode1_array(in, i, x);
     }
 };
 template <int InputBits, int OutputBits>
-struct imploder<bitstream_endian::little_byte_big_bit,
+struct imploder<stream_endian::little_octet_big_bit,
                 InputBits, OutputBits, OutputBits> {
     template <typename InputType, typename OutputValue>
     static void implode1_array(InputType const &, unsigned &, OutputValue &) {}
@@ -85,10 +85,10 @@
 
 template <int InputBits, int OutputBits,
           int k>
-struct imploder<bitstream_endian::big_byte_little_bit,
+struct imploder<stream_endian::big_octet_little_bit,
                 InputBits, OutputBits, k> {
     // Mixed-endian pack explode can only handle bitwidths that are
- // multiples or fractions of bytes
+ // multiples or fractions of octets
     BOOST_STATIC_ASSERT((InputBits % 8 == 0 || 8 % InputBits == 0) &&
                         (OutputBits % 8 == 0 || 8 % OutputBits == 0));
     template <typename InputValue, typename OutputValue>
@@ -105,13 +105,13 @@
     template <typename InputType, typename OutputValue>
     static void implode1_array(InputType const &in, unsigned &i, OutputValue &x) {
         step(in[i++], x);
- imploder<bitstream_endian::big_byte_little_bit,
+ imploder<stream_endian::big_octet_little_bit,
                 InputBits, OutputBits, k+InputBits>
          ::implode1_array(in, i, x);
     }
 };
 template <int InputBits, int OutputBits>
-struct imploder<bitstream_endian::big_byte_little_bit,
+struct imploder<stream_endian::big_octet_little_bit,
                 InputBits, OutputBits, OutputBits> {
     template <typename InputType, typename OutputValue>
     static void implode1_array(InputType const &, unsigned &, OutputValue &) {}
@@ -119,7 +119,7 @@
 
 template <int InputBits, int OutputBits,
           int k>
-struct imploder<bitstream_endian::little_byte_little_bit,
+struct imploder<stream_endian::little_octet_little_bit,
                 InputBits, OutputBits, k> {
     template <typename InputValue, typename OutputValue>
     static void step(InputValue z, OutputValue &x) {
@@ -129,13 +129,13 @@
     template <typename InputType, typename OutputValue>
     static void implode1_array(InputType const &in, unsigned &i, OutputValue &x) {
         step(in[i++], x);
- imploder<bitstream_endian::little_byte_little_bit,
+ imploder<stream_endian::little_octet_little_bit,
                 InputBits, OutputBits, k+InputBits>
          ::implode1_array(in, i, x);
     }
 };
 template <int InputBits, int OutputBits>
-struct imploder<bitstream_endian::little_byte_little_bit,
+struct imploder<stream_endian::little_octet_little_bit,
                 InputBits, OutputBits, OutputBits> {
     template <typename InputType, typename OutputValue>
     static void implode1_array(InputType const &, unsigned &, OutputValue &) {}
@@ -143,7 +143,7 @@
 
 template <int InputBits, int OutputBits,
           int k>
-struct imploder<bitstream_endian::platform,
+struct imploder<stream_endian::host_byte,
                 InputBits, OutputBits, k> {
     BOOST_STATIC_ASSERT(InputBits % CHAR_BIT == 0);
     BOOST_STATIC_ASSERT(OutputBits % CHAR_BIT == 0);
@@ -154,13 +154,13 @@
     template <typename InputType, typename OutputValue>
     static void implode1_array(InputType const &in, unsigned &i, OutputValue &x) {
         step(in[i++], x);
- imploder<bitstream_endian::platform,
+ imploder<stream_endian::host_byte,
                 InputBits, OutputBits, k+InputBits>
          ::implode1_array(in, i, x);
     }
 };
 template <int InputBits, int OutputBits>
-struct imploder<bitstream_endian::platform,
+struct imploder<stream_endian::host_byte,
                 InputBits, OutputBits, OutputBits> {
     template <typename InputType, typename OutputValue>
     static void implode1_array(InputType const &, unsigned &, OutputValue &) {}

Modified: sandbox/hash/boost/hash/digest.hpp
==============================================================================
--- sandbox/hash/boost/hash/digest.hpp (original)
+++ sandbox/hash/boost/hash/digest.hpp 2010-04-29 15:53:47 EDT (Thu, 29 Apr 2010)
@@ -19,19 +19,19 @@
 namespace boost {
 namespace hash {
 
-// Always stored internally as a sequence of bytes in display order.
+// Always stored internally as a sequence of octets in display order.
 // This allows digests from different algorithms to have the same type,
 // allowing them to be more easily stored and compared.
 template <unsigned digest_bits_>
 class digest {
   public:
- static unsigned const byte_bits = 8;
- typedef typename uint_t<byte_bits>::least byte_type;
+ static unsigned const octet_bits = 8;
+ typedef typename uint_t<octet_bits>::least octet_type;
 
     static unsigned const digest_bits = digest_bits_;
- BOOST_STATIC_ASSERT(digest_bits % byte_bits == 0);
- static unsigned const digest_bytes = digest_bits/byte_bits;
- typedef array<byte_type, digest_bytes> data_type;
+ BOOST_STATIC_ASSERT(digest_bits % octet_bits == 0);
+ static unsigned const digest_octets = digest_bits/octet_bits;
+ typedef array<octet_type, digest_octets> data_type;
 
     static unsigned const cstring_size = digest_bits/4 + 1;
     typedef array<char, cstring_size> cstring_type;
@@ -44,8 +44,8 @@
 
     template <typename oit_T>
     oit_T ascii(oit_T it) const {
- for (unsigned j = 0; j < digest_bytes; ++j) {
- byte_type b = data_[j];
+ for (unsigned j = 0; j < digest_octets; ++j) {
+ octet_type b = data_[j];
             *it++ = "0123456789abcdef"[(b >> 4) & 0xF];
             *it++ = "0123456789abcdef"[(b >> 0) & 0xF];
         }
@@ -70,10 +70,10 @@
         BOOST_STATIC_ASSERT(state_words <= state_words);
         BOOST_STATIC_ASSERT(digest_bits % word_bits == 0);
 
- array<byte_type, state_bits/byte_bits> d;
- pack<endian, word_bits, byte_bits>(s, d);
+ array<octet_type, state_bits/octet_bits> d;
+ pack<endian, word_bits, octet_bits>(s, d);
         data_type td;
- for (unsigned i = 0; i < digest_bytes; ++i) {
+ for (unsigned i = 0; i < digest_octets; ++i) {
             td[i] = d[i];
         }
         return digest(td);

Modified: sandbox/hash/boost/hash/md4.hpp
==============================================================================
--- sandbox/hash/boost/hash/md4.hpp (original)
+++ sandbox/hash/boost/hash/md4.hpp 2010-04-29 15:53:47 EDT (Thu, 29 Apr 2010)
@@ -29,12 +29,12 @@
                 davies_meyer_compressor<block_cypher_type,
                                         detail::state_adder>,
                 digest_from_state<digest<policy_type::digest_bits>,
- bitstream_endian::little_byte_big_bit>
+ stream_endian::little_octet_big_bit>
> block_hash_type;
     template <unsigned value_bits>
     struct stream_hash {
         typedef stream_preprocessor<
- bitstream_endian::little_byte_big_bit,
+ stream_endian::little_octet_big_bit,
                     value_bits,
                     block_hash_type::word_bits * 2,
                     block_hash_type

Modified: sandbox/hash/boost/hash/md5.hpp
==============================================================================
--- sandbox/hash/boost/hash/md5.hpp (original)
+++ sandbox/hash/boost/hash/md5.hpp 2010-04-29 15:53:47 EDT (Thu, 29 Apr 2010)
@@ -29,12 +29,12 @@
                 davies_meyer_compressor<block_cypher_type,
                                         detail::state_adder>,
                 digest_from_state<digest<policy_type::digest_bits>,
- bitstream_endian::little_byte_big_bit>
+ stream_endian::little_octet_big_bit>
> block_hash_type;
     template <unsigned value_bits>
     struct stream_hash {
         typedef stream_preprocessor<
- bitstream_endian::little_byte_big_bit,
+ stream_endian::little_octet_big_bit,
                     value_bits,
                     block_hash_type::word_bits * 2,
                     block_hash_type

Modified: sandbox/hash/boost/hash/pack.hpp
==============================================================================
--- sandbox/hash/boost/hash/pack.hpp (original)
+++ sandbox/hash/boost/hash/pack.hpp 2010-04-29 15:53:47 EDT (Thu, 29 Apr 2010)
@@ -10,7 +10,7 @@
 #define BOOST_HASH_PACK_HPP
 
 #include <boost/assert.hpp>
-#include <boost/hash/bitstream_endian.hpp>
+#include <boost/hash/stream_endian.hpp>
 #include <boost/hash/detail/exploder.hpp>
 #include <boost/hash/detail/imploder.hpp>
 #include <boost/static_assert.hpp>
@@ -114,34 +114,34 @@
 
 #ifdef BOOST_LITTLE_ENDIAN
 template <int InputBits, int OutputBits, bool Ex, bool Im>
-struct packer<bitstream_endian::little_byte_big_bit,
+struct packer<stream_endian::little_byte_big_bit,
               InputBits, OutputBits,
               Ex, Im, true, true>
- : packer<bitstream_endian::platform,
+ : packer<stream_endian::host_byte,
           InputBits, OutputBits,
           Ex, Im, true, true> {};
 template <int InputBits, int OutputBits, bool Ex, bool Im>
-struct packer<bitstream_endian::little_byte_little_bit,
+struct packer<stream_endian::little_byte_little_bit,
               InputBits, OutputBits,
               Ex, Im, true, true>
- : packer<bitstream_endian::platform,
+ : packer<stream_endian::host_byte,
           InputBits, OutputBits,
           Ex, Im, true, true> {};
 #endif
 
 #ifdef BOOST_BIG_ENDIAN
 template <int InputBits, int OutputBits, bool Ex, bool Im>
-struct packer<bitstream_endian::big_byte_big_bit,
+struct packer<stream_endian::big_byte_big_bit,
               InputBits, OutputBits,
               Ex, Im, true, true>
- : packer<bitstream_endian::platform,
+ : packer<stream_endian::host_byte,
           InputBits, OutputBits,
           Ex, Im, true, true> {};
 template <int InputBits, int OutputBits, bool Ex, bool Im>
-struct packer<bitstream_endian::big_byte_little_bit,
+struct packer<stream_endian::big_byte_little_bit,
               InputBits, OutputBits,
               Ex, Im, true, true>
- : packer<bitstream_endian::platform,
+ : packer<stream_endian::host_byte,
           InputBits, OutputBits,
           Ex, Im, true, true> {};
 #endif

Modified: sandbox/hash/boost/hash/sha.hpp
==============================================================================
--- sandbox/hash/boost/hash/sha.hpp (original)
+++ sandbox/hash/boost/hash/sha.hpp 2010-04-29 15:53:47 EDT (Thu, 29 Apr 2010)
@@ -29,12 +29,12 @@
                 davies_meyer_compressor<block_cypher_type,
                                         detail::state_adder>,
                 digest_from_state<digest<policy_type::digest_bits>,
- bitstream_endian::big_byte_big_bit>
+ stream_endian::big_octet_big_bit>
> block_hash_type;
     template <unsigned value_bits>
     struct stream_hash {
         typedef stream_preprocessor<
- bitstream_endian::big_byte_big_bit,
+ stream_endian::big_octet_big_bit,
                     value_bits,
                     block_hash_type::word_bits * 2,
                     block_hash_type

Modified: sandbox/hash/boost/hash/sha1.hpp
==============================================================================
--- sandbox/hash/boost/hash/sha1.hpp (original)
+++ sandbox/hash/boost/hash/sha1.hpp 2010-04-29 15:53:47 EDT (Thu, 29 Apr 2010)
@@ -29,12 +29,12 @@
                 davies_meyer_compressor<block_cypher_type,
                                         detail::state_adder>,
                 digest_from_state<digest<policy_type::digest_bits>,
- bitstream_endian::big_byte_big_bit>
+ stream_endian::big_octet_big_bit>
> block_hash_type;
     template <unsigned value_bits>
     struct stream_hash {
         typedef stream_preprocessor<
- bitstream_endian::big_byte_big_bit,
+ stream_endian::big_octet_big_bit,
                     value_bits,
                     block_hash_type::word_bits * 2,
                     block_hash_type

Modified: sandbox/hash/boost/hash/sha2.hpp
==============================================================================
--- sandbox/hash/boost/hash/sha2.hpp (original)
+++ sandbox/hash/boost/hash/sha2.hpp 2010-04-29 15:53:47 EDT (Thu, 29 Apr 2010)
@@ -31,12 +31,12 @@
                 davies_meyer_compressor<block_cypher_type,
                                         detail::state_adder>,
                 digest_from_state<digest<policy_type::digest_bits>,
- bitstream_endian::big_byte_big_bit>
+ stream_endian::big_octet_big_bit>
> block_hash_type;
     template <unsigned value_bits>
     struct stream_hash {
         typedef stream_preprocessor<
- bitstream_endian::big_byte_big_bit,
+ stream_endian::big_octet_big_bit,
                     value_bits,
                     block_hash_type::word_bits * 2,
                     block_hash_type

Copied: sandbox/hash/boost/hash/stream_endian.hpp (from r61670, /sandbox/hash/boost/hash/bitstream_endian.hpp)
==============================================================================
--- /sandbox/hash/boost/hash/bitstream_endian.hpp (original)
+++ sandbox/hash/boost/hash/stream_endian.hpp 2010-04-29 15:53:47 EDT (Thu, 29 Apr 2010)
@@ -6,21 +6,52 @@
 // http://www.boost.org/LICENSE_1_0.txt)
 //
 
-#ifndef BOOST_HASH_BITSTREAM_ENDIAN_HPP
-#define BOOST_HASH_BITSTREAM_ENDIAN_HPP
+#ifndef BOOST_HASH_STREAM_ENDIAN_HPP
+#define BOOST_HASH_STREAM_ENDIAN_HPP
+
+#include <boost/static_assert.hpp>
+
+#include <climits>
 
 namespace boost {
 namespace hash {
 
-namespace bitstream_endian {
- struct big_byte_big_bit {};
- struct little_byte_big_bit {};
- struct big_byte_little_bit {};
- struct little_byte_little_bit {};
- struct platform {};
+namespace stream_endian {
+
+ // General versions; There should be no need to use these directly
+
+ template <unsigned UnitBits>
+ struct big_unit_big_bit {};
+ template <unsigned UnitBits>
+ struct little_unit_little_bit {};
+ template <unsigned UnitBits>
+ struct big_unit_little_bit {};
+ template <unsigned UnitBits>
+ struct little_unit_big_bit {};
+ template <unsigned UnitBits>
+ struct host_unit { BOOST_STATIC_ASSERT(UnitBits % CHAR_BIT == 0); };
+
+ // Typical, useful instantiations
+
+ typedef big_unit_big_bit<1> big_bit;
+ typedef big_unit_big_bit<CHAR_BIT> big_byte_big_bit;
+ typedef big_unit_big_bit<8> big_octet_big_bit;
+
+ typedef little_unit_little_bit<1> little_bit;
+ typedef little_unit_little_bit<CHAR_BIT> little_byte_little_bit;
+ typedef little_unit_little_bit<8> little_octet_little_bit;
+
+ typedef big_unit_little_bit<CHAR_BIT> big_byte_little_bit;
+ typedef big_unit_little_bit<8> big_octet_little_bit;
+
+ typedef little_unit_big_bit<CHAR_BIT> little_byte_big_bit;
+ typedef little_unit_big_bit<8> little_octet_big_bit;
+
+ typedef host_unit<CHAR_BIT> host_byte;
+
 }
 
 } // namespace hash
 } // namespace boost
 
-#endif // BOOST_HASH_BITSTREAM_ENDIAN_HPP
+#endif // BOOST_HASH_STREAM_ENDIAN_HPP

Modified: sandbox/hash/boost/hash/stream_preprocessor.hpp
==============================================================================
--- sandbox/hash/boost/hash/stream_preprocessor.hpp (original)
+++ sandbox/hash/boost/hash/stream_preprocessor.hpp 2010-04-29 15:53:47 EDT (Thu, 29 Apr 2010)
@@ -47,11 +47,6 @@
 
   private:
 
- static unsigned const byte_bits = 8;
-// typedef typename uint_t<byte_bits>::least byte_type;
- BOOST_STATIC_ASSERT(value_bits < byte_bits || value_bits % byte_bits == 0);
- BOOST_STATIC_ASSERT(value_bits >= byte_bits || byte_bits % value_bits == 0);
-
     static unsigned const length_bits = length_bits_;
     // FIXME: do something more intelligent than capping at 64
     static unsigned const length_type_bits =

Modified: sandbox/hash/libs/hash/test/md.cpp
==============================================================================
--- sandbox/hash/libs/hash/test/md.cpp (original)
+++ sandbox/hash/libs/hash/test/md.cpp 2010-04-29 15:53:47 EDT (Thu, 29 Apr 2010)
@@ -26,7 +26,7 @@
     // A single 1 bit after the (empty) message,
     // then pad with 0s,
     // then add the length, which is also 0.
- // Remember that MD5 is little-byte, big-bit endian
+ // Remember that MD5 is little-octet, big-bit endian
     md4::block_hash_type::block_type m = {{0x00000080u}};
     a.update(m);
     md4::block_hash_type::digest_type s = a.end_message();
@@ -39,7 +39,7 @@
     // echo -n "abc" | md4sum
     md4::block_hash_type::block_type m = {{}};
     m[ 0] = 0x80636261;
- // little-byte, big-bit endian also means the size isn't in the last word
+ // little-octet, big-bit endian also means the size isn't in the last word
     m[14] = 0x00000018;
     a.update(m);
     md4::block_hash_type::digest_type s = a.end_message();
@@ -64,7 +64,7 @@
     // A single 1 bit after the (empty) message,
     // then pad with 0s,
     // then add the length, which is also 0.
- // Remember that MD5 is little-byte, big-bit endian
+ // Remember that MD5 is little-octet, big-bit endian
     md5::block_hash_type::block_type m = {{0x00000080u}};
     a.update(m);
     md5::block_hash_type::digest_type s = a.end_message();
@@ -77,7 +77,7 @@
     // echo -n "abc" | md4sum
     md5::block_hash_type::block_type m = {{}};
     m[ 0] = 0x80636261;
- // little-byte, big-bit endian also means the size isn't in the last word
+ // little-octet, big-bit endian also means the size isn't in the last word
     m[14] = 0x00000018;
     a.update(m);
     md5::block_hash_type::digest_type s = a.end_message();

Modified: sandbox/hash/libs/hash/test/pack.cpp
==============================================================================
--- sandbox/hash/libs/hash/test/pack.cpp (original)
+++ sandbox/hash/libs/hash/test/pack.cpp 2010-04-29 15:53:47 EDT (Thu, 29 Apr 2010)
@@ -8,14 +8,14 @@
 
 using boost::array;
 using namespace boost::hash;
-using namespace boost::hash::bitstream_endian;
+using namespace boost::hash::stream_endian;
 
 void test_explodebb() {
 
     {
     array<uint32_t, 2> in = {{0x01234567, 0x89ABCDEF}};
     array<uint32_t, 2> out;
- pack<big_byte_big_bit, 32, 32>(in, out);
+ pack<big_octet_big_bit, 32, 32>(in, out);
     for (unsigned i = 0; i < out.size(); ++i) printf("%.8x ", (int)out[i]);
     printf("\n");
     assert(in == out);
@@ -24,7 +24,7 @@
     {
     array<uint32_t, 2> in = {{0x01234567, 0x89ABCDEF}};
     array<uint8_t, 8> out;
- pack<big_byte_big_bit, 32, 8>(in, out);
+ pack<big_octet_big_bit, 32, 8>(in, out);
     for (unsigned i = 0; i < out.size(); ++i) printf("%.2x ", (int)out[i]);
     printf("\n");
     array<uint8_t, 8> eout = {{0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF}};
@@ -34,7 +34,7 @@
     {
     array<uint32_t, 2> in = {{0x01234567, 0x89ABCDEF}};
     array<uint16_t, 4> out;
- pack<big_byte_big_bit, 32, 16>(in, out);
+ pack<big_octet_big_bit, 32, 16>(in, out);
     for (unsigned i = 0; i < out.size(); ++i) printf("%.4x ", (int)out[i]);
     printf("\n");
     array<uint16_t, 4> eout = {{0x0123, 0x4567, 0x89AB, 0xCDEF}};
@@ -44,7 +44,7 @@
     {
     array<uint16_t, 2> in = {{0x4567, 0x89AB}};
     array<uint8_t, 4> out;
- pack<big_byte_big_bit, 16, 8>(in, out);
+ pack<big_octet_big_bit, 16, 8>(in, out);
     for (unsigned i = 0; i < out.size(); ++i) printf("%.2x ", (int)out[i]);
     printf("\n");
     array<uint8_t, 4> eout = {{0x45, 0x67, 0x89, 0xAB}};
@@ -54,7 +54,7 @@
     {
     array<uint16_t, 2> in = {{0x4567, 0x89AB}};
     array<uint8_t, 8> out;
- pack<big_byte_big_bit, 16, 4>(in, out);
+ pack<big_octet_big_bit, 16, 4>(in, out);
     for (unsigned i = 0; i < out.size(); ++i) printf("%.1x ", (int)out[i]);
     printf("\n");
     array<uint8_t, 8> eout = {{0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xA, 0xB}};
@@ -64,7 +64,7 @@
     {
     array<uint16_t, 1> in = {{0xEC15}};
     array<bool, 16> out;
- pack<big_byte_big_bit, 16, 1>(in, out);
+ pack<big_octet_big_bit, 16, 1>(in, out);
     for (unsigned i = 0; i < out.size(); ++i) printf("%.1x ", (int)out[i]);
     printf("\n");
     array<bool, 16> eout = {{true, true, true, false,
@@ -77,7 +77,7 @@
     {
     array<uint8_t, 2> in = {{0xC, 0x5}};
     array<bool, 8> out;
- pack<big_byte_big_bit, 4, 1>(in, out);
+ pack<big_octet_big_bit, 4, 1>(in, out);
     for (unsigned i = 0; i < out.size(); ++i) printf("%.1x ", (int)out[i]);
     printf("\n");
     array<bool, 8> eout = {{true, true, false, false,
@@ -88,7 +88,7 @@
     {
     array<uint16_t, 1> in = {{(31 << 10) | (17 << 5) | (4 << 0)}};
     array<uint8_t, 3> out;
- pack<big_byte_big_bit, 15, 5>(in, out);
+ pack<big_octet_big_bit, 15, 5>(in, out);
     for (unsigned i = 0; i < out.size(); ++i) printf("%.2x ", (int)out[i]);
     printf("\n");
     array<uint8_t, 3> eout = {{31, 17, 4}};
@@ -102,7 +102,7 @@
     {
     array<uint32_t, 2> in = {{0x01234567, 0x89ABCDEF}};
     array<uint32_t, 2> out;
- pack<little_byte_big_bit, 32, 32>(in, out);
+ pack<little_octet_big_bit, 32, 32>(in, out);
     for (unsigned i = 0; i < out.size(); ++i) printf("%.8x ", (int)out[i]);
     printf("\n");
     assert(in == out);
@@ -111,7 +111,7 @@
     {
     array<uint32_t, 2> in = {{0x01234567, 0x89ABCDEF}};
     array<uint8_t, 8> out;
- pack<little_byte_big_bit, 32, 8>(in, out);
+ pack<little_octet_big_bit, 32, 8>(in, out);
     for (unsigned i = 0; i < out.size(); ++i) printf("%.2x ", (int)out[i]);
     printf("\n");
     array<uint8_t, 8> eout = {{0x67, 0x45, 0x23, 0x01, 0xEF, 0xCD, 0xAB, 0x89}};
@@ -121,7 +121,7 @@
     {
     array<uint32_t, 2> in = {{0x01234567, 0x89ABCDEF}};
     array<uint16_t, 4> out;
- pack<little_byte_big_bit, 32, 16>(in, out);
+ pack<little_octet_big_bit, 32, 16>(in, out);
     for (unsigned i = 0; i < out.size(); ++i) printf("%.4x ", (int)out[i]);
     printf("\n");
     array<uint16_t, 4> eout = {{0x4567, 0x0123, 0xCDEF, 0x89AB}};
@@ -131,7 +131,7 @@
     {
     array<uint16_t, 2> in = {{0x4567, 0x89AB}};
     array<uint8_t, 4> out;
- pack<little_byte_big_bit, 16, 8>(in, out);
+ pack<little_octet_big_bit, 16, 8>(in, out);
     for (unsigned i = 0; i < out.size(); ++i) printf("%.2x ", (int)out[i]);
     printf("\n");
     array<uint8_t, 4> eout = {{0x67, 0x45, 0xAB, 0x89}};
@@ -141,7 +141,7 @@
     {
     array<uint16_t, 2> in = {{0x4567, 0x89AB}};
     array<uint8_t, 8> out;
- pack<little_byte_big_bit, 16, 4>(in, out);
+ pack<little_octet_big_bit, 16, 4>(in, out);
     for (unsigned i = 0; i < out.size(); ++i) printf("%.1x ", (int)out[i]);
     printf("\n");
     array<uint8_t, 8> eout = {{0x6, 0x7, 0x4, 0x5, 0xA, 0xB, 0x8, 0x9}};
@@ -151,7 +151,7 @@
     {
     array<uint16_t, 1> in = {{0xEC15}};
     array<bool, 16> out;
- pack<little_byte_big_bit, 16, 1>(in, out);
+ pack<little_octet_big_bit, 16, 1>(in, out);
     for (unsigned i = 0; i < out.size(); ++i) printf("%.1x ", (int)out[i]);
     printf("\n");
     array<bool, 16> eout = {{false, false, false, true,
@@ -164,7 +164,7 @@
     {
     array<uint8_t, 2> in = {{0xC, 0x5}};
     array<bool, 8> out;
- pack<little_byte_big_bit, 4, 1>(in, out);
+ pack<little_octet_big_bit, 4, 1>(in, out);
     for (unsigned i = 0; i < out.size(); ++i) printf("%.1x ", (int)out[i]);
     printf("\n");
     array<bool, 8> eout = {{true, true, false, false,
@@ -179,7 +179,7 @@
     {
     array<uint32_t, 2> in = {{0x01234567, 0x89ABCDEF}};
     array<uint32_t, 2> out;
- pack<big_byte_little_bit, 32, 32>(in, out);
+ pack<big_octet_little_bit, 32, 32>(in, out);
     for (unsigned i = 0; i < out.size(); ++i) printf("%.8x ", (int)out[i]);
     printf("\n");
     assert(in == out);
@@ -188,7 +188,7 @@
     {
     array<uint32_t, 2> in = {{0x01234567, 0x89ABCDEF}};
     array<uint8_t, 8> out;
- pack<big_byte_little_bit, 32, 8>(in, out);
+ pack<big_octet_little_bit, 32, 8>(in, out);
     for (unsigned i = 0; i < out.size(); ++i) printf("%.2x ", (int)out[i]);
     printf("\n");
     array<uint8_t, 8> eout = {{0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF}};
@@ -198,7 +198,7 @@
     {
     array<uint32_t, 2> in = {{0x01234567, 0x89ABCDEF}};
     array<uint16_t, 4> out;
- pack<big_byte_little_bit, 32, 16>(in, out);
+ pack<big_octet_little_bit, 32, 16>(in, out);
     for (unsigned i = 0; i < out.size(); ++i) printf("%.4x ", (int)out[i]);
     printf("\n");
     array<uint16_t, 4> eout = {{0x0123, 0x4567, 0x89AB, 0xCDEF}};
@@ -208,7 +208,7 @@
     {
     array<uint16_t, 2> in = {{0x4567, 0x89AB}};
     array<uint8_t, 4> out;
- pack<big_byte_little_bit, 16, 8>(in, out);
+ pack<big_octet_little_bit, 16, 8>(in, out);
     for (unsigned i = 0; i < out.size(); ++i) printf("%.2x ", (int)out[i]);
     printf("\n");
     array<uint8_t, 4> eout = {{0x45, 0x67, 0x89, 0xAB}};
@@ -218,7 +218,7 @@
     {
     array<uint16_t, 2> in = {{0x4567, 0x89AB}};
     array<uint8_t, 8> out;
- pack<big_byte_little_bit, 16, 4>(in, out);
+ pack<big_octet_little_bit, 16, 4>(in, out);
     for (unsigned i = 0; i < out.size(); ++i) printf("%.1x ", (int)out[i]);
     printf("\n");
     array<uint8_t, 8> eout = {{0x5, 0x4, 0x7, 0x6, 0x9, 0x8, 0xB, 0xA}};
@@ -228,7 +228,7 @@
     {
     array<uint16_t, 1> in = {{0xEC15}};
     array<bool, 16> out;
- pack<big_byte_little_bit, 16, 1>(in, out);
+ pack<big_octet_little_bit, 16, 1>(in, out);
     for (unsigned i = 0; i < out.size(); ++i) printf("%.1x ", (int)out[i]);
     printf("\n");
     array<bool, 16> eout = {{false, false, true, true,
@@ -241,7 +241,7 @@
     {
     array<uint8_t, 2> in = {{0xC, 0x5}};
     array<bool, 8> out;
- pack<big_byte_little_bit, 4, 1>(in, out);
+ pack<big_octet_little_bit, 4, 1>(in, out);
     for (unsigned i = 0; i < out.size(); ++i) printf("%.1x ", (int)out[i]);
     printf("\n");
     array<bool, 8> eout = {{false, false, true, true,
@@ -256,7 +256,7 @@
     {
     array<uint32_t, 2> in = {{0x01234567, 0x89ABCDEF}};
     array<uint32_t, 2> out;
- pack<little_byte_little_bit, 32, 32>(in, out);
+ pack<little_octet_little_bit, 32, 32>(in, out);
     for (unsigned i = 0; i < out.size(); ++i) printf("%.8x ", (int)out[i]);
     printf("\n");
     assert(in == out);
@@ -265,7 +265,7 @@
     {
     array<uint32_t, 2> in = {{0x01234567, 0x89ABCDEF}};
     array<uint8_t, 8> out;
- pack<little_byte_little_bit, 32, 8>(in, out);
+ pack<little_octet_little_bit, 32, 8>(in, out);
     for (unsigned i = 0; i < out.size(); ++i) printf("%.2x ", (int)out[i]);
     printf("\n");
     array<uint8_t, 8> eout = {{0x67, 0x45, 0x23, 0x01, 0xEF, 0xCD, 0xAB, 0x89}};
@@ -275,7 +275,7 @@
     {
     array<uint32_t, 2> in = {{0x01234567, 0x89ABCDEF}};
     array<uint16_t, 4> out;
- pack<little_byte_little_bit, 32, 16>(in, out);
+ pack<little_octet_little_bit, 32, 16>(in, out);
     for (unsigned i = 0; i < out.size(); ++i) printf("%.4x ", (int)out[i]);
     printf("\n");
     array<uint16_t, 4> eout = {{0x4567, 0x0123, 0xCDEF, 0x89AB}};
@@ -285,7 +285,7 @@
     {
     array<uint16_t, 2> in = {{0x4567, 0x89AB}};
     array<uint8_t, 4> out;
- pack<little_byte_little_bit, 16, 8>(in, out);
+ pack<little_octet_little_bit, 16, 8>(in, out);
     for (unsigned i = 0; i < out.size(); ++i) printf("%.2x ", (int)out[i]);
     printf("\n");
     array<uint8_t, 4> eout = {{0x67, 0x45, 0xAB, 0x89}};
@@ -295,7 +295,7 @@
     {
     array<uint16_t, 2> in = {{0x4567, 0x89AB}};
     array<uint8_t, 8> out;
- pack<little_byte_little_bit, 16, 4>(in, out);
+ pack<little_octet_little_bit, 16, 4>(in, out);
     for (unsigned i = 0; i < out.size(); ++i) printf("%.1x ", (int)out[i]);
     printf("\n");
     array<uint8_t, 8> eout = {{0x7, 0x6, 0x5, 0x4, 0xB, 0xA, 0x9, 0x8}};
@@ -305,7 +305,7 @@
     {
     array<uint16_t, 1> in = {{0xEC15}};
     array<bool, 16> out;
- pack<little_byte_little_bit, 16, 1>(in, out);
+ pack<little_octet_little_bit, 16, 1>(in, out);
     for (unsigned i = 0; i < out.size(); ++i) printf("%.1x ", (int)out[i]);
     printf("\n");
     array<bool, 16> eout = {{true, false, true, false,
@@ -318,7 +318,7 @@
     {
     array<uint8_t, 2> in = {{0xC, 0x5}};
     array<bool, 8> out;
- pack<little_byte_little_bit, 4, 1>(in, out);
+ pack<little_octet_little_bit, 4, 1>(in, out);
     for (unsigned i = 0; i < out.size(); ++i) printf("%.1x ", (int)out[i]);
     printf("\n");
     array<bool, 8> eout = {{false, false, true, true,
@@ -329,7 +329,7 @@
     {
     array<uint16_t, 1> in = {{(31 << 10) | (17 << 5) | (4 << 0)}};
     array<uint8_t, 3> out;
- pack<little_byte_little_bit, 15, 5>(in, out);
+ pack<little_octet_little_bit, 15, 5>(in, out);
     for (unsigned i = 0; i < out.size(); ++i) printf("%.2x ", (int)out[i]);
     printf("\n");
     array<uint8_t, 3> eout = {{4, 17, 31}};
@@ -343,7 +343,7 @@
     {
     array<uint32_t, 2> in = {{0x01234567, 0x89ABCDEF}};
     array<uint32_t, 2> out;
- pack<big_byte_big_bit, 32, 32>(in, out);
+ pack<big_octet_big_bit, 32, 32>(in, out);
     for (unsigned i = 0; i < out.size(); ++i) printf("%.8x ", (int)out[i]);
     printf("\n");
     assert(in == out);
@@ -352,7 +352,7 @@
     {
     array<uint8_t, 8> in = {{0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF}};
     array<uint32_t, 2> out;
- pack<big_byte_big_bit, 8, 32>(in, out);
+ pack<big_octet_big_bit, 8, 32>(in, out);
     for (unsigned i = 0; i < out.size(); ++i) printf("%.8x ", (int)out[i]);
     printf("\n");
     array<uint32_t, 2> eout = {{0x01234567, 0x89ABCDEF}};
@@ -362,7 +362,7 @@
     {
     array<uint16_t, 4> in = {{0x0123, 0x4567, 0x89AB, 0xCDEF}};
     array<uint32_t, 2> out;
- pack<big_byte_big_bit, 16, 32>(in, out);
+ pack<big_octet_big_bit, 16, 32>(in, out);
     for (unsigned i = 0; i < out.size(); ++i) printf("%.8x ", (int)out[i]);
     printf("\n");
     array<uint32_t, 2> eout = {{0x01234567, 0x89ABCDEF}};
@@ -372,7 +372,7 @@
     {
     array<uint8_t, 4> in = {{0x45, 0x67, 0x89, 0xAB}};
     array<uint16_t, 2> out;
- pack<big_byte_big_bit, 8, 16>(in, out);
+ pack<big_octet_big_bit, 8, 16>(in, out);
     for (unsigned i = 0; i < out.size(); ++i) printf("%.4x ", (int)out[i]);
     printf("\n");
     array<uint16_t, 2> eout = {{0x4567, 0x89AB}};
@@ -382,7 +382,7 @@
     {
     array<uint8_t, 8> in = {{0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xA, 0xB}};
     array<uint16_t, 2> out;
- pack<big_byte_big_bit, 4, 16>(in, out);
+ pack<big_octet_big_bit, 4, 16>(in, out);
     for (unsigned i = 0; i < out.size(); ++i) printf("%.4x ", (int)out[i]);
     printf("\n");
     array<uint16_t, 2> eout = {{0x4567, 0x89AB}};
@@ -395,7 +395,7 @@
                            false, false, false, true,
                            false, true, false, true}};
     array<uint16_t, 1> out;
- pack<big_byte_big_bit, 1, 16>(in, out);
+ pack<big_octet_big_bit, 1, 16>(in, out);
     for (unsigned i = 0; i < out.size(); ++i) printf("%.4x ", (int)out[i]);
     printf("\n");
     array<uint16_t, 1> eout = {{0xEC15}};
@@ -406,7 +406,7 @@
     array<bool, 8> in = {{true, true, false, false,
                           false, true, false, true}};
     array<uint8_t, 2> out;
- pack<big_byte_big_bit, 1, 4>(in, out);
+ pack<big_octet_big_bit, 1, 4>(in, out);
     for (unsigned i = 0; i < out.size(); ++i) printf("%.1x ", (int)out[i]);
     printf("\n");
     array<uint8_t, 2> eout = {{0xC, 0x5}};
@@ -416,7 +416,7 @@
     {
     array<uint8_t, 3> in = {{31, 17, 4}};
     array<uint16_t, 1> out;
- pack<big_byte_big_bit, 5, 15>(in, out);
+ pack<big_octet_big_bit, 5, 15>(in, out);
     for (unsigned i = 0; i < out.size(); ++i) printf("%.4x ", (int)out[i]);
     printf("\n");
     array<uint16_t, 1> eout = {{(31 << 10) | (17 << 5) | (4 << 0)}};
@@ -430,7 +430,7 @@
     {
     array<uint32_t, 2> in = {{0x01234567, 0x89ABCDEF}};
     array<uint32_t, 2> out;
- pack<little_byte_big_bit, 32, 32>(in, out);
+ pack<little_octet_big_bit, 32, 32>(in, out);
     for (unsigned i = 0; i < out.size(); ++i) printf("%.8x ", (int)out[i]);
     printf("\n");
     assert(in == out);
@@ -439,7 +439,7 @@
     {
     array<uint8_t, 8> in = {{0x67, 0x45, 0x23, 0x01, 0xEF, 0xCD, 0xAB, 0x89}};
     array<uint32_t, 2> out;
- pack<little_byte_big_bit, 8, 32>(in, out);
+ pack<little_octet_big_bit, 8, 32>(in, out);
     for (unsigned i = 0; i < out.size(); ++i) printf("%.8x ", (int)out[i]);
     printf("\n");
     array<uint32_t, 2> eout = {{0x01234567, 0x89ABCDEF}};
@@ -449,7 +449,7 @@
     {
     array<uint16_t, 4> in = {{0x4567, 0x0123, 0xCDEF, 0x89AB}};
     array<uint32_t, 2> out;
- pack<little_byte_big_bit, 16, 32>(in, out);
+ pack<little_octet_big_bit, 16, 32>(in, out);
     for (unsigned i = 0; i < out.size(); ++i) printf("%.8x ", (int)out[i]);
     printf("\n");
     array<uint32_t, 2> eout = {{0x01234567, 0x89ABCDEF}};
@@ -459,7 +459,7 @@
     {
     array<uint8_t, 4> in = {{0x67, 0x45, 0xAB, 0x89}};
     array<uint16_t, 2> out;
- pack<little_byte_big_bit, 8, 16>(in, out);
+ pack<little_octet_big_bit, 8, 16>(in, out);
     for (unsigned i = 0; i < out.size(); ++i) printf("%.4x ", (int)out[i]);
     printf("\n");
     array<uint16_t, 2> eout = {{0x4567, 0x89AB}};
@@ -469,7 +469,7 @@
     {
     array<uint8_t, 8> in = {{0x6, 0x7, 0x4, 0x5, 0xA, 0xB, 0x8, 0x9}};
     array<uint16_t, 2> out;
- pack<little_byte_big_bit, 4, 16>(in, out);
+ pack<little_octet_big_bit, 4, 16>(in, out);
     for (unsigned i = 0; i < out.size(); ++i) printf("%.4x ", (int)out[i]);
     printf("\n");
     array<uint16_t, 2> eout = {{0x4567, 0x89AB}};
@@ -482,7 +482,7 @@
                            true, true, true, false,
                            true, true, false, false}};
     array<uint16_t, 1> out;
- pack<little_byte_big_bit, 1, 16>(in, out);
+ pack<little_octet_big_bit, 1, 16>(in, out);
     for (unsigned i = 0; i < out.size(); ++i) printf("%.1x ", (int)out[i]);
     printf("\n");
     array<uint16_t, 1> eout = {{0xEC15}};
@@ -493,7 +493,7 @@
     array<bool, 8> in = {{true, true, false, false,
                           false, true, false, true}};
     array<uint8_t, 2> out;
- pack<little_byte_big_bit, 1, 4>(in, out);
+ pack<little_octet_big_bit, 1, 4>(in, out);
     for (unsigned i = 0; i < out.size(); ++i) printf("%.1x ", (int)out[i]);
     printf("\n");
     array<uint8_t, 2> eout = {{0xC, 0x5}};
@@ -507,7 +507,7 @@
     {
     array<uint32_t, 2> in = {{0x01234567, 0x89ABCDEF}};
     array<uint32_t, 2> out;
- pack<big_byte_little_bit, 32, 32>(in, out);
+ pack<big_octet_little_bit, 32, 32>(in, out);
     for (unsigned i = 0; i < out.size(); ++i) printf("%.8x ", (int)out[i]);
     printf("\n");
     assert(in == out);
@@ -516,7 +516,7 @@
     {
     array<uint8_t, 8> in = {{0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF}};
     array<uint32_t, 2> out;
- pack<big_byte_little_bit, 8, 32>(in, out);
+ pack<big_octet_little_bit, 8, 32>(in, out);
     for (unsigned i = 0; i < out.size(); ++i) printf("%.8x ", (int)out[i]);
     printf("\n");
     array<uint32_t, 2> eout = {{0x01234567, 0x89ABCDEF}};
@@ -526,7 +526,7 @@
     {
     array<uint16_t, 4> in = {{0x0123, 0x4567, 0x89AB, 0xCDEF}};
     array<uint32_t, 2> out;
- pack<big_byte_little_bit, 16, 32>(in, out);
+ pack<big_octet_little_bit, 16, 32>(in, out);
     for (unsigned i = 0; i < out.size(); ++i) printf("%.8x ", (int)out[i]);
     printf("\n");
     array<uint32_t, 2> eout = {{0x01234567, 0x89ABCDEF}};
@@ -536,7 +536,7 @@
     {
     array<uint8_t, 4> in = {{0x45, 0x67, 0x89, 0xAB}};
     array<uint16_t, 2> out;
- pack<big_byte_little_bit, 8, 16>(in, out);
+ pack<big_octet_little_bit, 8, 16>(in, out);
     for (unsigned i = 0; i < out.size(); ++i) printf("%.4x ", (int)out[i]);
     printf("\n");
     array<uint16_t, 2> eout = {{0x4567, 0x89AB}};
@@ -546,7 +546,7 @@
     {
     array<uint8_t, 8> in = {{0x5, 0x4, 0x7, 0x6, 0x9, 0x8, 0xB, 0xA}};
     array<uint16_t, 2> out;
- pack<big_byte_little_bit, 4, 16>(in, out);
+ pack<big_octet_little_bit, 4, 16>(in, out);
     for (unsigned i = 0; i < out.size(); ++i) printf("%.4x ", (int)out[i]);
     printf("\n");
     array<uint16_t, 2> eout = {{0x4567, 0x89AB}};
@@ -559,7 +559,7 @@
                            true, false, true, false,
                            true, false, false, false}};
     array<uint16_t, 1> out;
- pack<big_byte_little_bit, 1, 16>(in, out);
+ pack<big_octet_little_bit, 1, 16>(in, out);
     for (unsigned i = 0; i < out.size(); ++i) printf("%.4x ", (int)out[i]);
     printf("\n");
     array<uint16_t, 1> eout = {{0xEC15}};
@@ -570,7 +570,7 @@
     array<bool, 8> in = {{false, false, true, true,
                           true, false, true, false}};
     array<uint8_t, 2> out;
- pack<big_byte_little_bit, 1, 4>(in, out);
+ pack<big_octet_little_bit, 1, 4>(in, out);
     for (unsigned i = 0; i < out.size(); ++i) printf("%.1x ", (int)out[i]);
     printf("\n");
     array<uint8_t, 2> eout = {{0xC, 0x5}};
@@ -584,7 +584,7 @@
     {
     array<uint32_t, 2> in = {{0x01234567, 0x89ABCDEF}};
     array<uint32_t, 2> out;
- pack<little_byte_little_bit, 32, 32>(in, out);
+ pack<little_octet_little_bit, 32, 32>(in, out);
     for (unsigned i = 0; i < out.size(); ++i) printf("%.8x ", (int)out[i]);
     printf("\n");
     assert(in == out);
@@ -593,7 +593,7 @@
     {
     array<uint8_t, 8> in = {{0x67, 0x45, 0x23, 0x01, 0xEF, 0xCD, 0xAB, 0x89}};
     array<uint32_t, 2> out;
- pack<little_byte_little_bit, 8, 32>(in, out);
+ pack<little_octet_little_bit, 8, 32>(in, out);
     for (unsigned i = 0; i < out.size(); ++i) printf("%.8x ", (int)out[i]);
     printf("\n");
     array<uint32_t, 2> eout = {{0x01234567, 0x89ABCDEF}};
@@ -603,7 +603,7 @@
     {
     array<uint16_t, 4> in = {{0x4567, 0x0123, 0xCDEF, 0x89AB}};
     array<uint32_t, 2> out;
- pack<little_byte_little_bit, 16, 32>(in, out);
+ pack<little_octet_little_bit, 16, 32>(in, out);
     for (unsigned i = 0; i < out.size(); ++i) printf("%.8x ", (int)out[i]);
     printf("\n");
     array<uint32_t, 2> eout = {{0x01234567, 0x89ABCDEF}};
@@ -613,7 +613,7 @@
     {
     array<uint8_t, 4> in = {{0x67, 0x45, 0xAB, 0x89}};
     array<uint16_t, 2> out;
- pack<little_byte_little_bit, 8, 16>(in, out);
+ pack<little_octet_little_bit, 8, 16>(in, out);
     for (unsigned i = 0; i < out.size(); ++i) printf("%.4x ", (int)out[i]);
     printf("\n");
     array<uint16_t, 2> eout = {{0x4567, 0x89AB}};
@@ -623,7 +623,7 @@
     {
     array<uint8_t, 8> in = {{0x7, 0x6, 0x5, 0x4, 0xB, 0xA, 0x9, 0x8}};
     array<uint16_t, 2> out;
- pack<little_byte_little_bit, 4, 16>(in, out);
+ pack<little_octet_little_bit, 4, 16>(in, out);
     for (unsigned i = 0; i < out.size(); ++i) printf("%.4x ", (int)out[i]);
     printf("\n");
     array<uint16_t, 2> eout = {{0x4567, 0x89AB}};
@@ -636,7 +636,7 @@
                            false, false, true, true,
                            false, true, true, true}};
     array<uint16_t, 1> out;
- pack<little_byte_little_bit, 1, 16>(in, out);
+ pack<little_octet_little_bit, 1, 16>(in, out);
     for (unsigned i = 0; i < out.size(); ++i) printf("%.4x ", (int)out[i]);
     printf("\n");
     array<uint16_t, 1> eout = {{0xEC15}};
@@ -647,7 +647,7 @@
     array<bool, 8> in = {{false, false, true, true,
                           true, false, true, false}};
     array<uint8_t, 2> out;
- pack<little_byte_little_bit, 1, 4>(in, out);
+ pack<little_octet_little_bit, 1, 4>(in, out);
     for (unsigned i = 0; i < out.size(); ++i) printf("%.1x ", (int)out[i]);
     printf("\n");
     array<uint8_t, 2> eout = {{0xC, 0x5}};
@@ -657,7 +657,7 @@
     {
     array<uint8_t, 3> in = {{4, 17, 31}};
     array<uint16_t, 1> out;
- pack<little_byte_little_bit, 5, 15>(in, out);
+ pack<little_octet_little_bit, 5, 15>(in, out);
     for (unsigned i = 0; i < out.size(); ++i) printf("%.4x ", (int)out[i]);
     printf("\n");
     array<uint16_t, 1> eout = {{(31 << 10) | (17 << 5) | (4 << 0)}};

Modified: sandbox/hash/libs/hash/test/shacal.cpp
==============================================================================
--- sandbox/hash/libs/hash/test/shacal.cpp (original)
+++ sandbox/hash/libs/hash/test/shacal.cpp 2010-04-29 15:53:47 EDT (Thu, 29 Apr 2010)
@@ -76,7 +76,7 @@
                 owcft,
                 boost::hash::digest_from_state<
                     boost::hash::digest<160>,
- boost::hash::bitstream_endian::big_byte_big_bit>
+ boost::hash::stream_endian::big_octet_big_bit>
> bht;
 
     {
@@ -162,7 +162,7 @@
                 owcft,
                 boost::hash::digest_from_state<
                     boost::hash::digest<256>,
- boost::hash::bitstream_endian::big_byte_big_bit>
+ boost::hash::stream_endian::big_octet_big_bit>
> bht;
 
     {
@@ -183,21 +183,21 @@
     typedef merkle_damgard_block_hash<
                 detail::sha1_policy::iv_generator,
                 davies_meyer_compressor<block_cyphers::shacal1, state_adder>,
- digest_from_state<digest<160>, bitstream_endian::big_byte_big_bit>
+ digest_from_state<digest<160>, stream_endian::big_octet_big_bit>
> block_hash_type;
     typedef stream_preprocessor<
- bitstream_endian::big_byte_big_bit,
+ stream_endian::big_octet_big_bit,
                 8,
                 block_hash_type::word_bits * 2,
                 block_hash_type
- > sha1_byte_hash;
- typedef sha1_byte_hash::digest_type digest_type;
+ > sha1_octet_hash;
+ typedef sha1_octet_hash::digest_type digest_type;
 
 #ifndef BOOST_HASH_SHOW_PROGRESS
 #ifndef QUICK
     {
     // perl -e 'for ($x = 1000000000; $x--;) {print "a";}' | sha1sum
- sha1_byte_hash h;
+ sha1_octet_hash h;
     for (unsigned n = 1000000000; n--; ) h.update('a');
     digest_type d = h.end_message();
     printf("%s\n", d.cstring().data());
@@ -214,18 +214,18 @@
     typedef merkle_damgard_block_hash<
                 detail::sha2_policy<SHA>::iv_generator,
                 davies_meyer_compressor<block_cyphers::shacal2<SHA>, state_adder>,
- digest_from_state<digest<SHA>, bitstream_endian::big_byte_big_bit>
+ digest_from_state<digest<SHA>, stream_endian::big_octet_big_bit>
> block_hash_type;
     typedef stream_preprocessor<
- bitstream_endian::big_byte_big_bit,
+ stream_endian::big_octet_big_bit,
                 8,
                 block_hash_type::word_bits * 2,
                 block_hash_type
- > sha512_byte_hash;
- typedef sha512_byte_hash::digest_type digest_type;
+ > sha512_octet_hash;
+ typedef sha512_octet_hash::digest_type digest_type;
 
     {
- sha512_byte_hash h;
+ sha512_octet_hash h;
     digest_type d = h.end_message();
     printf("%s\n", d.cstring().data());
     char const *ed = "cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce"
@@ -234,7 +234,7 @@
     }
 
     {
- sha512_byte_hash h;
+ sha512_octet_hash h;
     h.update('a').update('b').update('c');
     digest_type d = h.end_message();
     printf("%s\n", d.cstring().data());
@@ -244,7 +244,7 @@
     }
 
     {
- sha512_byte_hash h;
+ sha512_octet_hash h;
     char const *m = "abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmn"
                     "hijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu";
     for (char const *p = m; *p; ++p) {
@@ -259,7 +259,7 @@
 
 #ifndef BOOST_HASH_SHOW_PROGRESS
     {
- sha512_byte_hash h;
+ sha512_octet_hash h;
     for (unsigned n = 1000000; n--; ) h.update('a');
     digest_type d = h.end_message();
     printf("%s\n", d.cstring().data());
@@ -271,7 +271,7 @@
 #ifndef QUICK
     {
     // perl -e 'for ($x = 1000000000; $x--;) {print "a";}' | sha512sum
- sha512_byte_hash h;
+ sha512_octet_hash h;
     for (unsigned n = 1000000000; n--; ) h.update('a');
     digest_type d = h.end_message();
     printf("%s\n", d.cstring().data());

Modified: sandbox/hash/libs/hash/test/threefish.cpp
==============================================================================
--- sandbox/hash/libs/hash/test/threefish.cpp (original)
+++ sandbox/hash/libs/hash/test/threefish.cpp 2010-04-29 15:53:47 EDT (Thu, 29 Apr 2010)
@@ -9,7 +9,7 @@
 template <typename digest_type, typename state_type>
 digest_type to_digest(state_type state) {
     return digest_type::template from_state<
- boost::hash::bitstream_endian::little_byte_big_bit,
+ boost::hash::stream_endian::little_octet_big_bit,
                state_type::static_size*64,
                64
>(state);


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk