File indexing completed on 2024-05-12 04:45:14
0001 /* 0002 Copyright (C) 1999-2007 The Botan Project. All rights reserved. 0003 0004 Redistribution and use in source and binary forms, for any use, with or without 0005 modification, is permitted provided that the following conditions are met: 0006 0007 1. Redistributions of source code must retain the above copyright notice, this 0008 list of conditions, and the following disclaimer. 0009 0010 2. Redistributions in binary form must reproduce the above copyright notice, 0011 this list of conditions, and the following disclaimer in the documentation 0012 and/or other materials provided with the distribution. 0013 0014 THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) "AS IS" AND ANY EXPRESS OR IMPLIED 0015 WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 0016 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE DISCLAIMED. 0017 0018 IN NO EVENT SHALL THE AUTHOR(S) OR CONTRIBUTOR(S) BE LIABLE FOR ANY DIRECT, 0019 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 0020 BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 0021 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 0022 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 0023 OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 0024 ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 0025 */ 0026 // LICENSEHEADER_END 0027 namespace QCA { // WRAPNS_LINE 0028 /************************************************* 0029 * Exceptions Source File * 0030 * (C) 1999-2007 The Botan Project * 0031 *************************************************/ 0032 0033 } // WRAPNS_LINE 0034 #include <botan/exceptn.h> 0035 namespace QCA { // WRAPNS_LINE 0036 } // WRAPNS_LINE 0037 #include <botan/parsing.h> 0038 namespace QCA { // WRAPNS_LINE 0039 0040 namespace Botan { 0041 0042 /************************************************* 0043 * Constructor for Invalid_Key_Length * 0044 *************************************************/ 0045 Invalid_Key_Length::Invalid_Key_Length(const std::string &name, u32bit length) 0046 { 0047 set_msg(name + " cannot accept a key of length " + to_string(length)); 0048 } 0049 0050 /************************************************* 0051 * Constructor for Invalid_Block_Size * 0052 *************************************************/ 0053 Invalid_Block_Size::Invalid_Block_Size(const std::string &mode, const std::string &pad) 0054 { 0055 set_msg("Padding method " + pad + " cannot be used with " + mode); 0056 } 0057 0058 /************************************************* 0059 * Constructor for Invalid_IV_Length * 0060 *************************************************/ 0061 Invalid_IV_Length::Invalid_IV_Length(const std::string &mode, u32bit bad_len) 0062 { 0063 set_msg("IV length " + to_string(bad_len) + " is invalid for " + mode); 0064 } 0065 0066 /************************************************* 0067 * Constructor for Invalid_Message_Number * 0068 *************************************************/ 0069 Invalid_Message_Number::Invalid_Message_Number(const std::string &where, u32bit message_no) 0070 { 0071 set_msg("Pipe::" + where + ": Invalid message number " + to_string(message_no)); 0072 } 0073 0074 /************************************************* 0075 * Constructor for Algorithm_Not_Found * 0076 *************************************************/ 0077 Algorithm_Not_Found::Algorithm_Not_Found(const std::string &name) 0078 { 0079 set_msg("Could not find any algorithm named \"" + name + "\""); 0080 } 0081 0082 /************************************************* 0083 * Constructor for Invalid_Algorithm_Name * 0084 *************************************************/ 0085 Invalid_Algorithm_Name::Invalid_Algorithm_Name(const std::string &name) 0086 { 0087 set_msg("Invalid algorithm name: " + name); 0088 } 0089 0090 /************************************************* 0091 * Constructor for Config_Error * 0092 *************************************************/ 0093 Config_Error::Config_Error(const std::string &err, u32bit line) 0094 { 0095 set_msg("Config error at line " + to_string(line) + ": " + err); 0096 } 0097 0098 } 0099 } // WRAPNS_LINE