6 #if CRYPTOPP_MSC_VERSION 7 # pragma warning(disable: 4100) 10 #if CRYPTOPP_GCC_DIAGNOSTIC_AVAILABLE 11 # pragma GCC diagnostic ignored "-Wunused-value" 14 #ifndef CRYPTOPP_IMPORTS 24 parameters.GetRequiredParameter(
"BaseN_Encoder", Name::EncodingLookupArray(), m_alphabet);
26 parameters.GetRequiredIntParameter(
"BaseN_Encoder", Name::Log2Base(), m_bitsPerChar);
27 if (m_bitsPerChar <= 0 || m_bitsPerChar >= 8)
28 throw InvalidArgument(
"BaseN_Encoder: Log2Base must be between 1 and 7 inclusive");
32 if (parameters.GetValue(Name::PaddingByte(), padding))
33 pad = parameters.GetValueWithDefault(Name::Pad(),
true);
36 m_padding = pad ? padding : -1;
38 m_bytePos = m_bitPos = 0;
41 while (i%m_bitsPerChar != 0)
43 m_outputBlockSize = i/m_bitsPerChar;
45 m_outBuf.New(m_outputBlockSize);
63 if (bitsLeftInSource >= bitsLeftInTarget)
67 bitsLeftInSource -= bitsLeftInTarget;
68 if (bitsLeftInSource == 0)
70 b <<= bitsLeftInTarget;
120 if (m_bitsPerChar <= 0 || m_bitsPerChar >= 8)
121 throw InvalidArgument(
"BaseN_Decoder: Log2Base must be between 1 and 7 inclusive");
157 while (m_bitPos >= 8)
180 std::fill(lookup, lookup+256, -1);
182 for (
unsigned int i=0; i<base; i++)
184 if (caseInsensitive && isalpha(alphabet[i]))
187 lookup[toupper(alphabet[i])] = i;
189 lookup[tolower(alphabet[i])] = i;
194 lookup[alphabet[i]] = i;
206 parameters.
GetValue(Name::Separator(), separator);
207 parameters.
GetValue(Name::Terminator(), terminator);
209 m_separator.Assign(separator.
begin(), separator.
size());
210 m_terminator.Assign(terminator.
begin(), terminator.
size());
221 if (m_counter == m_groupSize)
239 FILTER_OUTPUT(4, m_terminator, m_terminator.size(), messageEnd);
Used to pass byte array input as part of a NameValuePairs object.
An invalid argument was detected.
#define FILTER_OUTPUT2(site, statement, output, length, messageEnd)
#define FILTER_END_NO_MESSAGE_END
void GetRequiredParameter(const char *className, const char *name, T &value) const
Retrieves a required name/value pair.
CRYPTOPP_DLL void GetRequiredIntParameter(const char *className, const char *name, int &value) const
Retrieves a required name/value pair.
#define FILTER_OUTPUT(site, output, length, messageEnd)
#define NAMESPACE_BEGIN(x)
size_t size() const
Length of the memory block.
Library configuration file.
void New(size_type newSize)
Change size without preserving contents.
const byte * begin() const
Pointer to the first byte in the memory block.
static void CRYPTOPP_API InitializeDecodingLookupArray(int *lookup, const byte *alphabet, unsigned int base, bool caseInsensitive)
Initializes BaseN lookup array.
void IsolatedInitialize(const NameValuePairs ¶meters)
Initialize or reinitialize this object, without signal propagation.
bool GetValue(const char *name, T &value) const
Get a named value.
void IsolatedInitialize(const NameValuePairs ¶meters)
Initialize or reinitialize this object, without signal propagation.
CRYPTOPP_DLL int GetIntValueWithDefault(const char *name, int defaultValue) const
Get a named value with type int, with default.
size_t Put2(const byte *begin, size_t length, int messageEnd, bool blocking)
Input multiple bytes for processing.
const T & STDMIN(const T &a, const T &b)
Replacement function for std::min.
#define CRYPTOPP_ASSERT(exp)
size_t Put2(const byte *begin, size_t length, int messageEnd, bool blocking)
Input multiple bytes for processing.
std::vector< char * > parameters
Encoder for bases that are a power of 2.
Base classes for working with encoders and decoders.
size_t Put2(const byte *begin, size_t length, int messageEnd, bool blocking)
Input multiple bytes for processing.
Interface for retrieving values given their names.