From 811fed1957f284456e1455032f729e74c4fed458 Mon Sep 17 00:00:00 2001 From: lloyd Date: Thu, 31 Dec 2009 03:43:02 +0000 Subject: Add copyright and license notes to pretty much every file that didn't have them, including the examples and self-test code. Most of these files had not copyright/license information at all; since a major point of the examples is to allow users to copy and paste code that already does something they want, an ambigious license is not good. --- checks/bench.cpp | 5 +++++ checks/bigint.cpp | 6 ++++++ checks/block.cpp | 6 ++++++ checks/check.cpp | 6 ++++++ checks/dolook.cpp | 6 ++++++ checks/ec_tests.cpp | 6 ++++++ checks/getopt.cpp | 5 +++++ checks/getopt.h | 5 +++++ checks/misc.cpp | 6 ++++++ checks/pk.cpp | 6 ++++++ checks/pk_bench.cpp | 6 ++++++ checks/timer.cpp | 6 ++++++ checks/validate.cpp | 6 ++++++ checks/x509.cpp | 6 ++++++ doc/examples/asn1.cpp | 14 +++++++------- doc/examples/base.cpp | 44 ------------------------------------------ doc/examples/base64.cpp | 12 +++++------- doc/examples/bench.cpp | 6 ++++++ doc/examples/benchmark.cpp | 6 ++++++ doc/examples/bzip.cpp | 18 ++++++++++++----- doc/examples/ca.cpp | 10 ++++++---- doc/examples/checksum.cpp | 6 ++++++ doc/examples/cms_dec.cpp | 6 ++++++ doc/examples/cms_enc.cpp | 6 ++++++ doc/examples/cpuid.cpp | 6 ++++++ doc/examples/cryptobox.cpp | 5 ++++- doc/examples/decrypt.cpp | 17 +++++++++------- doc/examples/dh.cpp | 9 ++++----- doc/examples/dsa_kgen.cpp | 28 +++++++++++++++------------ doc/examples/dsa_sign.cpp | 10 ++++------ doc/examples/dsa_ver.cpp | 18 +++++++++-------- doc/examples/eax_test.cpp | 6 ++++++ doc/examples/ecdsa.cpp | 6 ++++++ doc/examples/encrypt.cpp | 13 +++++++------ doc/examples/encrypt2.cpp | 6 ++++++ doc/examples/factor.cpp | 6 ++++++ doc/examples/fpe.cpp | 6 ++++++ doc/examples/gen_certs.cpp | 6 ++++++ doc/examples/gtk/gtk_ui.h | 14 ++++++++------ doc/examples/hash.cpp | 12 +++--------- doc/examples/hash_fd.cpp | 23 +++++++++++----------- doc/examples/hash_quickly.cpp | 6 ++++++ doc/examples/hasher.cpp | 11 ++++------- doc/examples/hasher2.cpp | 19 ++++++++++-------- doc/examples/make_prime.cpp | 6 ++++++ doc/examples/package.cpp | 6 ++++++ doc/examples/passhash.cpp | 6 ++++++ doc/examples/pkcs10.cpp | 11 ++++------- doc/examples/pqg_gen.cpp | 6 ++++++ doc/examples/read_ssh.cpp | 6 ++++++ doc/examples/ressol.cpp | 6 ++++++ doc/examples/rng_test.cpp | 6 ++++++ doc/examples/row_encryptor.cpp | 10 ++++++++-- doc/examples/rsa_dec.cpp | 10 ++++++---- doc/examples/rsa_enc.cpp | 12 ++++++------ doc/examples/rsa_kgen.cpp | 11 ++++++----- doc/examples/rsa_manykey.cpp | 6 ++++++ doc/examples/self_sig.cpp | 19 ++++++++++-------- doc/examples/sig_gen.cpp | 6 ++++++ doc/examples/stack.cpp | 14 ++++++++------ doc/examples/test_es.cpp | 6 ++++++ doc/examples/tss.cpp | 6 ++++++ doc/examples/x509info.cpp | 12 +++++------- doc/examples/xor_ciph.cpp | 12 ++++++------ src/cert/cvc/asn1_eac_tm.cpp | 4 ++-- src/cert/cvc/cvc_self.cpp | 4 ++-- src/math/gfpmath/gfp_element.h | 1 - src/pubkey/ecc_key/ecc_key.cpp | 4 ++-- src/pubkey/ecdsa/ecdsa.cpp | 4 ++-- src/pubkey/eckaeg/eckaeg.cpp | 8 ++++---- src/wrap/python/filter.cpp | 10 ++++++---- src/wrap/python/python_botan.h | 5 +++++ src/wrap/python/x509.cpp | 10 ++++++---- 73 files changed, 437 insertions(+), 226 deletions(-) delete mode 100644 doc/examples/base.cpp diff --git a/checks/bench.cpp b/checks/bench.cpp index 3be61462a..7082eca68 100644 --- a/checks/bench.cpp +++ b/checks/bench.cpp @@ -1,3 +1,8 @@ +/* +* (C) 2009 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ #include #include diff --git a/checks/bigint.cpp b/checks/bigint.cpp index a56fd9181..86e37cd7b 100644 --- a/checks/bigint.cpp +++ b/checks/bigint.cpp @@ -1,3 +1,9 @@ +/* +* (C) 2009 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ + #include #include #include diff --git a/checks/block.cpp b/checks/block.cpp index 8f07cd65c..3cd41e63a 100644 --- a/checks/block.cpp +++ b/checks/block.cpp @@ -1,3 +1,9 @@ +/* +* (C) 2009 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ + /* We don't use the standard issue ECB filter, because we also want to check diff --git a/checks/check.cpp b/checks/check.cpp index 975315608..03579b51a 100644 --- a/checks/check.cpp +++ b/checks/check.cpp @@ -1,3 +1,9 @@ +/* +* (C) 2009 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ + /* * Test Driver for Botan */ diff --git a/checks/dolook.cpp b/checks/dolook.cpp index b64c5a5a3..28ac60c1b 100644 --- a/checks/dolook.cpp +++ b/checks/dolook.cpp @@ -1,3 +1,9 @@ +/* +* (C) 2009 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ + #include #include diff --git a/checks/ec_tests.cpp b/checks/ec_tests.cpp index 0420e0ee2..8727a4624 100644 --- a/checks/ec_tests.cpp +++ b/checks/ec_tests.cpp @@ -1,3 +1,9 @@ +/* +* (C) 2009 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ + #include #include "validate.h" diff --git a/checks/getopt.cpp b/checks/getopt.cpp index c0145ca75..23cb2a9fa 100644 --- a/checks/getopt.cpp +++ b/checks/getopt.cpp @@ -1,3 +1,8 @@ +/* +* (C) 2009 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ #include "getopt.h" diff --git a/checks/getopt.h b/checks/getopt.h index 6d6cfe89f..68e6bd874 100644 --- a/checks/getopt.h +++ b/checks/getopt.h @@ -1,3 +1,8 @@ +/* +* (C) 2009 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ #ifndef BOTAN_CHECK_GETOPT_H__ #define BOTAN_CHECK_GETOPT_H__ diff --git a/checks/misc.cpp b/checks/misc.cpp index a49778dc6..ff95ed10f 100644 --- a/checks/misc.cpp +++ b/checks/misc.cpp @@ -1,3 +1,9 @@ +/* +* (C) 2009 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ + #include #include #include diff --git a/checks/pk.cpp b/checks/pk.cpp index c02005245..e6f4d4f48 100644 --- a/checks/pk.cpp +++ b/checks/pk.cpp @@ -1,3 +1,9 @@ +/* +* (C) 2009 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ + #include #include #include diff --git a/checks/pk_bench.cpp b/checks/pk_bench.cpp index 31c48c1da..a0ea1d1d3 100644 --- a/checks/pk_bench.cpp +++ b/checks/pk_bench.cpp @@ -1,3 +1,9 @@ +/* +* (C) 2009 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ + #include #include #include diff --git a/checks/timer.cpp b/checks/timer.cpp index 1bdaebb7f..3736a4779 100644 --- a/checks/timer.cpp +++ b/checks/timer.cpp @@ -1,3 +1,9 @@ +/* +* (C) 2009 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ + #include "timer.h" #include #include diff --git a/checks/validate.cpp b/checks/validate.cpp index ff26e855a..9500589ca 100644 --- a/checks/validate.cpp +++ b/checks/validate.cpp @@ -1,3 +1,9 @@ +/* +* (C) 2009 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ + /* Validation routines */ diff --git a/checks/x509.cpp b/checks/x509.cpp index 69dd29492..8b7ce7d47 100644 --- a/checks/x509.cpp +++ b/checks/x509.cpp @@ -1,3 +1,9 @@ +/* +* (C) 2009 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ + #include diff --git a/doc/examples/asn1.cpp b/doc/examples/asn1.cpp index 95757ec19..b0a6aa104 100644 --- a/doc/examples/asn1.cpp +++ b/doc/examples/asn1.cpp @@ -1,3 +1,9 @@ +/* +* (C) 2009 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ + /* A simple ASN.1 parser, similiar to 'dumpasn1' or 'openssl asn1parse', though without some of the bells and whistles of those. Primarily used for testing @@ -14,12 +20,8 @@ - Nov 25: Much improved BIT STRING output Can deal with non-constructed taggings Can produce UTF-8 output - - This file is in the public domain. */ -/*******************************************************************/ - // Set this if your terminal understands UTF-8; otherwise output is in Latin-1 #define UTF8_TERMINAL 1 @@ -30,8 +32,6 @@ */ #define INITIAL_LEVEL 0 -/*******************************************************************/ - #include #include #include @@ -56,7 +56,7 @@ int main(int argc, char* argv[]) printf("Usage: %s \n", argv[0]); return 1; } - + Botan::LibraryInitializer init; try { diff --git a/doc/examples/base.cpp b/doc/examples/base.cpp deleted file mode 100644 index eca0ccf24..000000000 --- a/doc/examples/base.cpp +++ /dev/null @@ -1,44 +0,0 @@ -/* - A simple template for Botan applications, showing startup, etc -*/ -#include -using namespace Botan; - -/* This is how you can do compile-time version checking */ - -#if BOTAN_VERSION_CODE < BOTAN_VERSION_CODE_FOR(1,6,3) - #error Your Botan installation is too old; upgrade to 1.6.3 or later -#endif - -#include - -int main(int argc, char* argv[]) - { - Botan::LibraryInitializer init; - - try - { - /* Put it inside the try block so exceptions at startup/shutdown will - get caught. - - It will be initialized with default options - */ - - if(argc > 2) - { - std::cout << "Usage: " << argv[0] << "[initializer args]\n"; - return 2; - } - - std::string args = (argc == 2) ? argv[1] : ""; - - LibraryInitializer init(args); - // your operations here - } - catch(std::exception& e) - { - std::cout << e.what() << std::endl; - return 1; - } - return 0; - } diff --git a/doc/examples/base64.cpp b/doc/examples/base64.cpp index d35aaf593..dbe8d19e3 100644 --- a/doc/examples/base64.cpp +++ b/doc/examples/base64.cpp @@ -1,12 +1,10 @@ /* -An Botan example application which emulates a poorly written version of -"uuencode -m" - -Written by Jack Lloyd (lloyd@randombit.net), in maybe an hour scattered -over 2000/2001 - -This file is in the public domain +* Encode/decode base64 strings +* (C) 2009 Jack Lloyd +* +* Distributed under the terms of the Botan license */ + #include #include #include diff --git a/doc/examples/bench.cpp b/doc/examples/bench.cpp index 6a15df7c0..87a537493 100644 --- a/doc/examples/bench.cpp +++ b/doc/examples/bench.cpp @@ -1,3 +1,9 @@ +/* +* (C) 2009 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ + #include #include #include diff --git a/doc/examples/benchmark.cpp b/doc/examples/benchmark.cpp index fa91726e5..006450314 100644 --- a/doc/examples/benchmark.cpp +++ b/doc/examples/benchmark.cpp @@ -1,3 +1,9 @@ +/* +* (C) 2009 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ + #include #include diff --git a/doc/examples/bzip.cpp b/doc/examples/bzip.cpp index 02252fb94..c3509c4da 100644 --- a/doc/examples/bzip.cpp +++ b/doc/examples/bzip.cpp @@ -1,10 +1,10 @@ /* -An Botan example application which emulates a poorly written version of bzip2 - -Written by Jack Lloyd (lloyd@randombit.net), Jun 9, 2001 - -This file is in the public domain +* Bzip2 Compression/Decompression +* (C) 2009 Jack Lloyd +* +* Distributed under the terms of the Botan license */ + #include #include #include @@ -12,6 +12,14 @@ This file is in the public domain #include #include +/* +* If Bzip2 isn't included, we know nothing works at compile time, but +* we wait to fail at runtime. Otherwise I would get 2-3 mails a month +* about how this was failing to compile (even with an informative +* #error message explaining the situation) because bzip2 wasn't +* included in the build. +*/ + #if defined(BOTAN_HAS_COMPRESSOR_BZIP2) #include #endif diff --git a/doc/examples/ca.cpp b/doc/examples/ca.cpp index f5eccdde9..8dd3e981f 100644 --- a/doc/examples/ca.cpp +++ b/doc/examples/ca.cpp @@ -1,3 +1,9 @@ +/* +* (C) 2009 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ + /* Implement the functionality of a simple CA: read in a CA certificate, the associated private key, and a PKCS #10 certificate request. Sign the @@ -7,10 +13,6 @@ cacert.pem: The CA's certificate (perhaps created by self_sig) caprivate.pem: The CA's private key req.pem: The user's PKCS #10 certificate request - - Written by Jack Lloyd, May 19, 2003 - - This file is in the public domain. */ #include diff --git a/doc/examples/checksum.cpp b/doc/examples/checksum.cpp index 232be057c..dba7a7d70 100644 --- a/doc/examples/checksum.cpp +++ b/doc/examples/checksum.cpp @@ -1,3 +1,9 @@ +/* +* (C) 2009 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ + #include #include diff --git a/doc/examples/cms_dec.cpp b/doc/examples/cms_dec.cpp index de4d732f0..6a9d99137 100644 --- a/doc/examples/cms_dec.cpp +++ b/doc/examples/cms_dec.cpp @@ -1,3 +1,9 @@ +/* +* (C) 2009 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ + #include #include #include diff --git a/doc/examples/cms_enc.cpp b/doc/examples/cms_enc.cpp index de16bbaae..2cf813987 100644 --- a/doc/examples/cms_enc.cpp +++ b/doc/examples/cms_enc.cpp @@ -1,3 +1,9 @@ +/* +* (C) 2009 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ + #include #include using namespace Botan; diff --git a/doc/examples/cpuid.cpp b/doc/examples/cpuid.cpp index 76438783f..ba499051f 100644 --- a/doc/examples/cpuid.cpp +++ b/doc/examples/cpuid.cpp @@ -1,3 +1,9 @@ +/* +* (C) 2009 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ + #include #include diff --git a/doc/examples/cryptobox.cpp b/doc/examples/cryptobox.cpp index 0a769b0cd..f45f00ca1 100644 --- a/doc/examples/cryptobox.cpp +++ b/doc/examples/cryptobox.cpp @@ -1,6 +1,9 @@ /* -* Cryptobox example +* (C) 2009 Jack Lloyd +* +* Distributed under the terms of the Botan license */ + #include #include #include diff --git a/doc/examples/decrypt.cpp b/doc/examples/decrypt.cpp index 68d5f890b..ebab5d804 100644 --- a/doc/examples/decrypt.cpp +++ b/doc/examples/decrypt.cpp @@ -1,14 +1,17 @@ /* -Decrypt files encrypted with the 'encrypt' example application. - -I'm being lazy and writing the output to stdout rather than stripping off the -".enc" suffix and writing it there. So all diagnostics go to stderr so there is -no confusion. +* (C) 2009 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ -Written by Jack Lloyd (lloyd@randombit.net) on August 5, 2002 +/* +Decrypt files encrypted with the 'encrypt' example application. -This file is in the public domain +I'm being lazy and writing the output to stdout rather than stripping +off the ".enc" suffix and writing it there. So all diagnostics go to +stderr so there is no confusion. */ + #include #include #include diff --git a/doc/examples/dh.cpp b/doc/examples/dh.cpp index 7855aeae5..4c6961234 100644 --- a/doc/examples/dh.cpp +++ b/doc/examples/dh.cpp @@ -1,10 +1,9 @@ /* - A simple DH example - - Written by Jack Lloyd (lloyd@randombit.net), on December 24, 2003 - - This file is in the public domain +* (C) 2009 Jack Lloyd +* +* Distributed under the terms of the Botan license */ + #include #include #include diff --git a/doc/examples/dsa_kgen.cpp b/doc/examples/dsa_kgen.cpp index 4669cf705..e949ae54a 100644 --- a/doc/examples/dsa_kgen.cpp +++ b/doc/examples/dsa_kgen.cpp @@ -1,19 +1,23 @@ /* -Generate a 1024 bit DSA key and put it into a file. The public key format is -that specified by X.509, while the private key format is PKCS #8. +* (C) 2009 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ -The domain parameters are the ones specified as the Java default DSA -parameters. There is nothing special about these, it's just the only 1024-bit -DSA parameter set that's included in Botan at the time of this writing. The -application always reads/writes all of the domain parameters to/from the file, -so a new set could be used without any problems. We could generate a new set -for each key, or read a set of DSA params from a file and use those, but they -mostly seem like needless complications. -Written by Jack Lloyd (lloyd@randombit.net), August 5, 2002 - Updated to use X.509 and PKCS #8 formats, October 21, 2002 +/** +Generate a 1024 bit DSA key and put it into a file. The public key +format is that specified by X.509, while the private key format is +PKCS #8. -This file is in the public domain +The domain parameters are the ones specified as the Java default DSA +parameters. There is nothing special about these, it's just the only +1024-bit DSA parameter set that's included in Botan at the time of +this writing. The application always reads/writes all of the domain +parameters to/from the file, so a new set could be used without any +problems. We could generate a new set for each key, or read a set of +DSA params from a file and use those, but they mostly seem like +needless complications. */ #include diff --git a/doc/examples/dsa_sign.cpp b/doc/examples/dsa_sign.cpp index caf050313..abc22d0de 100644 --- a/doc/examples/dsa_sign.cpp +++ b/doc/examples/dsa_sign.cpp @@ -1,10 +1,8 @@ /* -Decrypt an encrypted DSA private key. Then use that key to sign a message. - -Written by Jack Lloyd (lloyd@randombit.net), August 5, 2002 - Updated to use X.509 and PKCS #8 format keys, October 21, 2002 - -This file is in the public domain +* DSA signature generation example +* (C) 2009 Jack Lloyd +* +* Distributed under the terms of the Botan license */ #include diff --git a/doc/examples/dsa_ver.cpp b/doc/examples/dsa_ver.cpp index 3b7ea0255..4a2f62ce4 100644 --- a/doc/examples/dsa_ver.cpp +++ b/doc/examples/dsa_ver.cpp @@ -1,14 +1,16 @@ /* -Grab an DSA public key from the file given as an argument, grab a signature -from another file, and verify the message (which, suprise, is also in a file). - -The signature format isn't particularly standard, but it's not bad. It's simply -the IEEE 1363 signature format, encoded into base64 with a trailing newline +* (C) 2009 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ -Written by Jack Lloyd (lloyd@randombit.net), August 5, 2002 - Updated to use X.509 format keys, October 21, 2002 +/* +Grab an DSA public key from the file given as an argument, grab a +signature from another file, and verify the message (which, suprise, +is also in a file). -This file is in the public domain +The signature format isn't particularly standard: take the IEEE 1363 +signature format, encoded into base64 with a trailing newline. */ #include diff --git a/doc/examples/eax_test.cpp b/doc/examples/eax_test.cpp index 283e33501..3f7dbcbc8 100644 --- a/doc/examples/eax_test.cpp +++ b/doc/examples/eax_test.cpp @@ -1,3 +1,9 @@ +/* +* (C) 2009 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ + #include #include #include diff --git a/doc/examples/ecdsa.cpp b/doc/examples/ecdsa.cpp index 065203a94..f55005544 100644 --- a/doc/examples/ecdsa.cpp +++ b/doc/examples/ecdsa.cpp @@ -1,3 +1,9 @@ +/* +* (C) 2009 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ + #include #include #include diff --git a/doc/examples/encrypt.cpp b/doc/examples/encrypt.cpp index 348ee8d39..f903c2f24 100644 --- a/doc/examples/encrypt.cpp +++ b/doc/examples/encrypt.cpp @@ -1,3 +1,9 @@ +/* +* (C) 2009 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ + /* Encrypt a file using a block cipher in CBC mode. Compresses the plaintext with Zlib, MACs with HMAC(SHA-1). Stores the block cipher used in the file, @@ -10,13 +16,8 @@ was compressed. Bonus points for supporting multiple compression schemes. Another flaw is that is stores the entire ciphertext in memory, so if the file you're encrypting is 1 Gb... you better have a lot of RAM. - -Based on the base64 example, of all things - -Written by Jack Lloyd (lloyd@randombit.net) on August 5, 2002 - -This file is in the public domain */ + #include #include #include diff --git a/doc/examples/encrypt2.cpp b/doc/examples/encrypt2.cpp index 4af0cf019..dac2f8314 100644 --- a/doc/examples/encrypt2.cpp +++ b/doc/examples/encrypt2.cpp @@ -1,3 +1,9 @@ +/* +* (C) 2009 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ + #include #include #include diff --git a/doc/examples/factor.cpp b/doc/examples/factor.cpp index ff3c23c5d..7700d9b2d 100644 --- a/doc/examples/factor.cpp +++ b/doc/examples/factor.cpp @@ -1,3 +1,9 @@ +/* +* (C) 2009 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ + /* Factor integers using a combination of trial division by small primes, and Pollard's Rho algorithm diff --git a/doc/examples/fpe.cpp b/doc/examples/fpe.cpp index 7108b3ece..73773994b 100644 --- a/doc/examples/fpe.cpp +++ b/doc/examples/fpe.cpp @@ -1,3 +1,9 @@ +/* +* (C) 2009 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ + /* * Encrypt credit cards numbers with valid checksums into other credit * card numbers with valid checksums using format preserving encryption. diff --git a/doc/examples/gen_certs.cpp b/doc/examples/gen_certs.cpp index 8490a167e..0d04d6d1c 100644 --- a/doc/examples/gen_certs.cpp +++ b/doc/examples/gen_certs.cpp @@ -1,3 +1,9 @@ +/* +* (C) 2009 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ + /* * Generate a root CA plus httpd, dovecot, and postfix certs/keys * diff --git a/doc/examples/gtk/gtk_ui.h b/doc/examples/gtk/gtk_ui.h index 9ced83a81..065a4f76b 100644 --- a/doc/examples/gtk/gtk_ui.h +++ b/doc/examples/gtk/gtk_ui.h @@ -1,6 +1,8 @@ -/************************************************* -* GTK+ User Interface Header File * -*************************************************/ +/* +* (C) 2006 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ #ifndef BOTAN_EXT_GTK_UI__ #define BOTAN_EXT_GTK_UI__ @@ -8,9 +10,9 @@ #include #include -/************************************************* -* GTK+ Passphrase Callback Object * -*************************************************/ +/* +* GTK+ Passphrase Callback Object +*/ class GTK_UI : public Botan::User_Interface { public: diff --git a/doc/examples/hash.cpp b/doc/examples/hash.cpp index a97cd6082..feaa2e9b3 100644 --- a/doc/examples/hash.cpp +++ b/doc/examples/hash.cpp @@ -1,13 +1,7 @@ /* -Prints the message digest of files, using an arbitrary hash function -chosen by the user. This is less flexible that I might like, for example: - ./hash sha1 some_file [or md5 or sha-1 or ripemd160 or ...] -will not work, cause the name lookup is case-sensitive. Oh well... - -Written by Jack Lloyd (lloyd@randombit.net), on August 4, 2002 - - December 16, 2003: "Fixed" to accept "sha1" or "md5" as a hash name - -This file is in the public domain +* (C) 2009 Jack Lloyd +* +* Distributed under the terms of the Botan license */ #include diff --git a/doc/examples/hash_fd.cpp b/doc/examples/hash_fd.cpp index 82ca2c3b4..32acdbec3 100644 --- a/doc/examples/hash_fd.cpp +++ b/doc/examples/hash_fd.cpp @@ -1,18 +1,17 @@ /* -Written by Jack Lloyd (lloyd@randombit.net), on Prickle-Prickle, -the 10th of Bureaucracy, 3167. - -This file is in the public domain - -This is just like the normal hash application, but uses the Unix I/O system -calls instead of C++ iostreams. Previously, this version was much faster and -smaller, but GCC 3.1's libstdc++ seems to have been improved enough that the -difference is now fairly minimal. +* (C) 2009 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ -Nicely enough, doing the change required changing only about 3 lines of code. +/* +This is just like the normal hash application, but uses the Unix I/O +system calls instead of C++ iostreams. Previously, this version was +much faster and smaller, but GCC 3.1's libstdc++ seems to have been +improved enough that the difference is now fairly minimal. -Note that this requires you to be on a machine running some sort of Unix. Well, -I guess any POSIX.1 compliant OS (in theory). +Nicely enough, doing the change required changing only about 3 lines +of code. */ #include diff --git a/doc/examples/hash_quickly.cpp b/doc/examples/hash_quickly.cpp index c8c8ca5fb..a5236b381 100644 --- a/doc/examples/hash_quickly.cpp +++ b/doc/examples/hash_quickly.cpp @@ -1,3 +1,9 @@ +/* +* (C) 2009 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ + #include #include #include diff --git a/doc/examples/hasher.cpp b/doc/examples/hasher.cpp index 5ba982fc0..f3f2ab874 100644 --- a/doc/examples/hasher.cpp +++ b/doc/examples/hasher.cpp @@ -1,12 +1,9 @@ /* -A Botan example application which emulates a -poorly written version of "gpg --print-md" - -Written by Jack Lloyd (lloyd@randombit.net), quite a while ago (as of June -2001) - -This file is in the public domain +* (C) 2009 Jack Lloyd +* +* Distributed under the terms of the Botan license */ + #include #include #include diff --git a/doc/examples/hasher2.cpp b/doc/examples/hasher2.cpp index 12d3c853d..abbe11622 100644 --- a/doc/examples/hasher2.cpp +++ b/doc/examples/hasher2.cpp @@ -1,15 +1,18 @@ /* -Identical to hasher.cpp, but uses Pipe in a different way. - -Note this tends to be much less efficient than hasher.cpp, because it does -three passes over the file. For a small file, it doesn't really matter. But for -a large file, or for something you can't re-read easily (socket, stdin, ...) -this is a bad idea. +* (C) 2001 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ -Written by Jack Lloyd (lloyd@randombit.net), Feb 8 2001 +/* +Identical to hasher.cpp, but uses Pipe in a different way. -This file is in the public domain +Note this tends to be much less efficient than hasher.cpp, because it +does three passes over the file. For a small file, it doesn't really +matter. But for a large file, or for something you can't re-read +easily (socket, stdin, ...) this is a bad idea. */ + #include #include #include diff --git a/doc/examples/make_prime.cpp b/doc/examples/make_prime.cpp index eaff1867f..acaaac698 100644 --- a/doc/examples/make_prime.cpp +++ b/doc/examples/make_prime.cpp @@ -1,3 +1,9 @@ +/* +* (C) 2009 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ + #include #include #include diff --git a/doc/examples/package.cpp b/doc/examples/package.cpp index 866dd7e96..14d215f73 100644 --- a/doc/examples/package.cpp +++ b/doc/examples/package.cpp @@ -1,3 +1,9 @@ +/* +* (C) 2009 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ + #include #include diff --git a/doc/examples/passhash.cpp b/doc/examples/passhash.cpp index 7f5bbc2bb..24f7ff674 100644 --- a/doc/examples/passhash.cpp +++ b/doc/examples/passhash.cpp @@ -1,3 +1,9 @@ +/* +* (C) 2009 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ + #include #include #include diff --git a/doc/examples/pkcs10.cpp b/doc/examples/pkcs10.cpp index d9fa9accb..3f5ec8e05 100644 --- a/doc/examples/pkcs10.cpp +++ b/doc/examples/pkcs10.cpp @@ -1,12 +1,9 @@ /* -Generate a 1024 bit RSA key, and then create a PKCS #10 certificate request for -that key. The private key will be stored as an encrypted PKCS #8 object, and -stored in another file. - -Written by Jack Lloyd (lloyd@randombit.net), April 7, 2003 - -This file is in the public domain +* (C) 2003 Jack Lloyd +* +* Distributed under the terms of the Botan license */ + #include #include #include diff --git a/doc/examples/pqg_gen.cpp b/doc/examples/pqg_gen.cpp index e4b959883..4104e8ecb 100644 --- a/doc/examples/pqg_gen.cpp +++ b/doc/examples/pqg_gen.cpp @@ -1,3 +1,9 @@ +/* +* (C) 2009 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ + #include #include #include diff --git a/doc/examples/read_ssh.cpp b/doc/examples/read_ssh.cpp index a88306caa..52c758ceb 100644 --- a/doc/examples/read_ssh.cpp +++ b/doc/examples/read_ssh.cpp @@ -1,3 +1,9 @@ +/* +* (C) 2009 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ + /* * Example of reading SSH2 format public keys (see RFC 4716) */ diff --git a/doc/examples/ressol.cpp b/doc/examples/ressol.cpp index 43bb68d37..286377fc6 100644 --- a/doc/examples/ressol.cpp +++ b/doc/examples/ressol.cpp @@ -1,3 +1,9 @@ +/* +* (C) 2009 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ + #include #include #include diff --git a/doc/examples/rng_test.cpp b/doc/examples/rng_test.cpp index 8d4253a6e..05f2c28a4 100644 --- a/doc/examples/rng_test.cpp +++ b/doc/examples/rng_test.cpp @@ -1,3 +1,9 @@ +/* +* (C) 2009 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ + #include #include #include diff --git a/doc/examples/row_encryptor.cpp b/doc/examples/row_encryptor.cpp index 162e962e0..17f44ce7b 100644 --- a/doc/examples/row_encryptor.cpp +++ b/doc/examples/row_encryptor.cpp @@ -1,3 +1,9 @@ +/* +* (C) 2009 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ + #include #include #include @@ -99,8 +105,8 @@ std::string Row_Encryptor::decrypt(const std::string& input, return dec_pipe.read_all_as_string(Pipe::LAST_MESSAGE); } -/************************* - Test code follows: +/* +* Test code follows: */ int main() diff --git a/doc/examples/rsa_dec.cpp b/doc/examples/rsa_dec.cpp index 25ce33f47..1e789d748 100644 --- a/doc/examples/rsa_dec.cpp +++ b/doc/examples/rsa_dec.cpp @@ -1,11 +1,13 @@ +/* +* (C) 2002 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ + /* Decrypt an encrypted RSA private key. Then use that key to decrypt a message. This program can decrypt messages generated by rsa_enc, and uses the same key format as that generated by rsa_kgen. - -Written by Jack Lloyd (lloyd@randombit.net), June 3-5, 2002 - -This file is in the public domain */ #include diff --git a/doc/examples/rsa_enc.cpp b/doc/examples/rsa_enc.cpp index f9b8c5561..904b1e379 100644 --- a/doc/examples/rsa_enc.cpp +++ b/doc/examples/rsa_enc.cpp @@ -1,3 +1,9 @@ +/* +* (C) 2002 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ + /* Grab an RSA public key from the file given as an argument, grab a message from another file, and encrypt the message. @@ -18,12 +24,6 @@ the _plaintext_ 3) Following lines are base64 encoded ciphertext (CAST-128 as described), each broken after ~72 characters. - -Written by Jack Lloyd (lloyd@randombit.net), June 3, 2002 - Updated to use KDF2, September 8, 2002 - Updated to read X.509 keys, October 21, 2002 - -This file is in the public domain */ #include diff --git a/doc/examples/rsa_kgen.cpp b/doc/examples/rsa_kgen.cpp index b7e90ef8a..1108b46db 100644 --- a/doc/examples/rsa_kgen.cpp +++ b/doc/examples/rsa_kgen.cpp @@ -1,12 +1,13 @@ +/* +* (C) 2002 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ + /* Generate an RSA key of a specified bitlength, and put it into a pair of key files. One is the public key in X.509 format (PEM encoded), the private key is in PKCS #8 format (also PEM encoded). - -Written by Jack Lloyd (lloyd@randombit.net), June 2-3, 2002 - Updated to use X.509 and PKCS #8 on October 21, 2002 - -This file is in the public domain */ #include diff --git a/doc/examples/rsa_manykey.cpp b/doc/examples/rsa_manykey.cpp index 4122bc8ef..e6a511753 100644 --- a/doc/examples/rsa_manykey.cpp +++ b/doc/examples/rsa_manykey.cpp @@ -1,3 +1,9 @@ +/* +* (C) 2009 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ + /* Generate a whole sequence of keys (for benchmarking) */ diff --git a/doc/examples/self_sig.cpp b/doc/examples/self_sig.cpp index 93161f7d2..6710cfb51 100644 --- a/doc/examples/self_sig.cpp +++ b/doc/examples/self_sig.cpp @@ -1,14 +1,17 @@ /* -Generate a 1024 bit RSA key, and then create a self-signed X.509v3 certificate -with that key. If the do_CA variable is set to true, then it will be marked for -CA use, otherwise it will get extensions appropriate for use with a client -certificate. The private key is stored as an encrypted PKCS #8 object in -another file. - -Written by Jack Lloyd (lloyd@randombit.net), April 7, 2003 +* (C) 2003 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ -This file is in the public domain +/* +Generate a 1024 bit RSA key, and then create a self-signed X.509v3 +certificate with that key. If the do_CA variable is set to true, then +it will be marked for CA use, otherwise it will get extensions +appropriate for use with a client certificate. The private key is +stored as an encrypted PKCS #8 object in another file. */ + #include #include #include diff --git a/doc/examples/sig_gen.cpp b/doc/examples/sig_gen.cpp index 6dd749097..fca069862 100644 --- a/doc/examples/sig_gen.cpp +++ b/doc/examples/sig_gen.cpp @@ -1,3 +1,9 @@ +/* +* (C) 2009 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ + #include #include #include diff --git a/doc/examples/stack.cpp b/doc/examples/stack.cpp index 1522b05f5..f569004fc 100644 --- a/doc/examples/stack.cpp +++ b/doc/examples/stack.cpp @@ -1,11 +1,13 @@ /* -An Botan example application showing how to use the pop and prepend functions -of Pipe. Based on the md5 example. It's output should always be identical to -such. - -Written by Jack Lloyd (lloyd@randombit.net), Feb 3, 2002 +* (C) 2002 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ -This file is in the public domain +/* +An Botan example application showing how to use the pop and prepend +functions of Pipe. Based on the md5 example. It's output should always +be identical to such. */ #include diff --git a/doc/examples/test_es.cpp b/doc/examples/test_es.cpp index b5510ab75..ef5d02281 100644 --- a/doc/examples/test_es.cpp +++ b/doc/examples/test_es.cpp @@ -1,3 +1,9 @@ +/* +* (C) 2009 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ + #include #include diff --git a/doc/examples/tss.cpp b/doc/examples/tss.cpp index 1881ffe24..03d7699bf 100644 --- a/doc/examples/tss.cpp +++ b/doc/examples/tss.cpp @@ -1,3 +1,9 @@ +/* +* (C) 2009 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ + #include #include #include diff --git a/doc/examples/x509info.cpp b/doc/examples/x509info.cpp index 0e34f2fab..8f4d83c45 100644 --- a/doc/examples/x509info.cpp +++ b/doc/examples/x509info.cpp @@ -1,12 +1,10 @@ /* - Read an X.509 certificate, and print various things about it - - Written by Jack Lloyd, March 23 2003 - - October 31, 2003: Prints the public key - - November 1, 2003: Removed the -d flag; it can tell automatically now - - This file is in the public domain +* Read an X.509 certificate, and print various things about it +* (C) 2003 Jack Lloyd +* +* Distributed under the terms of the Botan license */ + #include #include #include diff --git a/doc/examples/xor_ciph.cpp b/doc/examples/xor_ciph.cpp index 6a914b150..3174e103e 100644 --- a/doc/examples/xor_ciph.cpp +++ b/doc/examples/xor_ciph.cpp @@ -1,11 +1,11 @@ /* - An implementation of the highly secure (not) XOR cipher. AKA, how to write - and use your own cipher object. DO NOT make up your own ciphers. Please. - - Written by Jack Lloyd (lloyd@randombit.net) on Feb 17, 2004 - Update November 21 2008 for new algorithm factory in 1.8 +* (C) 2004,2008 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ - This file is in the public domain +/* + Adding a simple XOR cipher to the internal tables */ #include diff --git a/src/cert/cvc/asn1_eac_tm.cpp b/src/cert/cvc/asn1_eac_tm.cpp index dc38e3296..73a2843f7 100644 --- a/src/cert/cvc/asn1_eac_tm.cpp +++ b/src/cert/cvc/asn1_eac_tm.cpp @@ -182,9 +182,9 @@ bool EAC_Time::passes_sanity_check() const return true; } -/****************************************** +/* * modification functions -******************************************/ +*/ void EAC_Time::add_years(u32bit years) { diff --git a/src/cert/cvc/cvc_self.cpp b/src/cert/cvc/cvc_self.cpp index 227ff4136..98e74a6b0 100644 --- a/src/cert/cvc/cvc_self.cpp +++ b/src/cert/cvc/cvc_self.cpp @@ -21,9 +21,9 @@ namespace Botan { namespace { -/******************************* +/* * cvc CHAT values -*******************************/ +*/ enum CHAT_values{ CVCA = 0xC0, DVCA_domestic = 0x80, diff --git a/src/math/gfpmath/gfp_element.h b/src/math/gfpmath/gfp_element.h index c6cfc9d32..7a8644fee 100644 --- a/src/math/gfpmath/gfp_element.h +++ b/src/math/gfpmath/gfp_element.h @@ -241,7 +241,6 @@ class BOTAN_DLL GFpElement mutable BigInt m_value; // ordinary residue or m-residue respectively mutable BigInt workspace; - // ***************************************** // data members for montgomery multiplication mutable bool m_use_montgm; //mutable BigInt m_mres; diff --git a/src/pubkey/ecc_key/ecc_key.cpp b/src/pubkey/ecc_key/ecc_key.cpp index 677a5088e..b7f58eecc 100644 --- a/src/pubkey/ecc_key/ecc_key.cpp +++ b/src/pubkey/ecc_key/ecc_key.cpp @@ -134,9 +134,9 @@ void EC_PublicKey::set_parameter_encoding(EC_dompar_enc type) m_param_enc = type; } -/******************************** +/* * EC_PrivateKey -********************************/ +*/ void EC_PrivateKey::affirm_init() const // virtual { if(m_private_value == 0) diff --git a/src/pubkey/ecdsa/ecdsa.cpp b/src/pubkey/ecdsa/ecdsa.cpp index 9d352c70f..6116f7b13 100644 --- a/src/pubkey/ecdsa/ecdsa.cpp +++ b/src/pubkey/ecdsa/ecdsa.cpp @@ -156,9 +156,9 @@ u32bit ECDSA_PublicKey::max_input_bits() const return mp_dom_pars->get_order().bits(); } -/************************* +/* * ECDSA_PrivateKey -*************************/ +*/ void ECDSA_PrivateKey::affirm_init() const // virtual { EC_PrivateKey::affirm_init(); diff --git a/src/pubkey/eckaeg/eckaeg.cpp b/src/pubkey/eckaeg/eckaeg.cpp index dc6eb925b..3e0f717e0 100644 --- a/src/pubkey/eckaeg/eckaeg.cpp +++ b/src/pubkey/eckaeg/eckaeg.cpp @@ -16,9 +16,9 @@ namespace Botan { -/********************************* +/* * ECKAEG_PublicKey -*********************************/ +*/ void ECKAEG_PublicKey::affirm_init() const // virtual { @@ -72,9 +72,9 @@ ECKAEG_PublicKey::ECKAEG_PublicKey(EC_Domain_Params const& dom_par, PointGFp con m_eckaeg_core = ECKAEG_Core(*mp_dom_pars, BigInt(0), *mp_public_point); } -/********************************* +/* * ECKAEG_PrivateKey -*********************************/ +*/ void ECKAEG_PrivateKey::affirm_init() const // virtual { EC_PrivateKey::affirm_init(); diff --git a/src/wrap/python/filter.cpp b/src/wrap/python/filter.cpp index a678af9e5..48a3f84eb 100644 --- a/src/wrap/python/filter.cpp +++ b/src/wrap/python/filter.cpp @@ -1,7 +1,9 @@ -/************************************************* -* Boost.Python module definition * -* (C) 1999-2007 Jack Lloyd * -*************************************************/ +/* +* Boost.Python module definition +* (C) 1999-2007 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ #include using namespace boost::python; diff --git a/src/wrap/python/python_botan.h b/src/wrap/python/python_botan.h index 646c2e2c1..a7a2e505e 100644 --- a/src/wrap/python/python_botan.h +++ b/src/wrap/python/python_botan.h @@ -1,3 +1,8 @@ +/* +* (C) 2009 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ #ifndef BOTAN_BOOST_PYTHON_COMMON_H__ #define BOTAN_BOOST_PYTHON_COMMON_H__ diff --git a/src/wrap/python/x509.cpp b/src/wrap/python/x509.cpp index 90c2bba1c..c2c9533c8 100644 --- a/src/wrap/python/x509.cpp +++ b/src/wrap/python/x509.cpp @@ -1,7 +1,9 @@ -/************************************************* -* Boost.Python module definition * -* (C) 1999-2007 Jack Lloyd * -*************************************************/ +/* +* Boost.Python module definition +* (C) 2009 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ #include #include -- cgit v1.2.3