monotone

monotone Mtn Source Tree

Root/botan/exceptn.cpp

1/*************************************************
2* Exceptions Source File *
3* (C) 1999-2006 The Botan Project *
4*************************************************/
5
6#include <botan/exceptn.h>
7#include <botan/parsing.h>
8
9namespace Botan {
10
11/*************************************************
12* Constructor for Invalid_Key_Length *
13*************************************************/
14Invalid_Key_Length::Invalid_Key_Length(const std::string& name, u32bit length)
15 {
16 set_msg(name + " cannot accept a key of length " + to_string(length));
17 }
18
19/*************************************************
20* Constructor for Invalid_Block_Size *
21*************************************************/
22Invalid_Block_Size::Invalid_Block_Size(const std::string& mode,
23 const std::string& pad)
24 {
25 set_msg("Padding method " + pad + " cannot be used with " + mode);
26 }
27
28/*************************************************
29* Constructor for Invalid_IV_Length *
30*************************************************/
31Invalid_IV_Length::Invalid_IV_Length(const std::string& mode, u32bit bad_len)
32 {
33 set_msg("IV length " + to_string(bad_len) + " is invalid for " + mode);
34 }
35
36/*************************************************
37* Constructor for Invalid_Message_Number *
38*************************************************/
39Invalid_Message_Number::Invalid_Message_Number(const std::string& where,
40 u32bit message_no)
41 {
42 set_msg("Pipe::" + where + ": Invalid message number " +
43 to_string(message_no));
44 }
45
46/*************************************************
47* Constructor for Algorithm_Not_Found *
48*************************************************/
49Algorithm_Not_Found::Algorithm_Not_Found(const std::string& name)
50 {
51 set_msg("Could not find any algorithm named \"" + name + "\"");
52 }
53
54/*************************************************
55* Constructor for Invalid_Algorithm_Name *
56*************************************************/
57Invalid_Algorithm_Name::Invalid_Algorithm_Name(const std::string& name)
58 {
59 set_msg("Invalid algorithm name: " + name);
60 }
61
62/*************************************************
63* Constructor for Config_Error *
64*************************************************/
65Config_Error::Config_Error(const std::string& err, u32bit line)
66 {
67 set_msg("Config error at line " + to_string(line) + ": " + err);
68 }
69
70}

Archive Download this file

Branches

Tags

Quick Links:     www.monotone.ca    -     Downloads    -     Documentation    -     Wiki    -     Code Forge    -     Build Status