debian/0000755000000000000000000000000011460115666007174 5ustar debian/control0000644000000000000000000000477311457551561010616 0ustar Source: twofish Section: libdevel Priority: optional Maintainer: Mats Erik Andersson Build-Depends: debhelper (>> 7.0) Standards-Version: 3.9.1 Vcs-Svn: svn://svn.debian.org/svn/collab-maint/deb-maint/twofish/trunk/ Vcs-Browser: http://svn.debian.org/viewsvn/collab-maint/deb-maint/twofish/trunk/ Package: libtwofish-dev Architecture: any Depends: libc6-dev, libtwofish0 (= ${binary:Version}), ${misc:Depends} Description: Niels Ferguson's Twofish cryptographic algorithm library This package contains a header file and static library implementing the Twofish cryptographic algorithm, one of the five finalists in the AES (Advanced Encryption Standard) competition sponsored by the United States's National Institute of Standards and Technology (NIST). . The main properties of this library are: * Free: The library can be freely used for any application. (For details see the licensing terms and disclaimer in the source code file itself.) * Fast: The code has been optimised for speed, at the expense of memory use and code size. * Easy to use: Care has been taken to make the code easy to integrate into a larger project. Extensive comments explain how to perform the integration and how to use the library. * Portable: The default code is written in fully portable C. By adjusting certain macro definitions the user can provide platform-specific code for certain functions, which can improve the speed. * Documented: Extensive documentation is available in the comments of the source files. This includes information about integration, optimisation for specific platforms, the library API, and detailed explanation of all the code. * Self-testing: Extensive self-tests are run every time the library is initialised. * Large: The code has been optimised for speed, which leads to the use of large tables. No attempt has been made to minimise the code or data size. . This library has not yet been declared stable by its author, Niels Ferguson, yet it has not been changed in eight years. Package: libtwofish0 Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Description: Niels Ferguson's Twofish cryptographic library -- runtime package This package contains the runtime shared library of the Twofish cryptographic algorithm. This shared library might be called experimental, since the original author Niels Ferguson has cancelled maintenance, the source being in the public domain. . Runtime library. See also libtwofish-dev. debian/local/0000755000000000000000000000000011460107646010265 5ustar debian/local/catwo.c0000644000000000000000000000353311457643273011561 0ustar /* * catwo.c * * A simple-minded encryptor and decryptor application. * * Usage: catwo {[-e] | -d} key-string < infile > outfile * * The switch "-d" calls for decryption, whereas the optional * switch "-e" entails encryption. * * The argument "key-string" is required to contain at least * two characters, and will be truncated at 32 characters. * The program reads from STDIN and writes to STDOUT. * * Of technical reasons, the encrypted output will be increased * to a size of the nearest multiple of 16. Likewise, any decrypted * output will be padded with NUL until a similar size condition holds. * * Author: Mats Erik Andersson * Licensed under the same conditions as Niels Ferguson's libtwofish, * alias TwofishClibc. */ #include #include #include #include #include #define MIN_KEYLEN 2 int main(int argc, char * argv[]) { int keylen; int shift = 1, encrypt = 1; Twofish_Byte key[32]; Twofish_key xkey; Twofish_Byte inblock[16], outblock[16]; memset(key, 0, sizeof(key)); if (argc < 2) return 1; /* No key is possible. */ if (strcmp(argv[1], "-d") == 0) encrypt = 0; else if (strcmp(argv[1], "-e") != 0) shift = 0; if (argc - shift < 2) return 1; /* No key is possible. */ keylen = strlen(argv[1 + shift]); if (keylen < MIN_KEYLEN) { fprintf(stderr, "Key material too short.\n"); return 1; } if (keylen > sizeof(key)) keylen = sizeof(key); Twofish_initialise(); strncpy(key, argv[1 + shift], sizeof(key)); memset(inblock, 0, sizeof(inblock)); Twofish_prepare_key(key, keylen, &xkey); while (read(STDIN_FILENO, inblock, sizeof(inblock)) > 0) { if (encrypt) Twofish_encrypt(&xkey, inblock, outblock); else Twofish_decrypt(&xkey, inblock, outblock); write(STDOUT_FILENO, outblock, sizeof(outblock)); memset(inblock, 0, sizeof(inblock)); } return 0; } debian/local/simple-internal-test.c0000644000000000000000000000476411457544120014522 0ustar /* * simple.c * * Single block encryption, and ensuing decryption. */ #include #include #include #include #include #define INDATA "tre fula fiskar " #ifndef FIXEDKEYSTR # define FIXEDKEYSTR "fisker" #endif void to_hex(char hex[2], int ch) { char nibble = ch & 0x0f; hex[0] = '0' + nibble; if ( nibble > 0x09 ) hex[0] += 'a' - '0' - 0x0a; nibble = ch >> 4; hex[1] = '0' + nibble; if ( nibble > 0x09 ) hex[1] += 'a' - '0' - 0x0a; return; } int main(int argc, char * argv[]) { int keylen, j, rounds = 1, failures = 0; int first_time = 1; char hex[2]; Twofish_Byte key[32]; Twofish_key xkey; Twofish_Byte inblock[16], intermediary[16], outblock[16]; #ifndef FIXEDKEY const int multiple = sizeof(key) / sizeof(long int); long int seed; keylen = multiple * sizeof(long int); #endif j = 1; while ( j < argc ) { if ( strcmp(argv[j], "-h") == 0 ) { #ifndef FIXEDKEY printf("Usage: %s [runs]\n\t%s -h\n\n" "Here 'runs' is the desired number of" " encryption rounds.\n" "Maximum is set to 50 rounds.\n", argv[0], argv[0]); #else printf("Usage: %s\n\t%s -h\n\n", argv[0], argv[0]); #endif return 0; } rounds = atoi(argv[j]); if (rounds < 1) rounds = 1; else if (rounds > 50) rounds = 50; j++; } srandom(time(NULL)); Twofish_initialise(); memset(key, 0, sizeof(key)); memset(inblock, 0, sizeof(inblock)); memcpy(inblock, INDATA, sizeof(inblock)); failures = rounds; while ( rounds ) { #if FIXEDKEY memcpy(key, FIXEDKEYSTR, sizeof(FIXEDKEYSTR)); /* Override values. */ keylen = sizeof(FIXEDKEYSTR); rounds = 1; failures = rounds; #else for (j=0; j < multiple; j++) { seed = random(); memcpy(key + j * sizeof(seed), &seed, sizeof(seed)); } #endif Twofish_prepare_key(key, keylen, &xkey); Twofish_encrypt(&xkey, inblock, intermediary); Twofish_decrypt(&xkey, intermediary, outblock); if ( first_time ) { printf("Called for %d rounds. " "Intermediary blocks:\n\t", rounds); first_time = 0; } else printf("\t"); for (j=0; j<16; j++) { to_hex(hex, intermediary[j]); printf("%c%c", hex[1], hex[0]); } printf("\n"); /* Check if successful crypto-action. */ if ( memcmp(inblock, outblock, sizeof(inblock)) == 0 ) failures--; rounds--; } if ( failures == 0 ) { puts("\nEncryption was reversible. Luckily!"); return 0; } else { printf("\nFailure: %d failures between encryption and decryption!", failures); return 1; } } debian/local/libtwofish.xsl0000644000000000000000000000106311457644713013176 0ustar 1 debian/local/ 0 debian/local/libtwofish.css0000644000000000000000000000014111457544120013143 0ustar div.reference > div.titlepage { text-align: center; } div.titlepage h1.title { color: blue; } debian/local/libtwofish.xml0000644000000000000000000001760011457643507013174 0ustar Mats Erik"> Andersson"> October 20th, 2010"> debain@gisladisker.se"> &lib;"> Debian GNU/Linux"> ]> &paket; Manual for &paket;.
&epost;
&fnamn; &enamn; &aar; &namn; &datum-en;
&handbok-lib; 3 &paket; &version; &lib; Cryptographic library using the twofish algorithm. Description &lib; is a small library to encrypt and decrypt data using the Twofish cryptographic algorithm. Functions void Twofish_initialise Initialise the Twofish crypto engine. This function must be called before any other function in the Twofish implementation is called upon. The call needs only be made once in each application program. Apart from initialising the engine, the call also performs a self test. void Twofish_prepare_key Twofish_Byte key[] int key_len Twofish_key *xkey Convert a cipher key to the internal form used for encryption and decryption. The cipher key is an array of bytes. The type Twofish_Byte is internally defined to a type suitable for your platform. Any key must be converted to the internal representation xkey as a Twofish_key structure before it can be used. The encryption and decryption functions only work with the internal form. The conversion to internal form need only be done once for each key value. Be sure to wipe all key storage, including the Twofish_key structure, once you are done with the key data. A simple call memset(xkey, 0, sizeof(Twofish_key)); will do just fine. Unlike most implementations, the present one allows any key size from zero bytes to 32 bytes. According to the Twofish specifications, irregular key sizes are handled by padding the key with zeroes at the end until the key size is 16, 24, or 32 bytes, whichever comes first. Note that each key of irregular size is equivalent to exactly one key of 16, 24, or 32 bytes. The key length argument key_len must be in the proper range. If key_len is not in the range 0,...,32, this routine attempts to generate a fatal error (depending on the code environment), and at best (or worst) returns without having done anything. void Twofish_encrypt Twofish_key *xkey Twofish_Byte plain[16] Twofish_Byte crypto[16] Encrypt a single block of data. This function encrypts a single block of 16 bytes of data. If you want to encrypt a larger or variable-length message, you will have to use a cipher mode, such as CBC or CTR. These are outside the scope of this implementation. The xkey structure is not modified by this routine, and can be used for further encryption and decryption operations. void Twofish_decrypt Twofish_key *xkey Twofish_Byte crypto[16] Twofish_Byte plain[16] Decrypt a single block of data. This function decrypts a single block of 16 bytes of data. If you want to decrypt a larger or variable-length message, you will have to use a cipher mode, such as CBC or CTR. These are outside the scope of this implementation. The xkey structure is not modified by this routine, and can be used for further encryption and decryption operations. Example /* * catwo.c * * A simple-minded encryptor and decryptor application. * * Usage: catwo {[-e] | -d} key-string < infile > outfile * * The switch "-d" calls for decryption, whereas the optional * switch "-e" entails encryption. * * The argument "key-string" is required to contain at least * two characters, and will be truncated at 32 characters. * The program reads from STDIN and writes to STDOUT. * * Of technical reasons, the encrypted output will be increased * to a size of the nearest multiple of 16. Likewise, any decrypted * output will be padded with NUL until the same size condition holds. */ #include <stdio.h> #include <string.h> #include <stdlib.h> #include <unistd.h> #include <twofish.h> #define MIN_KEYLEN 2 int main(int argc, char * argv[]) { int keylen; int shift = 1, encrypt = 1; Twofish_Byte key[32]; Twofish_key xkey; Twofish_Byte inblock[16], outblock[16]; memset(key, 0, sizeof(key)); if (argc < 2) return 1; /* No key is possible. */ if (strcmp(argv[1], "-d") == 0) encrypt = 0; else if (strcmp(argv[1], "-e") != 0) shift = 0; if (argc - shift < 2) return 1; /* No key is possible. */ keylen = strlen(argv[1 + shift]); if (keylen < MIN_KEYLEN) { fprintf(stderr, "Key material too short.\n"); return 1; } if (keylen > sizeof(key)) keylen = sizeof(key); Twofish_initialise(); strncpy(key, argv[1 + shift], sizeof(key)); memset(inblock, 0, sizeof(inblock)); Twofish_prepare_key(key, keylen, &xkey); while (read(STDIN_FILENO, inblock, sizeof(inblock)) > 0) { if (encrypt) Twofish_encrypt(&xkey, inblock, outblock); else Twofish_decrypt(&xkey, inblock, outblock); write(STDOUT_FILENO, outblock, sizeof(outblock)); memset(inblock, 0, sizeof(inblock)); } return 0; } Author This text was written by &namn; for the &debian; system, but may be used by others. It is mainly collected from the source header file twofish.h. Permission is granted to copy, distribute and/or modify this document under the same terms as &lib; itself.
debian/local/libtwofish.30000644000000000000000000001511311457643543012533 0ustar '\" t .\" Title: libtwofish .\" Author: Mats Erik Andersson .\" Generator: DocBook XSL Stylesheets v1.75.2 .\" Date: October 20th, 2010 .\" Manual: twofish .\" Source: twofish 0.3 .\" Language: English .\" .TH "LIBTWOFISH" "3" "October 20th, 2010" "twofish 0\&.3" "twofish" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" libtwofish \- Cryptographic library using the twofish algorithm\&. .SH "DESCRIPTION" .PP \fBlibtwofish\fR is a small library to encrypt and decrypt data using the Twofish cryptographic algorithm\&. .SH "FUNCTIONS" .HP \w'void\ Twofish_initialise('u .BI "void Twofish_initialise(void);" .PP Initialise the Twofish crypto engine\&. .PP This function \fImust\fR be called before any other function in the Twofish implementation is called upon\&. The call needs only be made once in each application program\&. .PP Apart from initialising the engine, the call also performs a self test\&. .HP \w'void\ Twofish_prepare_key('u .BI "void Twofish_prepare_key(Twofish_Byte\ " "key[]" ", int\ " "key_len" ", Twofish_key\ *" "xkey" ");" .PP Convert a cipher key to the internal form used for encryption and decryption\&. .PP The cipher \fIkey\fR is an array of bytes\&. The type Twofish_Byte is internally defined to a type suitable for your platform\&. .PP Any key must be converted to the internal representation \fIxkey\fR as a Twofish_key structure before it can be used\&. The encryption and decryption functions only work with the internal form\&. The conversion to internal form need only be done once for each key value\&. .PP Be sure to wipe all key storage, including the Twofish_key structure, once you are done with the key data\&. A simple call .sp .if n \{\ .RS 4 .\} .nf memset(xkey, 0, sizeof(Twofish_key)); .fi .if n \{\ .RE .\} .sp will do just fine\&. .PP Unlike most implementations, the present one allows any key size from zero bytes to 32 bytes\&. According to the Twofish specifications, irregular key sizes are handled by padding the key with zeroes at the end until the key size is 16, 24, or 32 bytes, whichever comes first\&. Note that each key of irregular size is equivalent to exactly one key of 16, 24, or 32 bytes\&. .PP The key length argument \fIkey_len\fR must be in the proper range\&. If \fIkey_len\fR is not in the range 0,\&.\&.\&.,32, this routine attempts to generate a fatal error (depending on the code environment), and at best (or worst) returns without having done anything\&. .HP \w'void\ Twofish_encrypt('u .BI "void Twofish_encrypt(Twofish_key\ *" "xkey" ", Twofish_Byte\ " "plain[16]" ", Twofish_Byte\ " "crypto[16]" ");" .PP Encrypt a single block of data\&. .PP This function encrypts a single block of 16 bytes of data\&. If you want to encrypt a larger or variable\-length message, you will have to use a cipher mode, such as CBC or CTR\&. These are outside the scope of this implementation\&. .PP The xkey structure is not modified by this routine, and can be used for further encryption and decryption operations\&. .HP \w'void\ Twofish_decrypt('u .BI "void Twofish_decrypt(Twofish_key\ *" "xkey" ", Twofish_Byte\ " "crypto[16]" ", Twofish_Byte\ " "plain[16]" ");" .PP Decrypt a single block of data\&. .PP This function decrypts a single block of 16 bytes of data\&. If you want to decrypt a larger or variable\-length message, you will have to use a cipher mode, such as CBC or CTR\&. These are outside the scope of this implementation\&. .PP The xkey structure is not modified by this routine, and can be used for further encryption and decryption operations\&. .SH "EXAMPLE" .sp .if n \{\ .RS 4 .\} .nf /* * catwo\&.c * * A simple\-minded encryptor and decryptor application\&. * * Usage: catwo {[\-e] | \-d} key\-string < infile > outfile * * The switch "\-d" calls for decryption, whereas the optional * switch "\-e" entails encryption\&. * * The argument "key\-string" is required to contain at least * two characters, and will be truncated at 32 characters\&. * The program reads from STDIN and writes to STDOUT\&. * * Of technical reasons, the encrypted output will be increased * to a size of the nearest multiple of 16\&. Likewise, any decrypted * output will be padded with NUL until the same size condition holds\&. */ #include #include #include #include #include #define MIN_KEYLEN 2 int main(int argc, char * argv[]) { int keylen; int shift = 1, encrypt = 1; Twofish_Byte key[32]; Twofish_key xkey; Twofish_Byte inblock[16], outblock[16]; memset(key, 0, sizeof(key)); if (argc < 2) return 1; /* No key is possible\&. */ if (strcmp(argv[1], "\-d") == 0) encrypt = 0; else if (strcmp(argv[1], "\-e") != 0) shift = 0; if (argc \- shift < 2) return 1; /* No key is possible\&. */ keylen = strlen(argv[1 + shift]); if (keylen < MIN_KEYLEN) { fprintf(stderr, "Key material too short\&.\en"); return 1; } if (keylen > sizeof(key)) keylen = sizeof(key); Twofish_initialise(); strncpy(key, argv[1 + shift], sizeof(key)); memset(inblock, 0, sizeof(inblock)); Twofish_prepare_key(key, keylen, &xkey); while (read(STDIN_FILENO, inblock, sizeof(inblock)) > 0) { if (encrypt) Twofish_encrypt(&xkey, inblock, outblock); else Twofish_decrypt(&xkey, inblock, outblock); write(STDOUT_FILENO, outblock, sizeof(outblock)); memset(inblock, 0, sizeof(inblock)); } return 0; } .fi .if n \{\ .RE .\} .SH "AUTHOR" .PP This text was written by Mats Erik Andersson for the Debian GNU/Linux system, but may be used by others\&. It is mainly collected from the source header file twofish\&.h\&. Permission is granted to copy, distribute and/or modify this document under the same terms as libtwofish itself\&. .SH "AUTHOR" .PP \fBMats Erik Andersson\fR .RS 4 Author. .RE .SH "COPYRIGHT" .br Copyright \(co 2010 Mats Erik Andersson .br debian/changelog0000644000000000000000000000423011460100271011027 0ustar twofish (0.3-3) unstable; urgency=low * Standards-Version: 3.9.1. + debian/rules: Delete the use of "-D_REENTRANT". * debian/control: + Add Vcs-* pointers to "deb-maint" at Alioth. * lintian-overrides: No upstream changelog is present. + Affects libtwofish-dev and libtwofish0. * debian/local/catwo.c: New example application. + debian/libtwofish-dev.examples: Mention that file. * Extended documentation: + A new example and many typographic corrections. + debian/local/libtwofish.xml: New example "catwo.c". + debian/local/libtwofish.xsl: New file. + debian/local/libtwofish.3: Regenerated. -- Mats Erik Andersson Thu, 21 Oct 2010 20:04:13 +0200 twofish (0.3-2) unstable; urgency=low * New maintainer. (Closes: #522262) * Standards-Version: 3.9.0, compatibility 7. + Section 'libdevel'. + Use 'dh_prep'. * debian/patches/01-conditionals.diff: New file. * Build a shared library package: libtwofish0. * Add a simple manpage and Docbook source. + debian/local/libtwofish.3: New file -- Mats Erik Andersson Thu, 22 Jul 2010 15:03:53 +0200 twofish (0.3-1) unstable; urgency=low * new upstream version + Improved ISO/ANSI standard adherence. + Renamed a macro to avoid a naming conflict with a rogue gcc header file. * debian/control: add dependency on libc6-dev | libc-dev * debian/copyright: updated * debian/patches: deleted * debian/rules: - stop compiling with -D__USE_STRING_INLINES and -D__OPTIMIZE__ - support DEB_BUILD_OPTIONS=noopts -- Branden Robinson Fri, 27 Sep 2002 23:24:30 -0500 twofish (0.2-1) unstable; urgency=low * initial release (Closes: #161079) * Thanks to Andew Suffield for eliminating this package's dependency on the C library (the three required C library functions are included in the static object). -- Branden Robinson Sun, 22 Sep 2002 14:28:38 -0500 twofish (0.0-0) unstable; urgency=low * Fake entry to hide a lintian error. vim:set ai tw=78 et sw=2 sts=2: -- Branden Robinson Sun, 22 Sep 2002 14:28:38 -0500 debian/libtwofish0.symbols0000644000000000000000000000022411457544120013033 0ustar libtwofish.so.0 libtwofish0 #MINVER# Twofish_initialise@Base 0.3 Twofish_prepare_key@Base 0.3 Twofish_encrypt@Base 0.3 Twofish_decrypt@Base 0.3 debian/source/0000755000000000000000000000000011460107646010473 5ustar debian/source/format0000644000000000000000000000001411457544120011677 0ustar 3.0 (quilt) debian/watch0000644000000000000000000000016111457544120010220 0ustar #version=3 # # The original source is now missing: # http://www.macfergus.com/niels/code/TwofishClib-v0.3.zip debian/patches/0000755000000000000000000000000011460115561010615 5ustar debian/patches/series0000644000000000000000000000002511457544120012032 0ustar 01-conditionals.diff debian/patches/01-conditionals.diff0000644000000000000000000000355311457544120014364 0ustar Description: Stringent conditional clauses. A handful conditionals use a bit-OR testing, where an inclusive OR is the proper mechanism. Author: Mats Erik Andersson Forwarded: no Last-Update: 2010-07-21 --- twofish-0.3.orig/twofish.c 2002-09-28 06:15:46.000000000 +0200 +++ twofish-0.3/twofish.c 2010-07-21 16:15:33.000000000 +0200 @@ -357,7 +357,7 @@ * This default definition of SWAP works, but on many platforms there is a * more efficient implementation. */ -#define BSWAP(x) (ROL32((x),8)&0x00ff00ff | ROR32((x),8) & 0xff00ff00) +#define BSWAP(x) ((ROL32((x),8) & 0x00ff00ff) | (ROR32((x),8) & 0xff00ff00)) /* @@ -495,11 +495,11 @@ static void test_platform() * The first check in each case is to make sure the size is correct. * The second check is to ensure that it is an unsigned type. */ - if( (UInt32)((UInt32)1 << 31) == 0 | (UInt32)-1 < 0 ) + if( ((UInt32) ((UInt32)1 << 31) == 0) || ((UInt32)-1 < 0) ) { Twofish_fatal( "Twofish code: Twofish_UInt32 type not suitable" ); } - if( sizeof( Byte ) != 1 | (Byte)-1 < 0 ) + if( (sizeof( Byte ) != 1) || ((Byte)-1 < 0) ) { Twofish_fatal( "Twofish code: Twofish_Byte type not suitable" ); } @@ -567,7 +567,7 @@ static void test_platform() } /* Test the BSWAP macro */ - if( BSWAP(C) != 0x12345678UL ) + if( (BSWAP(C)) != 0x12345678UL ) { /* * The BSWAP macro should always work, even if you are not using it. @@ -577,7 +577,7 @@ static void test_platform() } /* And we can test the b macros which use SELECT_BYTE. */ - if( b0(C)!=0x12 | b1(C) != 0x34 | b2(C) != 0x56 | b3(C) != 0x78 ) + if( (b0(C)!=0x12) || (b1(C) != 0x34) || (b2(C) != 0x56) || (b3(C) != 0x78) ) { /* * There are many reasons why this could fail. debian/libtwofish0.lintian-overrides0000644000000000000000000000014611457545470015015 0ustar libtwofish0: copyright-should-refer-to-common-license-file-for-gpl libtwofish0: no-upstream-changelog debian/libtwofish-dev.links0000644000000000000000000000005611457544120013162 0ustar usr/lib/libtwofish.so.0 usr/lib/libtwofish.so debian/copyright0000644000000000000000000000560411457544120011131 0ustar Format-Specification: http://sv.debian.org/wsvn/dep/web/deps/dep5.mdwn?op=file&rev=135 Name: twofish Maintainer: Niels Ferguson Source: http://www.macfergus.com/niels/code/TwofishClib-v0.3.zip Files: main.c twofish.c twofish.h Copyright: 2002, Niels Ferguson. License: other The author hereby grants a perpetual license to everybody to use this code for any purpose as long as the copyright message is included in the source code of this or any derived work. . Yes, this means that you, your company, your club, and anyone else can use this code anywhere you want. You can change it and distribute it under the GPL, include it in your commercial product without releasing the source code, put it on the web, etc. The only thing you cannot do is remove my copyright message, or distribute any source code based on this implementation that does not include my copyright message. . I appreciate a mention in the documentation or credits, but I understand if that is difficult to do. I also appreciate it if you tell me where and why you used my code. . DISCLAIMER: As I'm giving away my work for free, I'm of course not going to accept any liability of any form. This code, or the Twofish cipher, might very well be flawed; you have been warned. This software is provided as-is, without any kind of warrenty or guarantee. And that is really all you can expect when you download code for free from the Internet. Files: debian/* Copyright: 2002, Branden Robinson 2010, Mats Erik Andersson X-Comment: This package was debianised by Branden Robinson on Sun, 22 Sep 2002 14:28:38 -0500. License: other Unless otherwise noted, all independently copyrightable modifications and additions to twofish found in its Debian packages bear the following copyright and license terms: Copyright 2002 Software in the Public Interest, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL SOFTWARE IN THE PUBLIC INTEREST, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. debian/libtwofish-dev.manpages0000644000000000000000000000003211457544120013627 0ustar debian/local/libtwofish.3 debian/rules0000755000000000000000000000344111457551357010265 0ustar #!/usr/bin/make -f # Debian package build rules file for twofish CFLAGS = -Wall -g # if $DEB_BUILD_OPTIONS *doesn't* contain "noopt" ifeq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) CFLAGS += -O0 else CFLAGS += -O2 endif SONAME = libtwofish.so.0 ANAME = libtwofish.a ALINKING = -ltwofish # Install files to the following directory. DEVDESTDIR := debian/libtwofish-dev SODESTDIR := debian/libtwofish0 #SODESTDIR := $(DEVDESTDIR) build-arch: build-arch-stamp build-arch-stamp: dh_testdir # gcc -c -o twofish.o $(CFLAGS) twofish.c ar clq $(ANAME) twofish.o ranlib $(ANAME) # Shared library -rm twofish.o gcc $(CFLAGS) -fPIC -shared -Wl,-soname,$(SONAME) \ -Wl,-z,defs -lc -o $(SONAME) twofish.c # # test suite gcc -o twofishtest $(CFLAGS) main.c -L. $(ALINKING) ./twofishtest touch build-arch-stamp clean: dh_testdir dh_testroot rm -f build-arch-stamp -rm -f twofish.o $(ANAME) twofishtest $(SONAME) dh_clean install: build dh_testdir dh_testroot dh_prep dh_installdirs install -m 755 -d $(DEVDESTDIR)/usr/lib install -m 644 $(ANAME) $(DEVDESTDIR)/usr/lib install -m 755 -d $(DEVDESTDIR)/usr/include install -m 644 twofish.h $(DEVDESTDIR)/usr/include install -m 755 -d $(SODESTDIR)/usr/lib install -m 644 $(SONAME) $(SODESTDIR)/usr/lib binary-arch: build install dh_testdir dh_testroot dh_installdocs dh_installman dh_installchangelogs dh_installexamples dh_install dh_link dh_strip dh_compress dh_fixperms dh_lintian dh_makeshlibs -V dh_installdeb -a dh_shlibdeps -a dh_gencontrol dh_md5sums dh_builddeb build-indep: # no architecture-indepdent files to build binary-indep: # no architecture-indepdent packages to build build: build-arch build-indep binary: binary-arch binary-indep .PHONY: build binary clean install build-arch build-indep binary-arch binary-indep debian/libtwofish-dev.lintian-overrides0000644000000000000000000000015411457545455015513 0ustar libtwofish-dev: copyright-should-refer-to-common-license-file-for-gpl libtwofish-dev: no-upstream-changelog debian/libtwofish-dev.examples0000644000000000000000000000007111457571040013656 0ustar debian/local/simple-internal-test.c debian/local/catwo.c debian/compat0000644000000000000000000000000211457544120010367 0ustar 7