aboutsummaryrefslogtreecommitdiffstats
path: root/src/utils/loadstor.h
diff options
context:
space:
mode:
authorlloyd <[email protected]>2009-03-30 18:27:18 +0000
committerlloyd <[email protected]>2009-03-30 18:27:18 +0000
commit96d6eb6f29c55e16a37cf11899547886f735b065 (patch)
tree9f13901e9b44c98d58b2589c9b09c6a7443eb7cd /src/utils/loadstor.h
parent3cc3dd72c5f87b76852a55c1f2d1821dba967d8c (diff)
Thomas Moschny passed along a request from the Fedora packagers which came
up during the Fedora submission review, that each source file include some text about the license. One handy Perl script later and each file now has the line Distributed under the terms of the Botan license after the copyright notices. While I was in there modifying every file anyway, I also stripped out the remainder of the block comments (lots of astericks before and after the text); this is stylistic thing I picked up when I was first learning C++ but in retrospect it is not a good style as the structure makes it harder to modify comments (with the result that comments become fewer, shorter and are less likely to be updated, which are not good things).
Diffstat (limited to 'src/utils/loadstor.h')
-rw-r--r--src/utils/loadstor.h36
1 files changed, 19 insertions, 17 deletions
diff --git a/src/utils/loadstor.h b/src/utils/loadstor.h
index 0bcafe411..77ed1554e 100644
--- a/src/utils/loadstor.h
+++ b/src/utils/loadstor.h
@@ -1,8 +1,10 @@
-/*************************************************
-* Load/Store Operators Header File *
-* (C) 1999-2007 Jack Lloyd *
-* 2007 Yves Jerschow *
-*************************************************/
+/*
+* Load/Store Operators
+* (C) 1999-2007 Jack Lloyd
+* 2007 Yves Jerschow
+*
+* Distributed under the terms of the Botan license
+*/
#ifndef BOTAN_LOAD_STORE_H__
#define BOTAN_LOAD_STORE_H__
@@ -35,17 +37,17 @@
namespace Botan {
-/*************************************************
-* Byte Extraction Function *
-*************************************************/
+/*
+* Byte Extraction Function
+*/
template<typename T> inline byte get_byte(u32bit byte_num, T input)
{
return (input >> ((sizeof(T)-1-(byte_num&(sizeof(T)-1))) << 3));
}
-/*************************************************
-* Byte to Word Conversions *
-*************************************************/
+/*
+* Byte to Word Conversions
+*/
inline u16bit make_u16bit(byte i0, byte i1)
{
return ((static_cast<u16bit>(i0) << 8) | i1);
@@ -72,9 +74,9 @@ inline u64bit make_u64bit(byte i0, byte i1, byte i2, byte i3,
(static_cast<u64bit>(i7)));
}
-/*************************************************
-* Endian-Specific Word Loading Operations *
-*************************************************/
+/*
+* Endian-Specific Word Loading Operations
+*/
template<typename T>
inline T load_be(const byte in[], u32bit off)
{
@@ -163,9 +165,9 @@ inline u64bit load_le<u64bit>(const byte in[], u32bit off)
#endif
}
-/*************************************************
-* Endian-Specific Word Storing Operations *
-*************************************************/
+/*
+* Endian-Specific Word Storing Operations
+*/
inline void store_be(u16bit in, byte out[2])
{
#if BOTAN_TARGET_UNALIGNED_LOADSTOR_OK