You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(12) |
Jul
(47) |
Aug
(21) |
Sep
(5) |
Oct
(17) |
Nov
|
Dec
(8) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(4) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(9) |
Aug
|
Sep
(3) |
Oct
|
Nov
|
Dec
|
2003 |
Jan
|
Feb
(6) |
Mar
(7) |
Apr
(8) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(9) |
Nov
|
Dec
|
2004 |
Jan
(8) |
Feb
(46) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2005 |
Jan
|
Feb
|
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2006 |
Jan
(27) |
Feb
(2) |
Mar
|
Apr
(64) |
May
|
Jun
|
Jul
(11) |
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
(2) |
From: Robert K. <may...@us...> - 2002-07-08 19:40:01
|
Update of /cvsroot/bitcollider/bitcollider/include In directory usw-pr-cvs1:/tmp/cvs-serv31875a/include Modified Files: bc_version.h Log Message: Updated version numbers and such... Index: bc_version.h =================================================================== RCS file: /cvsroot/bitcollider/bitcollider/include/bc_version.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** bc_version.h 5 Dec 2001 09:02:32 -0000 1.6 --- bc_version.h 8 Jul 2002 19:39:57 -0000 1.7 *************** *** 22,26 **** /* Your agent-version string; should be #[.#[.#[etc]]] format */ ! #define BC_VERSION "0.3.4" #endif --- 22,26 ---- /* Your agent-version string; should be #[.#[.#[etc]]] format */ ! #define BC_VERSION "0.4.0" #endif |
From: Robert K. <may...@us...> - 2002-07-08 19:40:01
|
Update of /cvsroot/bitcollider/bitcollider In directory usw-pr-cvs1:/tmp/cvs-serv31875a Modified Files: aclocal.m4 config.h.in Log Message: Updated version numbers and such... Index: aclocal.m4 =================================================================== RCS file: /cvsroot/bitcollider/bitcollider/aclocal.m4,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** aclocal.m4 5 Dec 2001 23:42:49 -0000 1.9 --- aclocal.m4 8 Jul 2002 19:39:56 -0000 1.10 *************** *** 103,2854 **** AC_SUBST($1)]) - # libtool.m4 - Configure libtool for the host system. -*-Shell-script-*- ! # serial 46 AC_PROG_LIBTOOL ! AC_DEFUN([AC_PROG_LIBTOOL], [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl ! # This can be used to rebuild libtool when needed ! LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" [...3515 lines suppressed...] ! # This is just to silence aclocal about the macro not being used ! ifelse([AC_DISABLE_FAST_INSTALL]) # Like AC_CONFIG_HEADER, but automatically create stamp file. --- 509,523 ---- ]) ! dnl old names ! AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl ! AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl ! AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl ! AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl ! AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl ! AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl ! AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl ! dnl This is just to silence aclocal about the macro not being used ! ifelse([AC_DISABLE_FAST_INSTALL])dnl # Like AC_CONFIG_HEADER, but automatically create stamp file. Index: config.h.in =================================================================== RCS file: /cvsroot/bitcollider/bitcollider/config.h.in,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** config.h.in 5 Dec 2001 23:42:49 -0000 1.9 --- config.h.in 8 Jul 2002 19:39:56 -0000 1.10 *************** *** 12,18 **** #undef SIZEOF_LONG - /* Define if you have the <dlfcn.h> header file. */ - #undef HAVE_DLFCN_H - /* Name of package */ #undef PACKAGE --- 12,15 ---- |
From: Gordon M. <go...@us...> - 2002-07-06 09:38:05
|
Update of /cvsroot/bitcollider/bitcollider/include In directory usw-pr-cvs1:/tmp/cvs-serv32765 Modified Files: ed2k_md4.h ftuuhash.h tiger.h Log Message: support for ed2k, fasttrack identifiers Index: ed2k_md4.h =================================================================== RCS file: /cvsroot/bitcollider/bitcollider/include/ed2k_md4.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** ed2k_md4.h 6 Jul 2002 09:00:11 -0000 1.1 --- ed2k_md4.h 6 Jul 2002 09:38:02 -0000 1.2 *************** *** 1,4 **** /* Support for calculating EDonkey2000 hashes. ! * * $Id$ */ --- 1,4 ---- /* Support for calculating EDonkey2000 hashes. ! * * $Id$ */ Index: ftuuhash.h =================================================================== RCS file: /cvsroot/bitcollider/bitcollider/include/ftuuhash.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** ftuuhash.h 6 Jul 2002 09:00:11 -0000 1.1 --- ftuuhash.h 6 Jul 2002 09:38:02 -0000 1.2 *************** *** 1,3 **** ! /* * $Id$ */ --- 1,4 ---- ! /* Support for calculating fasttrack identifiers ! * * $Id$ */ Index: tiger.h =================================================================== RCS file: /cvsroot/bitcollider/bitcollider/include/tiger.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** tiger.h 6 Jul 2002 09:00:11 -0000 1.4 --- tiger.h 6 Jul 2002 09:38:02 -0000 1.5 *************** *** 30,33 **** void tiger(word64 *str, word64 length, word64 *res); ! #endif --- 30,33 ---- void tiger(word64 *str, word64 length, word64 *res); ! #endif |
From: Gordon M. <go...@us...> - 2002-07-06 09:30:18
|
Update of /cvsroot/bitcollider/bitcollider/lib In directory usw-pr-cvs1:/tmp/cvs-serv31301 Modified Files: Makefile.am main.c Added Files: ed2k_md4.c ftuuhash.c Log Message: added ed2k, ftuu hash calculations, removed plain MD5 --- NEW FILE: ed2k_md4.c --- /* Support for calculating EDonkey2000 hashes. * * The functions which begin "ED2K" are created and placed in * the public domain by The Bitzi Corporation. * * The code implementing MD4 is (C) RSA; see the notice below * for details. * * $Id: ed2k_md4.c,v 1.1 2002/07/06 09:30:15 gojomo Exp $ */ #include <string.h> /* for memcpy() */ #include "ed2k_md4.h" unsigned int EDSEG_SIZE = 1024*9500; // 9,728,000 /* FOR THE MD4 CODE: Copyright (C) 1990-2, RSA Data Security, Inc. All rights reserved. License to copy and use this software is granted provided that it is identified as the "RSA Data Security, Inc. MD4 Message-Digest Algorithm" in all material mentioning or referencing this software or this function. License is also granted to make and use derivative works provided that such works are identified as "derived from the RSA Data Security, Inc. MD4 Message-Digest Algorithm" in all material mentioning or referencing the derived work. RSA Data Security, Inc. makes no representations concerning either the merchantability of this software or the suitability of this software for any particular purpose. It is provided "as is" without express or implied warranty of any kind. These notices must be retained in any copies of any part of this documentation and/or software. */ // Constants for MD4Transform routine. #define S11 3 #define S12 7 #define S13 11 #define S14 19 #define S21 3 #define S22 5 #define S23 9 #define S24 13 #define S31 3 #define S32 9 #define S33 11 #define S34 15 static void MD4Transform(w32 [4], const unsigned char [64]); static void Encode(unsigned char *, w32 *, unsigned int); static void Decode(w32 *, const unsigned char *, unsigned int); static unsigned char PADDING[64] = { 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; /* F, G and H are basic MD4 functions. */ #define F(x, y, z) (((x) & (y)) | ((~x) & (z))) #define G(x, y, z) (((x) & (y)) | ((x) & (z)) | ((y) & (z))) #define H(x, y, z) ((x) ^ (y) ^ (z)) /* ROTATE_LEFT rotates x left n bits. */ #define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n)))) /* FF, GG and HH are transformations for rounds 1, 2 and 3 */ /* Rotation is separate from addition to prevent recomputation */ #define FF(a, b, c, d, x, s) { \ (a) += F ((b), (c), (d)) + (x); \ (a) = ROTATE_LEFT ((a), (s)); \ } #define GG(a, b, c, d, x, s) { \ (a) += G ((b), (c), (d)) + (x) + (w32)0x5a827999; \ (a) = ROTATE_LEFT ((a), (s)); \ } #define HH(a, b, c, d, x, s) { \ (a) += H ((b), (c), (d)) + (x) + (w32)0x6ed9eba1; \ (a) = ROTATE_LEFT ((a), (s)); \ } /* MD4 initialization. Begins an MD4 operation, writing a new context. */ void MD4Init(MD4_CTX *context) /* context */ { context->count[0] = context->count[1] = 0; /* Load magic initialization constants. */ context->state[0] = 0x67452301; context->state[1] = 0xefcdab89; context->state[2] = 0x98badcfe; context->state[3] = 0x10325476; } /* MD4 block update operation. Continues an MD4 message-digest operation, processing another message block, and updating the context. */ void MD4Update(MD4_CTX *context, /* context */ const unsigned char *input, /* input block */ unsigned int inputLen) /* length of input block */ { unsigned int i, index, partLen; /* Compute number of bytes mod 64 */ index = (unsigned int)((context->count[0] >> 3) & 0x3F); /* Update number of bits */ if ((context->count[0] += ((w32)inputLen << 3)) < ((w32)inputLen << 3)) context->count[1]++; context->count[1] += ((w32)inputLen >> 29); partLen = 64 - index; /* Transform as many times as possible. */ if (inputLen >= partLen) { //i4_memcpy(&context->buffer[index], input, partLen); memcpy(&context->buffer[index], input, partLen); MD4Transform (context->state, context->buffer); for (i = partLen; i + 63 < inputLen; i += 64) MD4Transform (context->state, &input[i]); index = 0; } else i = 0; /* Buffer remaining input */ //i4_memcpy(&context->buffer[index], &input[i], inputLen-i); memcpy(&context->buffer[index], &input[i], inputLen-i); } /* MD4 finalization. Ends an MD4 message-digest operation, writing the the message digest and zeroizing the context. *//* message digest *//* context */ void MD4Final(unsigned char digest[16],MD4_CTX *context) { unsigned char bits[8]; unsigned int index, padLen; /* Save number of bits */ Encode (bits, context->count, 8); /* Pad out to 56 mod 64. */ index = (unsigned int)((context->count[0] >> 3) & 0x3f); padLen = (index < 56) ? (56 - index) : (120 - index); MD4Update (context, PADDING, padLen); /* Append length (before padding) */ MD4Update (context, bits, 8); /* Store state in digest */ Encode (digest, context->state, 16); /* Zeroize sensitive information. */ // i4_memset(context, 0, sizeof (*context)); memset(context, 0, sizeof (*context)); } /* MD4 basic transformation. Transforms state based on block. */ static void MD4Transform(w32 state[4], const unsigned char block[64]) { w32 a = state[0], b = state[1], c = state[2], d = state[3], x[16]; Decode (x, block, 64); /* Round 1 */ FF (a, b, c, d, x[ 0], S11); /* 1 */ FF (d, a, b, c, x[ 1], S12); /* 2 */ FF (c, d, a, b, x[ 2], S13); /* 3 */ FF (b, c, d, a, x[ 3], S14); /* 4 */ FF (a, b, c, d, x[ 4], S11); /* 5 */ FF (d, a, b, c, x[ 5], S12); /* 6 */ FF (c, d, a, b, x[ 6], S13); /* 7 */ FF (b, c, d, a, x[ 7], S14); /* 8 */ FF (a, b, c, d, x[ 8], S11); /* 9 */ FF (d, a, b, c, x[ 9], S12); /* 10 */ FF (c, d, a, b, x[10], S13); /* 11 */ FF (b, c, d, a, x[11], S14); /* 12 */ FF (a, b, c, d, x[12], S11); /* 13 */ FF (d, a, b, c, x[13], S12); /* 14 */ FF (c, d, a, b, x[14], S13); /* 15 */ FF (b, c, d, a, x[15], S14); /* 16 */ /* Round 2 */ GG (a, b, c, d, x[ 0], S21); /* 17 */ GG (d, a, b, c, x[ 4], S22); /* 18 */ GG (c, d, a, b, x[ 8], S23); /* 19 */ GG (b, c, d, a, x[12], S24); /* 20 */ GG (a, b, c, d, x[ 1], S21); /* 21 */ GG (d, a, b, c, x[ 5], S22); /* 22 */ GG (c, d, a, b, x[ 9], S23); /* 23 */ GG (b, c, d, a, x[13], S24); /* 24 */ GG (a, b, c, d, x[ 2], S21); /* 25 */ GG (d, a, b, c, x[ 6], S22); /* 26 */ GG (c, d, a, b, x[10], S23); /* 27 */ GG (b, c, d, a, x[14], S24); /* 28 */ GG (a, b, c, d, x[ 3], S21); /* 29 */ GG (d, a, b, c, x[ 7], S22); /* 30 */ GG (c, d, a, b, x[11], S23); /* 31 */ GG (b, c, d, a, x[15], S24); /* 32 */ /* Round 3 */ HH (a, b, c, d, x[ 0], S31); /* 33 */ HH (d, a, b, c, x[ 8], S32); /* 34 */ HH (c, d, a, b, x[ 4], S33); /* 35 */ HH (b, c, d, a, x[12], S34); /* 36 */ HH (a, b, c, d, x[ 2], S31); /* 37 */ HH (d, a, b, c, x[10], S32); /* 38 */ HH (c, d, a, b, x[ 6], S33); /* 39 */ HH (b, c, d, a, x[14], S34); /* 40 */ HH (a, b, c, d, x[ 1], S31); /* 41 */ HH (d, a, b, c, x[ 9], S32); /* 42 */ HH (c, d, a, b, x[ 5], S33); /* 43 */ HH (b, c, d, a, x[13], S34); /* 44 */ HH (a, b, c, d, x[ 3], S31); /* 45 */ HH (d, a, b, c, x[11], S32); /* 46 */ HH (c, d, a, b, x[ 7], S33); /* 47 */ HH (b, c, d, a, x[15], S34); /* 48 */ state[0] += a; state[1] += b; state[2] += c; state[3] += d; /* Zeroize sensitive information. */ //i4_memset(x, 0, sizeof(x)); memset(x, 0, sizeof(x)); } /* Encodes input (w32) into output (unsigned char). Assumes len is a multiple of 4. */ static void Encode(unsigned char *output,w32 *input,unsigned int len) { unsigned int i, j; for (i = 0, j = 0; j < len; i++, j += 4) { output[j] = (unsigned char)(input[i] & 0xff); output[j+1] = (unsigned char)((input[i] >> 8) & 0xff); output[j+2] = (unsigned char)((input[i] >> 16) & 0xff); output[j+3] = (unsigned char)((input[i] >> 24) & 0xff); } } /* Decodes input (unsigned char) into output (w32). Assumes len is a multiple of 4. */ static void Decode(w32 *output, const unsigned char *input,unsigned int len) { unsigned int i, j; for (i = 0, j = 0; j < len; i++, j += 4) output[i] = ((w32)input[j]) | (((w32)input[j+1]) << 8) | (((w32)input[j+2]) << 16) | (((w32)input[j+3]) << 24); } /* FROM THIS POINT ON: * * (PD) 2001 The Bitzi Corporation * Please see file COPYING or http://bitzi.com/publicdomain * for more info. * * Modelled on example code provided by EDonkey developer, * but reimplemented. * * EDonkey hash identifiers are calculated by: * (1) taking the MD4 hash of each 9,728,000 byte range of the file * (2) concatenating all those hashes together * (3) taking the MD4 of the concatenation * */ /* ED2KHash initialization. Set up the two internal MD4 contexts. */ void ED2KInit(ED2K_CTX *context) /* context */ { context->nextPos = 0; MD4Init(&(context->seg_ctx)); MD4Init(&(context->top_ctx)); } /* ED2KHash block update operation. */ void ED2KUpdate(ED2K_CTX *context, /* context */ const unsigned char *input, /* input block */ unsigned int inputLen) /* length of input block */ { unsigned int firstLen; unsigned char innerDigest[16]; // first, do no harm if(inputLen==0) return; // now, close up any segment that's been completed if((context->nextPos > 0) && ((context->nextPos % EDSEG_SIZE)==0) ) { // finish MD4Final(innerDigest,&(context->seg_ctx)); // feed it to the overall hash MD4Update(&(context->top_ctx),innerDigest,16); // reset the current segment MD4Init(&(context->seg_ctx)); } // now, handle the new data if((context->nextPos/EDSEG_SIZE)==(context->nextPos+inputLen)/EDSEG_SIZE) { // not finishing any segments, just keep feeding segment hash MD4Update(&(context->seg_ctx),input,inputLen); context->nextPos += inputLen; return; } // OK, we're reaching or crossing a segment-end // finish the current segment firstLen = EDSEG_SIZE-(context->nextPos % EDSEG_SIZE); MD4Update(&(context->seg_ctx),input,firstLen); context->nextPos += firstLen; // continue with passed-in info ED2KUpdate(context,input+firstLen,inputLen-firstLen); } /* ED2KHash finalization. *//* message digest *//* context */ void ED2KFinal(unsigned char digest[16],ED2K_CTX *context) { unsigned char innerDigest[16]; if(context->nextPos <= EDSEG_SIZE) { // there was only one segment; return its hash MD4Final(digest,&(context->seg_ctx)); return; } // finish the segment in process MD4Final(innerDigest,&(context->seg_ctx)); // feed it to the overall hash MD4Update(&(context->top_ctx),innerDigest,16); // finish the overall hash MD4Final(digest,&(context->top_ctx)); } --- NEW FILE: ftuuhash.c --- /* (PD) 2001 The Bitzi Corporation * Please see file COPYING or http://bitzi.com/publicdomain * for more info. * * $Id: ftuuhash.c,v 1.1 2002/07/06 09:30:15 gojomo Exp $ * * Support for calculating FastTrack internal hashes * * Based on the definition of the FastTrack hash used * by the giFT project; reworked to allow calculation * in one stream pass, rather than with file-seeks and * a filesize known in advance. * * FT identifiers are roughly: * 16 bytes: md5 of first 307,200 bytes of file * 4 bytes: result of running a more simple "smallHash" * over a number of ranges of the file, including: * * - the 307,200 bytes starting at each 1MiB, 2MiB, 4MiB, * 8MiB, 16MiB, etc offset within the file * * - the last 307,200 bytes of the file (or less * if the filesize < 614,400) * * The last 307,200 has precedence over the 307,200 * starting at any sampling point -- so for example, * in a file that's 1.5 MiB, the range from 1MiB to * 1MiB+307200 is not sampled, because it would overlap * into the 307,200-long endseg. * * Since this code does not know the stream's length in advance, * it uses a big rolling window of file contents, and can rollback * the smallhash if the end is discovered within 307200 of the * last sample range end. (Seeding the FTUU_CTX with the file's * length would obviate the need for that rolling window... * probably speeding up the process a lot.) * */ #include "ftuuhash.h" #include "md5.h" #include <stdio.h> #include <string.h> static const unsigned int FTSEG_SIZE = 307200; // table from giFT project static const unsigned int smalltable[256] = { 0x00000000,0x77073096,0xEE0E612C,0x990951BA, 0x076DC419,0x706AF48F,0xE963A535,0x9E6495A3, 0x0EDB8832,0x79DCB8A4,0xE0D5E91E,0x97D2D988, 0x09B64C2B,0x7EB17CBD,0xE7B82D07,0x90BF1D91, 0x1DB71064,0x6AB020F2,0xF3B97148,0x84BE41DE, 0x1ADAD47D,0x6DDDE4EB,0xF4D4B551,0x83D385C7, 0x136C9856,0x646BA8C0,0xFD62F97A,0x8A65C9EC, 0x14015C4F,0x63066CD9,0xFA0F3D63,0x8D080DF5, 0x3B6E20C8,0x4C69105E,0xD56041E4,0xA2677172, 0x3C03E4D1,0x4B04D447,0xD20D85FD,0xA50AB56B, 0x35B5A8FA,0x42B2986C,0xDBBBC9D6,0xACBCF940, 0x32D86CE3,0x45DF5C75,0xDCD60DCF,0xABD13D59, 0x26D930AC,0x51DE003A,0xC8D75180,0xBFD06116, 0x21B4F4B5,0x56B3C423,0xCFBA9599,0xB8BDA50F, 0x2802B89E,0x5F058808,0xC60CD9B2,0xB10BE924, 0x2F6F7C87,0x58684C11,0xC1611DAB,0xB6662D3D, 0x76DC4190,0x01DB7106,0x98D220BC,0xEFD5102A, 0x71B18589,0x06B6B51F,0x9FBFE4A5,0xE8B8D433, 0x7807C9A2,0x0F00F934,0x9609A88E,0xE10E9818, 0x7F6A0DBB,0x086D3D2D,0x91646C97,0xE6635C01, 0x6B6B51F4,0x1C6C6162,0x856530D8,0xF262004E, 0x6C0695ED,0x1B01A57B,0x8208F4C1,0xF50FC457, 0x65B0D9C6,0x12B7E950,0x8BBEB8EA,0xFCB9887C, 0x62DD1DDF,0x15DA2D49,0x8CD37CF3,0xFBD44C65, 0x4DB26158,0x3AB551CE,0xA3BC0074,0xD4BB30E2, 0x4ADFA541,0x3DD895D7,0xA4D1C46D,0xD3D6F4FB, 0x4369E96A,0x346ED9FC,0xAD678846,0xDA60B8D0, 0x44042D73,0x33031DE5,0xAA0A4C5F,0xDD0D7CC9, 0x5005713C,0x270241AA,0xBE0B1010,0xC90C2086, 0x5768B525,0x206F85B3,0xB966D409,0xCE61E49F, 0x5EDEF90E,0x29D9C998,0xB0D09822,0xC7D7A8B4, 0x59B33D17,0x2EB40D81,0xB7BD5C3B,0xC0BA6CAD, 0xEDB88320,0x9ABFB3B6,0x03B6E20C,0x74B1D29A, 0xEAD54739,0x9DD277AF,0x04DB2615,0x73DC1683, 0xE3630B12,0x94643B84,0x0D6D6A3E,0x7A6A5AA8, 0xE40ECF0B,0x9309FF9D,0x0A00AE27,0x7D079EB1, 0xF00F9344,0x8708A3D2,0x1E01F268,0x6906C2FE, 0xF762575D,0x806567CB,0x196C3671,0x6E6B06E7, 0xFED41B76,0x89D32BE0,0x10DA7A5A,0x67DD4ACC, 0xF9B9DF6F,0x8EBEEFF9,0x17B7BE43,0x60B08ED5, 0xD6D6A3E8,0xA1D1937E,0x38D8C2C4,0x4FDFF252, 0xD1BB67F1,0xA6BC5767,0x3FB506DD,0x48B2364B, 0xD80D2BDA,0xAF0A1B4C,0x36034AF6,0x41047A60, 0xDF60EFC3,0xA867DF55,0x316E8EEF,0x4669BE79, 0xCB61B38C,0xBC66831A,0x256FD2A0,0x5268E236, 0xCC0C7795,0xBB0B4703,0x220216B9,0x5505262F, 0xC5BA3BBE,0xB2BD0B28,0x2BB45A92,0x5CB36A04, 0xC2D7FFA7,0xB5D0CF31,0x2CD99E8B,0x5BDEAE1D, 0x9B64C2B0,0xEC63F226,0x756AA39C,0x026D930A, 0x9C0906A9,0xEB0E363F,0x72076785,0x05005713, 0x95BF4A82,0xE2B87A14,0x7BB12BAE,0x0CB61B38, 0x92D28E9B,0xE5D5BE0D,0x7CDCEFB7,0x0BDBDF21, 0x86D3D2D4,0xF1D4E242,0x68DDB3F8,0x1FDA836E, 0x81BE16CD,0xF6B9265B,0x6FB077E1,0x18B74777, 0x88085AE6,0xFF0F6A70,0x66063BCA,0x11010B5C, 0x8F659EFF,0xF862AE69,0x616BFFD3,0x166CCF45, 0xA00AE278,0xD70DD2EE,0x4E048354,0x3903B3C2, 0xA7672661,0xD06016F7,0x4969474D,0x3E6E77DB, 0xAED16A4A,0xD9D65ADC,0x40DF0B66,0x37D83BF0, 0xA9BCAE53,0xDEBB9EC5,0x47B2CF7F,0x30B5FFE9, 0xBDBDF21C,0xCABAC28A,0x53B39330,0x24B4A3A6, 0xBAD03605,0xCDD70693,0x54DE5729,0x23D967BF, 0xB3667A2E,0xC4614AB8,0x5D681B02,0x2A6F2B94, 0xB40BBE37,0xC30C8EA1,0x5A05DF1B,0x2D02EF8D }; /** * Update the 4-byte running small hash; also from giFT project */ unsigned int hashSmallHash(byte *data, size_t len, unsigned int hash) { unsigned int i; for(i=0;i<len;++i) { hash = smalltable[data[i] ^ (hash & 0xff)] ^ (hash >> 8); } return hash; } // dirt simple base64 encoding. caller should ensure out has enough space. // no '=' padding provided, but string is zero-terminated. void bitziEncodeBase64(byte *raw, int len, char *out) { char *base64digits = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; int bitsNeeded = 6; int bitPosition = 7; int rawIndex = 0; int strIndex = 0; int bit = 0; int digit = 0; while (rawIndex < len) { while (bitsNeeded > 0) { if (bitPosition >= 0) { bit = (raw[rawIndex]>>bitPosition) & 1; digit = digit << 1; digit += bit; bitsNeeded--; bitPosition--; } else { rawIndex++; bitPosition=7; if (rawIndex>len) { digit = digit << bitsNeeded; bitsNeeded = 0; } } } out[strIndex]=base64digits[digit]; digit=0; bitsNeeded=6; strIndex++; } out[strIndex]=0; } // // stream-based FT hash calculation // /* FTUUHash initialization. */ void FTUUInit(FTUU_CTX *context) /* context */ { context->nextPos = 0; context->smallHash = 0xffffffff; context->backupSmallHash = 0xffffffff; MD5Init(&(context->md5context)); context->nextSampleStart = 0x100000; } /* FTUUHash block update operation. */ void FTUUUpdate(FTUU_CTX *context, /* context */ const unsigned char *input, /* input block */ unsigned int inputLen) /* length of input block */ { unsigned int firstPart = inputLen; // first, handle the MD5'd portion of the file if(context->nextPos < FTSEG_SIZE) { if((context->nextPos+inputLen)>FTSEG_SIZE) { // don't overshoot the segsize firstPart = FTSEG_SIZE - context->nextPos; } MD5Update(&(context->md5context),input,firstPart); context->nextPos += firstPart; if(firstPart<inputLen) { // continue with the rest of the input FTUUUpdate(context,input+firstPart,inputLen-firstPart); } return; } // OK, we're past the MD5 portion of the file // check for at sampling-range end if(context->nextPos == (context->nextSampleStart+FTSEG_SIZE) ) { // the rollingBuffer is loaded with exactly enough data // to add a sample to the smallHash context->backupSmallHash = context->smallHash; // save current smallhash state // through to end... context->smallHash = hashSmallHash(context->rollingBuffer + (context->nextPos % FTSEG_SIZE), FTSEG_SIZE - (context->nextPos % FTSEG_SIZE), // 0, context->smallHash); // ... and wraparound context->smallHash = hashSmallHash(context->rollingBuffer, context->nextPos % FTSEG_SIZE, // FTSEG_SIZE - (context->nextPos % FTSEG_SIZE), context->smallHash); // set new sampling startpoint context->nextSampleStart = context->nextSampleStart << 1; } // OK, just move bytes of data from input to the rollingBuffer // (use smallest of: inputLen, bytes-to-wraparound, bytes-to-sample-end if((context->nextPos + inputLen) > (context->nextSampleStart + FTSEG_SIZE)) firstPart = (context->nextSampleStart + FTSEG_SIZE) - context->nextPos; if(((context->nextPos % FTSEG_SIZE) + firstPart) > FTSEG_SIZE) { firstPart = FTSEG_SIZE - (context->nextPos % FTSEG_SIZE); } memcpy(context->rollingBuffer + (context->nextPos % FTSEG_SIZE), input, firstPart); context->nextPos += firstPart; if (firstPart<inputLen) { // continue with the rest of the input FTUUUpdate(context,input+firstPart,inputLen-firstPart); } } /* FTUUHash finalization. *//* message digest *//* context */ void FTUUFinal(unsigned char digest[20],FTUU_CTX *context) { int continueIndex = 0; // finalize MD5 MD5Final(digest,&(context->md5context)); // decide whether or not to rollback smallhash if(context->nextPos < ((context->nextSampleStart >> 1) + 2*FTSEG_SIZE)) { // the last FTSEG_SIZE bytes overlap the last internal sample // pretend like the last smallHash processing never happened context->smallHash = context->backupSmallHash; } // do the smallHash of the end segment if(context->nextPos >= 2*FTSEG_SIZE) { // end segment is a full FTSEG_SIZE context->smallHash = hashSmallHash(context->rollingBuffer + (context->nextPos % FTSEG_SIZE), FTSEG_SIZE - (context->nextPos % FTSEG_SIZE), // 0, context->smallHash); continueIndex = FTSEG_SIZE - (context->nextPos % FTSEG_SIZE); } if(context->nextPos > FTSEG_SIZE) { // wraparound or do an endseg < FTSEG_SIZE context->smallHash = hashSmallHash(context->rollingBuffer, context->nextPos % FTSEG_SIZE, // continueIndex, context->smallHash); } // else filesize was <= FTSEG_SIZE, no smallHashing of endseg necessary context->smallHash ^= context->nextPos; digest[16] = context->smallHash & 0xff; digest[17] = (context->smallHash >> 8) & 0xff; digest[18] = (context->smallHash >> 16) & 0xff; digest[19] = (context->smallHash >> 24) & 0xff; } Index: Makefile.am =================================================================== RCS file: /cvsroot/bitcollider/bitcollider/lib/Makefile.am,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -r1.13 -r1.14 *** Makefile.am 10 Oct 2001 23:25:48 -0000 1.13 --- Makefile.am 6 Jul 2002 09:30:15 -0000 1.14 *************** *** 1,15 **** ! # (PD) 2001 The Bitzi Corporation ! # Please see file COPYING or http://bitzi.com/publicdomain ! # for more info. ! # ! # $Id$ ! # ! AUTOMAKE_OPTIONS = foreign ! ! INCLUDES = $(INCLTDL) -I$(top_srcdir)/.. -I$(top_srcdir)/ver -I$(top_srcdir)/include ! lib_LTLIBRARIES = libbitcollider.la ! libbitcollider_la_SOURCES = main.c sha1.c tiger.c tigertree.c sboxes.c browser.c mp3.c id3.c plugin_man.c plugin_man.h dirsearch.c dir.h bitprint.c bitprint.h md5.c md5.h cache.c ! libbitcollider_la_LDFLAGS = -version-info 1:0:0 ! libbitcollider_la_LIBADD = $(LIBLTDL) $(BDB_LIBS) ! ! noinst_HEADERS = browser.h mp3.h id3.h --- 1,15 ---- ! # (PD) 2001 The Bitzi Corporation ! # Please see file COPYING or http://bitzi.com/publicdomain ! # for more info. ! # ! # $Id$ ! # ! AUTOMAKE_OPTIONS = foreign ! ! INCLUDES = $(INCLTDL) -I$(top_srcdir)/.. -I$(top_srcdir)/ver -I$(top_srcdir)/include ! lib_LTLIBRARIES = libbitcollider.la ! libbitcollider_la_SOURCES = main.c sha1.c tiger.c tigertree.c sboxes.c browser.c mp3.c id3.c plugin_man.c plugin_man.h dirsearch.c dir.h bitprint.c bitprint.h md5.c md5.h cache.c ed2k_md4.h ed2k_md4.c ftuuhash.h ftuuhash.c ! libbitcollider_la_LDFLAGS = -version-info 1:0:0 ! libbitcollider_la_LIBADD = $(LIBLTDL) $(BDB_LIBS) ! ! noinst_HEADERS = browser.h mp3.h id3.h Index: main.c =================================================================== RCS file: /cvsroot/bitcollider/bitcollider/lib/main.c,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -r1.40 -r1.41 *** main.c 5 Dec 2001 23:42:49 -0000 1.40 --- main.c 6 Jul 2002 09:30:15 -0000 1.41 *************** *** 1,1174 **** ! /* (PD) 2001 The Bitzi Corporation ! * Please see file COPYING or http://bitzi.com/publicdomain ! * for more info. ! * ! * $Id$ ! */ ! /*------------------------------------------------------------------------- */ ! #include <stdio.h> ! #include <stdlib.h> ! #include <string.h> [...2356 lines suppressed...] ! char md5Hash[33]; ! ! MD5Init(&md5context); ! MD5Final(md5Digest, &md5context); ! bitziEncodeBase32(md5Digest, 16, md5Hash); ! ! if (strcmp(MD5_SANITY_CHECK_EMPTY, md5Hash)) ! return false; ! ! MD5Init(&md5context); ! MD5Update(&md5context, "01234", 5); ! MD5Final(md5Digest, &md5context); ! bitziEncodeBase32(md5Digest, 16, md5Hash); ! ! if (strcmp(MD5_SANITY_CHECK_01234, md5Hash)) ! return false; ! ! return true; ! } ! |
From: Gordon M. <go...@us...> - 2002-07-06 09:00:14
|
Update of /cvsroot/bitcollider/bitcollider/include In directory usw-pr-cvs1:/tmp/cvs-serv26044 Modified Files: tiger.h Added Files: ed2k_md4.h ftuuhash.h Log Message: --- NEW FILE: ed2k_md4.h --- /* Support for calculating EDonkey2000 hashes. * * $Id: ed2k_md4.h,v 1.1 2002/07/06 09:00:11 gojomo Exp $ */ #ifndef ED2KMD4_H #define ED2KMD4_H /* FOR THE MD4 FUNCTIONS AND STRUCTURES: Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All rights reserved. License to copy and use this software is granted provided that it is identified as the "RSA Data Security, Inc. MD4 Message-Digest Algorithm" in all material mentioning or referencing this software or this function. License is also granted to make and use derivative works provided that such works are identified as "derived from the RSA Data Security, Inc. MD4 Message-Digest Algorithm" in all material mentioning or referencing the derived work. RSA Data Security, Inc. makes no representations concerning either the merchantability of this software or the suitability of this software for any particular purpose. It is provided "as is" without express or implied warranty of any kind. These notices must be retained in any copies of any part of this documentation and/or software. */ typedef unsigned int w32; /* MD4 context. */ typedef struct { w32 state[4]; /* state (ABCD) */ w32 count[2]; /* number of bits, modulo 2^64 (lsb first) */ unsigned char buffer[64]; /* input buffer */ } MD4_CTX; void MD4Init(MD4_CTX * ); void MD4Update(MD4_CTX *, const unsigned char *, unsigned int); void MD4Final(unsigned char [16], MD4_CTX *); /* FROM THIS POINT ON: * * (PD) 2001 The Bitzi Corporation * Please see file COPYING or http://bitzi.com/publicdomain * for more info. * */ /* ED2K context. */ typedef struct { MD4_CTX seg_ctx; // the current 9,216,000 byte block MD4_CTX top_ctx; // the total file value unsigned long nextPos; } ED2K_CTX; void ED2KInit(ED2K_CTX * ); void ED2KUpdate(ED2K_CTX *, const unsigned char *, unsigned int); void ED2KFinal(unsigned char [16], ED2K_CTX *); #endif /* !ED2KMD4_H */ --- NEW FILE: ftuuhash.h --- /* * $Id: ftuuhash.h,v 1.1 2002/07/06 09:00:11 gojomo Exp $ */ #ifndef __FTUUHASH_H__ #define __FTUUHASH_H__ #include "md5.h" #ifndef __BYTE__ #define __BYTE__ typedef unsigned char byte; #endif /* ftuu context. */ typedef struct { struct MD5Context md5context; // for md5'ing the first 307,200 bytes unsigned long nextPos; // next byte location of the file to be processed unsigned int smallHash; // running weak hash of later file ranges unsigned int backupSmallHash; // in case the endrange overlaps the last internal range byte rollingBuffer[307200]; // the last 307,200 bytes read unsigned long nextSampleStart; // position where the next 307,200 range to be smallHashed ends } FTUU_CTX; void FTUUInit(FTUU_CTX * ); void FTUUUpdate(FTUU_CTX *, const unsigned char *, unsigned int); void FTUUFinal(unsigned char [20], FTUU_CTX *); void bitziEncodeBase64(byte *, int , char *); #endif Index: tiger.h =================================================================== RCS file: /cvsroot/bitcollider/bitcollider/include/tiger.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** tiger.h 21 Aug 2001 17:55:33 -0000 1.3 --- tiger.h 6 Jul 2002 09:00:11 -0000 1.4 *************** *** 1,29 **** ! /* (PD) 2001 The Bitzi Corporation ! * Please see file COPYING or http://bitzi.com/publicdomain ! * for more info. ! * ! * $Id$ ! */ ! #ifndef TIGER_H ! #define TIGER_H ! ! #ifdef _WIN32 ! ! #if defined (_INTEGRAL_MAX_BITS) && (_INTEGRAL_MAX_BITS >= 64) ! typedef unsigned __int64 word64; ! #else ! #error __int64 type not supported ! #endif ! typedef unsigned long int tword; ! ! #else ! typedef unsigned long long int word64; ! #endif ! ! typedef unsigned long word32; ! typedef unsigned short word16; ! typedef unsigned char byte; ! ! void tiger(word64 *str, word64 length, word64 *res); ! ! #endif --- 1,33 ---- ! /* (PD) 2001 The Bitzi Corporation ! * Please see file COPYING or http://bitzi.com/publicdomain ! * for more info. ! * ! * $Id$ ! */ ! #ifndef TIGER_H ! #define TIGER_H ! ! #ifdef _WIN32 ! ! #if defined (_INTEGRAL_MAX_BITS) && (_INTEGRAL_MAX_BITS >= 64) ! typedef unsigned __int64 word64; ! #else ! #error __int64 type not supported ! #endif ! typedef unsigned long int tword; ! ! #else ! typedef unsigned long long int word64; ! #endif ! ! typedef unsigned long word32; ! typedef unsigned short word16; ! ! #ifndef __BYTE__ ! #define __BYTE__ ! typedef unsigned char byte; ! #endif ! ! void tiger(word64 *str, word64 length, word64 *res); ! ! #endif |
From: Robert K. <may...@us...> - 2002-01-14 20:33:04
|
Update of /cvsroot/bitcollider/bitcollider/misc In directory usw-pr-cvs1:/tmp/cvs-serv8615/misc Modified Files: bitcollider.spec Log Message: Checking in an updated version of the image plugin Index: bitcollider.spec =================================================================== RCS file: /cvsroot/bitcollider/bitcollider/misc/bitcollider.spec,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** bitcollider.spec 2001/08/02 17:40:02 1.6 --- bitcollider.spec 2002/01/14 20:32:59 1.7 *************** *** 6,10 **** # %define name bitcollider ! %define version 0.3.2 %define release 1 %define prefix /usr --- 6,10 ---- # %define name bitcollider ! %define version 0.3.4 %define release 1 %define prefix /usr |
From: Robert K. <may...@us...> - 2002-01-14 20:33:04
|
Update of /cvsroot/bitcollider/bitcollider In directory usw-pr-cvs1:/tmp/cvs-serv8615 Modified Files: AUTHORS Log Message: Checking in an updated version of the image plugin Index: AUTHORS =================================================================== RCS file: /cvsroot/bitcollider/bitcollider/AUTHORS,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** AUTHORS 2001/07/23 21:22:34 1.3 --- AUTHORS 2002/01/14 20:32:59 1.4 *************** *** 7,11 **** - original code ! Image plugin - Mark Nelson [delirium] <del...@th...> --- 7,11 ---- - original code ! Image plugin (BMP, GIF, JPG, PNG) - Mark Nelson [delirium] <del...@th...> |
From: Robert K. <may...@us...> - 2002-01-14 20:33:04
|
Update of /cvsroot/bitcollider/bitcollider/image In directory usw-pr-cvs1:/tmp/cvs-serv8615/image Modified Files: image.c Log Message: Checking in an updated version of the image plugin Index: image.c =================================================================== RCS file: /cvsroot/bitcollider/bitcollider/image/image.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** image.c 2001/06/14 23:05:49 1.4 --- image.c 2002/01/14 20:32:59 1.5 *************** *** 6,11 **** * v0.1.0 - 30 May 2001 - Initial version, supports BMP (Bitmaps) * v0.1.1 - 01 Jun 2001 - Added endian-safe portable input functions ! * v0.2.0 - 04 Jun 2001 - Added support for GIF (CompuServe Graphics Interchange Format) * v0.3.0 - 13 Jun 2001 - Added support for JPEG/JFIF */ --- 6,14 ---- * v0.1.0 - 30 May 2001 - Initial version, supports BMP (Bitmaps) * v0.1.1 - 01 Jun 2001 - Added endian-safe portable input functions ! * v0.2.0 - 04 Jun 2001 - Added support for GIF (CompuServe Graphics ! * Interchange Format) * v0.3.0 - 13 Jun 2001 - Added support for JPEG/JFIF + * v0.4.0 - 12 Jan 2002 - Added support for PNG (Portable Network Graphics) + * v0.4.1 - 14 Jan 2002 - Now returns a tag.image.format tag. */ *************** *** 41,48 **** int parse_gif(FILE *file, uint32 *width, uint32 *height, uint16 *bpp); int parse_jpg(FILE *file, uint32 *width, uint32 *height, uint16 *bpp); /* endian-safe input functions */ ! uint8 read_8(FILE *file); ! uint16 read_16_big_endian(FILE *file); uint16 read_16_little_endian(FILE *file); uint32 read_32_big_endian(FILE *file); --- 44,52 ---- int parse_gif(FILE *file, uint32 *width, uint32 *height, uint16 *bpp); int parse_jpg(FILE *file, uint32 *width, uint32 *height, uint16 *bpp); + int parse_png(FILE *file, uint32 *width, uint32 *height, uint16 *bpp); /* endian-safe input functions */ ! uint8 read_8(FILE *file); ! uint16 read_16_big_endian(FILE *file); uint16 read_16_little_endian(FILE *file); uint32 read_32_big_endian(FILE *file); *************** *** 51,58 **** /*--Plugin Parameters------------------------------------------------------*/ ! #define PLUGIN_VERSION "0.3.0" ! #define PLUGIN_NAME "Image metadata (BMP, GIF, JPEG)" ! #define NUM_ATTRS 4 /*--Cross Platform Foo-----------------------------------------------------*/ --- 55,66 ---- /*--Plugin Parameters------------------------------------------------------*/ ! #define PLUGIN_VERSION "0.4.1" ! #define PLUGIN_NAME "Image metadata (BMP, GIF, JPEG, PNG)" + /* NUM_ATTRS must be _one_more_ than the number of attribute we're + * returning, to allow for a sentinel NULL/NULL pair. + */ + #define NUM_ATTRS 5 + /*--Cross Platform Foo-----------------------------------------------------*/ *************** *** 67,75 **** static SupportedFormat formats[] = { ! { ".bmp" , "Windows Bitmap image" }, ! { ".gif" , "CompuServe Graphics Interchange Format (GIF) image" }, ! { ".jpg" , "JPEG/JFIF compressed image" }, ! { ".jpeg", "JPEG/JFIF compressed image" }, ! { NULL , NULL } }; --- 75,84 ---- static SupportedFormat formats[] = { ! { ".bmp" , "Windows Bitmap image" }, ! { ".gif" , "CompuServe Graphics Interchange Format (GIF) image" }, ! { ".jpg" , "JPEG/JFIF compressed image" }, ! { ".jpeg", "JPEG/JFIF compressed image" }, ! { ".png" , "Portable Network Graphics (PNG) image" }, ! { NULL , NULL } }; *************** *** 78,91 **** static PluginMethods methods = { ! image_shutdown_plugin, ! image_get_version, ! image_get_name, ! image_get_supported_formats, ! image_file_analyze, ! NULL, /* no init/update/final */ ! NULL, ! NULL, ! image_free_attributes, ! image_get_error }; --- 87,100 ---- static PluginMethods methods = { ! image_shutdown_plugin, ! image_get_version, ! image_get_name, ! image_get_supported_formats, ! image_file_analyze, ! NULL, /* no init/update/final */ ! NULL, ! NULL, ! image_free_attributes, ! image_get_error }; *************** *** 94,190 **** PluginMethods *init_plugin(void) { ! return &methods; } static void image_shutdown_plugin(void) { ! if (errorString) ! free(errorString); } static const char *image_get_version(void) { ! return PLUGIN_VERSION; } static const char *image_get_name(void) { ! return PLUGIN_NAME; } static SupportedFormat *image_get_supported_formats(void) { ! return formats; } static Attribute *image_file_analyze(const char *fileName) { ! FILE *file; ! Attribute *attrList; ! char temp[100]; ! char *ext; ! int errorcode = 1; ! ! uint32 width; ! uint32 height; ! uint16 bpp; ! ! file = fopen(fileName, "rb"); ! if(file == NULL) ! return NULL; ! ! ext = strrchr(fileName, '.'); ! ! if(strcasecmp(ext,".bmp") == 0) ! errorcode = parse_bmp(file, &width, &height, &bpp); ! else if(strcasecmp(ext, ".gif") == 0) ! errorcode = parse_gif(file, &width, &height, &bpp); ! else if(strcasecmp(ext, ".jpg") == 0) ! errorcode = parse_jpg(file, &width, &height, &bpp); ! else if(strcasecmp(ext, ".jpeg") == 0) ! errorcode = parse_jpg(file, &width, &height, &bpp); ! ! fclose(file); ! ! if(errorcode || width==0 || height==0 || bpp==0) ! return NULL; ! ! /* by this point we should have valid info, so return it */ ! attrList = malloc(sizeof(Attribute) * NUM_ATTRS); ! memset(attrList, 0, sizeof(Attribute) * NUM_ATTRS); ! ! sprintf(temp, "%d", width); ! attrList[0].key = strdup("tag.image.width"); ! attrList[0].value = strdup(temp); ! ! sprintf(temp, "%d", height); ! attrList[1].key = strdup("tag.image.height"); ! attrList[1].value = strdup(temp); ! ! sprintf(temp, "%d", bpp); ! attrList[2].key = strdup("tag.image.bpp"); ! attrList[2].value = strdup(temp); ! ! return attrList; } static void image_free_attributes(Attribute *attrList) { ! int i; ! ! for(i = 0; i < NUM_ATTRS; i++) ! { ! if (attrList[i].key) ! free(attrList[i].key); ! if (attrList[i].value) ! free(attrList[i].value); ! } ! ! free(attrList); } static char *image_get_error(void) { ! return errorString; } --- 103,223 ---- PluginMethods *init_plugin(void) { ! return &methods; } static void image_shutdown_plugin(void) { ! if (errorString) ! free(errorString); } static const char *image_get_version(void) { ! return PLUGIN_VERSION; } static const char *image_get_name(void) { ! return PLUGIN_NAME; } static SupportedFormat *image_get_supported_formats(void) { ! return formats; } static Attribute *image_file_analyze(const char *fileName) { ! FILE *file; ! Attribute *attrList; ! char temp[100]; /* Used for sprintf()'ing values to */ ! char format[5]; /* "BMP", "GIF", "JPEG", or "PNG" */ ! char *ext; ! int errorcode = 1; ! ! uint32 width; ! uint32 height; ! uint16 bpp; ! ! file = fopen(fileName, "rb"); ! if(file == NULL) ! return NULL; ! ! /* Find the filename extension (return if there is none) */ ! ext = strrchr(fileName, '.'); ! if(ext == NULL) ! return NULL; ! ! /* Call the appropriate parsing routine based on the extension */ ! if(strcasecmp(ext, ".bmp") == 0) ! { ! strcpy(format, "BMP"); ! errorcode = parse_bmp(file, &width, &height, &bpp); ! } ! else if(strcasecmp(ext, ".gif") == 0) ! { ! strcpy(format, "GIF"); ! errorcode = parse_gif(file, &width, &height, &bpp); ! } ! else if(strcasecmp(ext, ".jpg") == 0 || strcasecmp(ext, ".jpeg") == 0) ! { ! strcpy(format, "JPEG"); ! errorcode = parse_jpg(file, &width, &height, &bpp); ! } ! else if(strcasecmp(ext, ".png") == 0) ! { ! strcpy(format, "PNG"); ! errorcode = parse_png(file, &width, &height, &bpp); ! } ! ! fclose(file); ! ! /* Check for errors and do a sanity check on values. */ ! if(errorcode || width==0 || height==0 || bpp==0) ! return NULL; ! ! /* by this point we should have valid info, so return it */ ! attrList = malloc(sizeof(Attribute) * NUM_ATTRS); ! ! sprintf(temp, "%d", width); ! attrList[0].key = strdup("tag.image.width"); ! attrList[0].value = strdup(temp); ! ! sprintf(temp, "%d", height); ! attrList[1].key = strdup("tag.image.height"); ! attrList[1].value = strdup(temp); ! ! sprintf(temp, "%d", bpp); ! attrList[2].key = strdup("tag.image.bpp"); ! attrList[2].value = strdup(temp); ! ! attrList[3].key = strdup("tag.image.format"); ! attrList[3].value = strdup(format); ! ! /* Set a sentinel value so the bitcollider knows it's done */ ! attrList[4].key = NULL; ! attrList[4].value = NULL; ! ! return attrList; } static void image_free_attributes(Attribute *attrList) { ! int i; ! ! for(i = 0; i < NUM_ATTRS; i++) ! { ! if (attrList[i].key) ! free(attrList[i].key); ! if (attrList[i].value) ! free(attrList[i].value); ! } ! ! free(attrList); } static char *image_get_error(void) { ! return errorString; } *************** *** 195,323 **** int parse_bmp(FILE *file, uint32 *width, uint32 *height, uint16 *bpp) { ! /* File must start with "BM" */ ! if(read_8(file) != 'B' || read_8(file) != 'M') ! return 1; ! ! fseek(file, 16L, SEEK_CUR); ! ! *width = read_32_little_endian(file); ! *height = read_32_little_endian(file); ! fseek(file, 2L, SEEK_CUR); ! *bpp = read_16_little_endian(file); ! ! return 0; } int parse_gif(FILE *file, uint32 *width, uint32 *height, uint16 *bpp) { ! unsigned char packed; ! uint16 bpp1, bpp2; ! ! /* File must start with "GIF" */ ! if(read_8(file) != 'G' || read_8(file) != 'I' || read_8(file) != 'F') ! return 1; ! ! fseek(file, 3L, SEEK_CUR); ! *width = (uint32) read_16_little_endian(file); ! *height = (uint32) read_16_little_endian(file); ! ! /* packed byte: ! Bits 8 and 5 are flags we don't need to worry about; ! bits 6-8 and 1-3 are 3-bit descriptions of the number of bits, ! minus 1, of "color resolution" and "bits per pixel" respectively. ! Usually these values are the same, but if they're not, take the ! larger of the two to be "bpp," since this is what standard ! image editing programs seem to do. I don't know why. */ ! packed = read_8(file); ! bpp1 = ((packed & 0x70) >> 4) + 1; ! bpp2 = (packed & 0x07) + 1; ! ! if(bpp1 > bpp2) ! *bpp = bpp1; ! else ! *bpp = bpp2; ! ! return 0; } int parse_jpg(FILE *file, uint32 *width, uint32 *height, uint16 *bpp) { ! uint16 bytes_left=0; ! /* File must start with 0xFFD8FFE0, <2 byte field length>, "JFIF", 0x00 */ ! if(read_8(file) != 0xFF || read_8(file) != 0xD8 || ! read_8(file) != 0xFF || read_8(file) != 0xE0) ! return 1; ! ! bytes_left = read_16_big_endian(file); ! bytes_left -= 2; /* the 2 bytes of the field length indicator itself count */ ! ! if(read_8(file) != 'J' || read_8(file) != 'F' || read_8(file) != 'I' || ! read_8(file) != 'F' || read_8(file) != 0x00) ! return 1; ! ! bytes_left -= 5; ! ! /* skip past the rest of the JFIF indicator field */ ! fseek(file, bytes_left, SEEK_CUR); ! ! /* now we parse the file for the image information field. JPEG fields ! have the general structure of: 0xFF, <1 byte field type>, <2 byte field ! length>, <x byte field data> */ ! while(!feof(file)) ! { ! uint8 type, samples, bits_per_sample; ! ! /* if there's no 0xFF marker, JPEG file is malformed */ ! if(read_8(file) != 0xFF) ! return 1; ! /* JPEG files are sometimes padded with sequential 0xFF bytes */ ! do ! { ! type = read_8(file); ! } while (type == 0xFF); ! ! switch (type) { ! /* image information fields (for various types of compression) */ ! case 0xC0: ! case 0xC1: ! case 0xC2: ! case 0xC3: ! case 0xC5: ! case 0xC6: ! case 0xC7: ! case 0xC9: ! case 0xCA: ! case 0xCB: ! case 0xCD: ! case 0xCE: ! case 0xCF: ! fseek(file, 2L, SEEK_CUR); /* skip the field length */ ! bits_per_sample = read_8(file); ! *height = (uint32) read_16_big_endian(file); ! *width = (uint32) read_16_big_endian(file); ! samples = read_8(file); ! *bpp = (uint16) samples * bits_per_sample; ! return 0; ! ! case 0xD9: /* if end of image, */ ! case 0xDA: /* or beginning of compressed data, */ ! return 1; /* there was no image info (or we missed it) */ ! ! /* if any other field, we don't care, so skip past it */ ! default: ! bytes_left = read_16_big_endian(file); ! /* since the length takes 2 bytes, length must be >= 2 */ ! if (bytes_left < 2) ! return 1; ! bytes_left -= 2; ! ! /* skip the rest of the field and go on the next one */ ! fseek(file, bytes_left, SEEK_CUR); ! break; ! } ! } ! return 1; } --- 228,406 ---- int parse_bmp(FILE *file, uint32 *width, uint32 *height, uint16 *bpp) { ! /* File must start with "BM" */ ! if(read_8(file) != 'B' || read_8(file) != 'M') ! return 1; ! ! fseek(file, 16L, SEEK_CUR); ! ! *width = read_32_little_endian(file); ! *height = read_32_little_endian(file); ! fseek(file, 2L, SEEK_CUR); ! *bpp = read_16_little_endian(file); ! ! return 0; } int parse_gif(FILE *file, uint32 *width, uint32 *height, uint16 *bpp) { ! unsigned char packed; ! uint16 bpp1, bpp2; ! ! /* File must start with "GIF" */ ! if(read_8(file) != 'G' || read_8(file) != 'I' || read_8(file) != 'F') ! return 1; ! ! fseek(file, 3L, SEEK_CUR); ! *width = (uint32) read_16_little_endian(file); ! *height = (uint32) read_16_little_endian(file); ! ! /* packed byte: ! * Bits 8 and 5 are flags we don't need to worry about; ! * bits 6-8 and 1-3 are 3-bit descriptions of the number of bits, ! * minus 1, of "color resolution" and "bits per pixel" respectively. ! * Usually these values are the same, but if they're not, take the ! * larger of the two to be "bpp," since this is what standard ! * image editing programs seem to do. I don't know why. */ ! packed = read_8(file); ! bpp1 = ((packed & 0x70) >> 4) + 1; ! bpp2 = (packed & 0x07) + 1; ! ! if(bpp1 > bpp2) ! *bpp = bpp1; ! else ! *bpp = bpp2; ! ! return 0; } int parse_jpg(FILE *file, uint32 *width, uint32 *height, uint16 *bpp) { ! uint16 bytes_left=0; ! ! /* File must start with 0xFFD8FFE0, <2 byte field length>, "JFIF", 0x00 */ ! if(read_8(file) != 0xFF || read_8(file) != 0xD8 || ! read_8(file) != 0xFF || read_8(file) != 0xE0) ! return 1; ! ! bytes_left = read_16_big_endian(file); ! bytes_left -= 2; /* 2 bytes of the field length indicator itself count */ ! ! if(read_8(file) != 'J' || read_8(file) != 'F' || read_8(file) != 'I' || ! read_8(file) != 'F' || read_8(file) != 0x00) ! return 1; ! ! bytes_left -= 5; ! ! /* skip past the rest of the JFIF indicator field */ ! fseek(file, bytes_left, SEEK_CUR); ! ! /* now we parse the file for the image information field. JPEG fields ! * have the general structure of: 0xFF, <1 byte field type>, <2 byte field ! * length>, <x byte field data> ! */ ! while(!feof(file)) ! { ! uint8 type, samples, bits_per_sample; ! ! /* if there's no 0xFF marker, JPEG file is malformed */ ! if(read_8(file) != 0xFF) ! return 1; ! /* JPEG files are sometimes padded with sequential 0xFF bytes */ ! do ! { ! type = read_8(file); ! } while (type == 0xFF); ! ! switch (type) { ! /* image information fields (for various types of compression) */ ! case 0xC0: ! case 0xC1: ! case 0xC2: ! case 0xC3: ! case 0xC5: ! case 0xC6: ! case 0xC7: ! case 0xC9: ! case 0xCA: ! case 0xCB: ! case 0xCD: ! case 0xCE: ! case 0xCF: ! fseek(file, 2L, SEEK_CUR); /* skip the field length */ ! bits_per_sample = read_8(file); ! *height = (uint32) read_16_big_endian(file); ! *width = (uint32) read_16_big_endian(file); ! samples = read_8(file); ! *bpp = (uint16) samples * bits_per_sample; ! return 0; ! ! case 0xD9: /* if end of image, */ ! case 0xDA: /* or beginning of compressed data, */ ! return 1; /* there was no image info (or we missed it) */ ! ! /* if any other field, we don't care, so skip past it */ ! default: ! bytes_left = read_16_big_endian(file); ! /* since the length takes 2 bytes, length must be >= 2 */ ! if (bytes_left < 2) ! return 1; ! bytes_left -= 2; ! ! /* skip the rest of the field and go on the next one */ ! fseek(file, bytes_left, SEEK_CUR); ! break; ! } ! } ! return 1; ! } ! ! int parse_png(FILE *file, uint32 *width, uint32 *height, uint16 *bpp) ! { ! uint8 bit_depth = 0, color_type = 0; ! ! /* File must start with 0x89, "PNG", 0x0D0A1A0A */ ! if(read_8(file) != 0x89 || read_8(file) != 'P' || read_8(file) != 'N' || ! read_8(file) != 'G' || read_8(file) != 0x0D || read_8(file) != 0x0A || ! read_8(file) != 0x1A || read_8(file) != 0x0A) ! return 1; ! ! /* Skip IHDR chunk length (since we know its structure already) */ ! fseek(file, 4L, SEEK_CUR); ! ! /* Make sure this really is an IHDR chunk (the first chunk must be an ! * IHDR chunk in a valid PNG file) */ ! if(read_8(file) != 'I' || read_8(file) != 'H' || read_8(file) != 'D' || ! read_8(file) != 'R') ! return 1; ! ! /* Read in our data */ ! *width = read_32_big_endian(file); ! *height = read_32_big_endian(file); ! ! /* bpp depends on bit_depth and color_type. */ ! bit_depth = read_8(file); ! color_type = read_8(file); ! ! switch(color_type) ! { ! case 0: /* grayscale */ ! case 3: /* pixels are palette indices */ ! *bpp = bit_depth; ! break; ! case 2: /* pixels are RGB triples */ ! *bpp = bit_depth * 3; ! break; ! case 4: ! *bpp = bit_depth * 2; /* pixels are grayscale + alpha */ ! break; ! case 6: ! *bpp = bit_depth * 4; /* pixels are RGB triples + alpha */ ! break; ! default: ! return 1; /* invalid color_type */ ! } ! return 0; } *************** *** 338,342 **** a=getc(file); ! b=getc(file); return ((a<<8) + b); --- 421,425 ---- a=getc(file); ! b=getc(file); return ((a<<8) + b); *************** *** 348,352 **** a=getc(file); ! b=getc(file); return ((b<<8) + a); --- 431,435 ---- a=getc(file); ! b=getc(file); return ((b<<8) + a); *************** *** 358,364 **** a=getc(file); ! b=getc(file); ! c=getc(file); ! d=getc(file); return ((a<<24) + (b<<16) + (c<<8) + d); --- 441,447 ---- a=getc(file); ! b=getc(file); ! c=getc(file); ! d=getc(file); return ((a<<24) + (b<<16) + (c<<8) + d); *************** *** 370,376 **** a=getc(file); ! b=getc(file); ! c=getc(file); ! d=getc(file); return ((d<<24) + (c<<16) + (b<<8) + a); --- 453,459 ---- a=getc(file); ! b=getc(file); ! c=getc(file); ! d=getc(file); return ((d<<24) + (c<<16) + (b<<8) + a); |
From: Mike L. <mli...@us...> - 2002-01-13 02:53:46
|
Update of /cvsroot/bitcollider/bitcollider/skel In directory usw-pr-cvs1:/tmp/cvs-serv28513 Modified Files: skel.c Log Message: context* was incorrectly context in a few places Index: skel.c =================================================================== RCS file: /cvsroot/bitcollider/bitcollider/skel/skel.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** skel.c 2001/05/30 17:39:12 1.2 --- skel.c 2002/01/13 02:53:44 1.3 *************** *** 32,40 **** /* OR */ ! static Context skel_analyze_init(void); ! static void skel_analyze_update(Context context, const unsigned char *buf, unsigned bufLen); ! static Attribute *skel_analyze_final(Context context); --- 32,40 ---- /* OR */ ! static Context *skel_analyze_init(void); ! static void skel_analyze_update(Context *context, const unsigned char *buf, unsigned bufLen); ! static Attribute *skel_analyze_final(Context *context); *************** *** 117,121 **** } ! static Context skel_analyze_init(void) { SkelContext *context; --- 117,121 ---- } ! static Context *skel_analyze_init(void) { SkelContext *context; *************** *** 124,131 **** memset(context, 0, sizeof(SkelContext)); ! return (Context)context; } ! static void skel_analyze_update(Context contextArg, const unsigned char *buf, unsigned bufLen) --- 124,131 ---- memset(context, 0, sizeof(SkelContext)); ! return (Context *)context; } ! static void skel_analyze_update(Context *contextArg, const unsigned char *buf, unsigned bufLen) *************** *** 135,139 **** } ! static Attribute *skel_analyze_final(Context contextArg) { SkelContext *context = (SkelContext *)contextArg; --- 135,139 ---- } ! static Attribute *skel_analyze_final(Context *contextArg) { SkelContext *context = (SkelContext *)contextArg; |
From: Robert K. <may...@us...> - 2001-12-17 22:32:56
|
Update of /cvsroot/bitcollider/jbitprint/src/com/bitzi/bitprint In directory usw-pr-cvs1:/tmp/cvs-serv31319/src/com/bitzi/bitprint Modified Files: Base32.java BitprintTest.java Log Message: Updated for the new character set and the dot. Index: Base32.java =================================================================== RCS file: /cvsroot/bitcollider/jbitprint/src/com/bitzi/bitprint/Base32.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** Base32.java 2001/09/24 23:07:52 1.1 --- Base32.java 2001/12/17 22:32:52 1.2 *************** *** 13,18 **** public class Base32 { ! private static final int bitprintBase32Len = 71; private static final int bitprintRawLen = 44; private static final int bufferLen = 4096; --- 13,20 ---- public class Base32 { ! private static final int bitprintBase32Len = 72; private static final int bitprintRawLen = 44; + private static final int shaBase32Len = 32; + private static final int tigerBase32Len = 39; private static final int bufferLen = 4096; *************** *** 20,70 **** private static final int base32LookupMax = 32; private static final String base32Chars = ! "ABCDEFGHIJKMNPQRSTUVWXYZ23456789"; private static final int[][] base32Lookup = { ! { '0', 0xFF, }, ! { '1', 0xFF, }, ! { '2', 0x18, }, ! { '3', 0x19, }, ! { '4', 0x1A, }, ! { '5', 0x1B, }, ! { '6', 0x1C, }, ! { '7', 0x1D, }, ! { '8', 0x1E, }, ! { '9', 0x1F, }, ! { ':', 0xFF, }, ! { ';', 0xFF, }, ! { '<', 0xFF, }, ! { '=', 0xFF, }, ! { '>', 0xFF, }, ! { '?', 0xFF, }, ! { '@', 0xFF, }, ! { 'A', 0x00, }, ! { 'B', 0x01, }, ! { 'C', 0x02, }, ! { 'D', 0x03, }, ! { 'E', 0x04, }, ! { 'F', 0x05, }, ! { 'G', 0x06, }, ! { 'H', 0x07, }, ! { 'I', 0x08, }, ! { 'J', 0x09, }, ! { 'K', 0x0A, }, ! { 'L', 0xFF, }, ! { 'M', 0x0B, }, ! { 'N', 0x0C, }, ! { 'O', 0xFF, }, ! { 'P', 0x0D, }, ! { 'Q', 0x0E, }, ! { 'R', 0x0F, }, ! { 'S', 0x10, }, ! { 'T', 0x11, }, ! { 'U', 0x12, }, ! { 'V', 0x13, }, ! { 'W', 0x14, }, ! { 'X', 0x15, }, ! { 'Y', 0x16, }, ! { 'Z', 0x17 } }; --- 22,72 ---- private static final int base32LookupMax = 32; private static final String base32Chars = ! "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"; private static final int[][] base32Lookup = { ! { '0', 0xFF }, ! { '1', 0xFF }, ! { '2', 0x1A }, ! { '3', 0x1B }, ! { '4', 0x1C }, ! { '5', 0x1D }, ! { '6', 0x1E }, ! { '7', 0x1F }, ! { '8', 0xFF }, ! { '9', 0xFF }, ! { ':', 0xFF }, ! { ';', 0xFF }, ! { '<', 0xFF }, ! { '=', 0xFF }, ! { '>', 0xFF }, ! { '?', 0xFF }, ! { '@', 0xFF }, ! { 'A', 0x00 }, ! { 'B', 0x01 }, ! { 'C', 0x02 }, ! { 'D', 0x03 }, ! { 'E', 0x04 }, ! { 'F', 0x05 }, ! { 'G', 0x06 }, ! { 'H', 0x07 }, ! { 'I', 0x08 }, ! { 'J', 0x09 }, ! { 'K', 0x0A }, ! { 'L', 0x0B }, ! { 'M', 0x0C }, ! { 'N', 0x0D }, ! { 'O', 0x0E }, ! { 'P', 0x0F }, ! { 'Q', 0x10 }, ! { 'R', 0x11 }, ! { 'S', 0x12 }, ! { 'T', 0x13 }, ! { 'U', 0x14 }, ! { 'V', 0x15 }, ! { 'W', 0x16 }, ! { 'X', 0x17 }, ! { 'Y', 0x18 }, ! { 'Z', 0x19 } }; *************** *** 73,82 **** public String bitprintToBase32(final byte[] digest) { ! return encodeBase32(digest, bitprintRawLen); } public byte[] bitprintFromBase32(final String bitprint) { ! return decodeBase32(bitprint, bitprintBase32Len); } --- 75,92 ---- public String bitprintToBase32(final byte[] digest) { ! String bitprint; ! ! bitprint = encodeBase32(digest, bitprintRawLen); ! return bitprint.substring(0, shaBase32Len) + '.' + ! bitprint.substring(shaBase32Len, bitprintBase32Len - 1); } public byte[] bitprintFromBase32(final String bitprint) { ! String pureBase32; ! ! pureBase32 = bitprint.substring(0, shaBase32Len) + ! bitprint.substring(shaBase32Len + 1, bitprintBase32Len); ! return decodeBase32(pureBase32, bitprintBase32Len); } Index: BitprintTest.java =================================================================== RCS file: /cvsroot/bitcollider/jbitprint/src/com/bitzi/bitprint/BitprintTest.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** BitprintTest.java 2001/09/24 23:07:50 1.1 --- BitprintTest.java 2001/12/17 22:32:52 1.2 *************** *** 42,46 **** hash = convert.bitprintToBase32(digest); ! System.out.println(hash); } } --- 42,51 ---- hash = convert.bitprintToBase32(digest); ! System.out.println("Base32Bitprint:"); ! System.out.println(" " + hash); ! ! hash = convert.bitprintToBase32(convert.bitprintFromBase32(hash)); ! System.out.println("Double check:"); ! System.out.println(" " + hash); } } |
From: Robert K. <may...@us...> - 2001-12-05 23:42:52
|
Update of /cvsroot/bitcollider/bitcollider/lib In directory usw-pr-cvs1:/tmp/cvs-serv31742/lib Modified Files: main.c Log Message: Values sent to the website are now being properly escaped. Index: main.c =================================================================== RCS file: /cvsroot/bitcollider/bitcollider/lib/main.c,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -r1.39 -r1.40 *** main.c 2001/12/05 18:43:52 1.39 --- main.c 2001/12/05 23:42:49 1.40 *************** *** 85,88 **** --- 85,89 ---- void set_warning(BitcolliderSubmission *sub, const char *newError); b_bool check_md5_hash(void); + char *escape_form_value(char *form_value); /*------------------------------------------------------------------------- */ *************** *** 833,837 **** FILE *output; int i, last = -1; ! char tempFile[MAX_PATH]; b_bool ret; --- 834,838 ---- FILE *output; int i, last = -1; ! char tempFile[MAX_PATH], *escaped; b_bool ret; *************** *** 899,906 **** fprintf(output, "%s=<INPUT TYPE=\"hidden\" ", submission->attrList[i]->key); fprintf(output, "NAME=\"%s\" VALUE=\"%s\">%s\n", submission->attrList[i]->key, ! submission->attrList[i]->value, submission->attrList[i]->value); } fprintf(output, "\n<INPUT TYPE=\"submit\" NAME=\"Submit\" VALUE=\"Submit\">\n"); --- 900,909 ---- fprintf(output, "%s=<INPUT TYPE=\"hidden\" ", submission->attrList[i]->key); + escaped = escape_form_value(submission->attrList[i]->value); fprintf(output, "NAME=\"%s\" VALUE=\"%s\">%s\n", submission->attrList[i]->key, ! escaped, submission->attrList[i]->value); + free(escaped); } fprintf(output, "\n<INPUT TYPE=\"submit\" NAME=\"Submit\" VALUE=\"Submit\">\n"); *************** *** 929,932 **** --- 932,994 ---- return ret; + } + + char *escape_form_value(char *form_value) + { + int i, form_value_length, extra_length; + char *escaped_value, *ptr; + + form_value_length = strlen(form_value); + for (i = 0, extra_length = 0; i < form_value_length; ++i) + { + switch(form_value[i]) + { + case '"': + extra_length += 5; + break; + case '&': + extra_length += 4; + break; + case '<': + case '>': + extra_length += 3; + break; + } + } + + if (extra_length == 0) + { + // This is necessary since the caller must free the memory. + return strdup(form_value); + } + + escaped_value = malloc(form_value_length + extra_length + 1); + for (i = 0, ptr = escaped_value; i < form_value_length; ++i) + { + switch(form_value[i]) + { + case '"': + strcpy(ptr, """); + ptr += 6; + break; + case '&': + strcpy(ptr, "&"); + ptr += 5; + break; + case '<': + strcpy(ptr, "<"); + ptr += 4; + break; + case '>': + strcpy(ptr, ">"); + ptr += 4; + break; + default: + *(ptr++) = form_value[i]; + } + } + *ptr = 0; + + return escaped_value; } |
From: Robert K. <may...@us...> - 2001-12-05 23:42:52
|
Update of /cvsroot/bitcollider/bitcollider In directory usw-pr-cvs1:/tmp/cvs-serv31742 Modified Files: aclocal.m4 config.h.in Log Message: Values sent to the website are now being properly escaped. Index: aclocal.m4 =================================================================== RCS file: /cvsroot/bitcollider/bitcollider/aclocal.m4,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** aclocal.m4 2001/12/05 18:43:52 1.8 --- aclocal.m4 2001/12/05 23:42:49 1.9 *************** *** 103,227 **** AC_SUBST($1)]) ! # serial 40 AC_PROG_LIBTOOL ! AC_DEFUN(AC_PROG_LIBTOOL, [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl ! # Save cache, so that ltconfig can load it ! AC_CACHE_SAVE [...3515 lines suppressed...] ! dnl This is just to silence aclocal about the macro not being used ! ifelse([AC_DISABLE_FAST_INSTALL])dnl # Like AC_CONFIG_HEADER, but automatically create stamp file. --- 3415,3429 ---- ]) ! # old names ! AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL]) ! AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) ! AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) ! AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) ! AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) ! AC_DEFUN([AM_PROG_LD], [AC_PROG_LD]) ! AC_DEFUN([AM_PROG_NM], [AC_PROG_NM]) ! # This is just to silence aclocal about the macro not being used ! ifelse([AC_DISABLE_FAST_INSTALL]) # Like AC_CONFIG_HEADER, but automatically create stamp file. Index: config.h.in =================================================================== RCS file: /cvsroot/bitcollider/bitcollider/config.h.in,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** config.h.in 2001/12/05 18:43:52 1.8 --- config.h.in 2001/12/05 23:42:49 1.9 *************** *** 12,15 **** --- 12,18 ---- #undef SIZEOF_LONG + /* Define if you have the <dlfcn.h> header file. */ + #undef HAVE_DLFCN_H + /* Name of package */ #undef PACKAGE |
From: Robert K. <may...@us...> - 2001-12-05 23:02:47
|
Update of /cvsroot/bitcollider/bitprint In directory usw-pr-cvs1:/tmp/cvs-serv13553 Modified Files: bitprint.c Log Message: A couple more minor tweaks with regards to the endianess. Should work ok now. Index: bitprint.c =================================================================== RCS file: /cvsroot/bitcollider/bitprint/bitprint.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** bitprint.c 2001/12/05 22:44:07 1.6 --- bitprint.c 2001/12/05 23:02:45 1.7 *************** *** 30,34 **** #define SIZEOF_LONG 4 ! //#error Please define the endianness of the platform that will run this code. /* Notes for non-windows users: If you are using autoconf, then add the following lines to your --- 30,34 ---- #define SIZEOF_LONG 4 ! #error Please define the endianness of the platform that will run this code. /* Notes for non-windows users: If you are using autoconf, then add the following lines to your *************** *** 119,122 **** --- 119,123 ---- static void tt_digest(TT_CONTEXT *ctx, unsigned char *hash); static void tt_copy(TT_CONTEXT *dest, TT_CONTEXT *src); + static void tt_endian(byte *s); /* =================================================================== */ *************** *** 704,708 **** byte *node = ctx->top - NODESIZE; tiger((word64*)node,(word64)NODESIZE,(word64*)ctx->top); // combine two nodes ! #if USE_BIG_ENDIAN tt_endian((byte *)ctx->top); #endif --- 705,709 ---- byte *node = ctx->top - NODESIZE; tiger((word64*)node,(word64)NODESIZE,(word64*)ctx->top); // combine two nodes ! #if BIG_ENDIAN tt_endian((byte *)ctx->top); #endif *************** *** 716,720 **** tiger((word64*)block,(word64)ctx->index,(word64*)ctx->top); ! #if USE_BIG_ENDIAN tt_endian((byte *)ctx->top); #endif --- 717,721 ---- tiger((word64*)block,(word64)ctx->index,(word64*)ctx->top); ! #if BIG_ENDIAN tt_endian((byte *)ctx->top); #endif |
From: Robert K. <may...@us...> - 2001-12-05 22:44:11
|
Update of /cvsroot/bitcollider/bitprint In directory usw-pr-cvs1:/tmp/cvs-serv4628 Modified Files: bitprint.c bitprint.h Added Files: btest.c Log Message: Updated the bitprint code with the latest endian stuff and the . in the new bitprint format. --- NEW FILE: btest.c --- /* (PD) 2001 The Bitzi Corporation * Please see http://bitzi.com/publicdomain for more info. * * $Id: btest.c,v 1.1 2001/12/05 22:44:07 mayhemchaos Exp $ */ /* This file is used for testing purposes only. */ #include <stdio.h> #include "bitprint.h" void convert_to_hex(const unsigned char *buffer, int size, char *hexBuffer) { int i; for(i = 0; i < size; i++) { sprintf(hexBuffer + (i * sizeof(char) * 2), "%02X", buffer[i] & 0xFF); } } int main(int argc, char *argv[]) { unsigned char bitprint[BITPRINT_RAW_LEN + 1]; unsigned char bitprint2[BITPRINT_RAW_LEN + 1]; char base32Bitprint[BITPRINT_BASE32_LEN + 1]; char base32Bitprint2[BITPRINT_BASE32_LEN + 1]; if (argc < 1) { printf("usage: btest <file>\n"); exit(0); } if (!bitziBitprintFile(argv[1], bitprint)) { printf("Cannot bitprint file %s\n", argv[1]); exit(0); } bitziBitprintToBase32(bitprint, base32Bitprint); printf("%s\n", base32Bitprint); bitziBitprintFromBase32(base32Bitprint, bitprint2); if (memcmp(bitprint, bitprint2, BITPRINT_RAW_LEN)) { char temp[100]; printf("The base32 de/encode functions are faulty!\n"); convert_to_hex(bitprint, BITPRINT_RAW_LEN, temp); printf("bitprint1: %s\n", temp); convert_to_hex(bitprint2, BITPRINT_RAW_LEN, temp); printf("bitprint2: %s\n", temp); } return 0; } Index: bitprint.c =================================================================== RCS file: /cvsroot/bitcollider/bitprint/bitprint.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** bitprint.c 2001/07/16 20:36:59 1.5 --- bitprint.c 2001/12/05 22:44:07 1.6 *************** *** 29,33 **** #else ! #error Please define the endianness of the platform that will run this code. /* Notes for non-windows users: If you are using autoconf, then add the following lines to your --- 29,34 ---- #else ! #define SIZEOF_LONG 4 ! //#error Please define the endianness of the platform that will run this code. /* Notes for non-windows users: If you are using autoconf, then add the following lines to your *************** *** 55,58 **** --- 56,63 ---- #endif + #ifdef BIG_ENDIAN + #undef BIG_ENDIAN + #endif + #ifdef WORDS_BIGENDIAN # define BIG_ENDIAN 1 *************** *** 102,105 **** --- 107,111 ---- typedef unsigned long word32; + typedef unsigned short word16; typedef unsigned char byte; *************** *** 119,168 **** #define BASE32_LOOKUP_MAX 43 ! static unsigned char *base32Chars = "ABCDEFGHIJKMNPQRSTUVWXYZ23456789"; static unsigned char base32Lookup[BASE32_LOOKUP_MAX][2] = { ! '0', 0xFF, ! '1', 0xFF, ! '2', 0x18, ! '3', 0x19, ! '4', 0x1A, ! '5', 0x1B, ! '6', 0x1C, ! '7', 0x1D, ! '8', 0x1E, ! '9', 0x1F, ! ':', 0xFF, ! ';', 0xFF, ! '<', 0xFF, ! '=', 0xFF, ! '>', 0xFF, ! '?', 0xFF, ! '@', 0xFF, ! 'A', 0x00, ! 'B', 0x01, ! 'C', 0x02, ! 'D', 0x03, ! 'E', 0x04, ! 'F', 0x05, ! 'G', 0x06, ! 'H', 0x07, ! 'I', 0x08, ! 'J', 0x09, ! 'K', 0x0A, ! 'L', 0xFF, ! 'M', 0x0B, ! 'N', 0x0C, ! 'O', 0xFF, ! 'P', 0x0D, ! 'Q', 0x0E, ! 'R', 0x0F, ! 'S', 0x10, ! 'T', 0x11, ! 'U', 0x12, ! 'V', 0x13, ! 'W', 0x14, ! 'X', 0x15, ! 'Y', 0x16, ! 'Z', 0x17 }; --- 125,174 ---- #define BASE32_LOOKUP_MAX 43 ! static unsigned char *base32Chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"; static unsigned char base32Lookup[BASE32_LOOKUP_MAX][2] = { ! { '0', 0xFF }, ! { '1', 0xFF }, ! { '2', 0x1A }, ! { '3', 0x1B }, ! { '4', 0x1C }, ! { '5', 0x1D }, ! { '6', 0x1E }, ! { '7', 0x1F }, ! { '8', 0xFF }, ! { '9', 0xFF }, ! { ':', 0xFF }, ! { ';', 0xFF }, ! { '<', 0xFF }, ! { '=', 0xFF }, ! { '>', 0xFF }, ! { '?', 0xFF }, ! { '@', 0xFF }, ! { 'A', 0x00 }, ! { 'B', 0x01 }, ! { 'C', 0x02 }, ! { 'D', 0x03 }, ! { 'E', 0x04 }, ! { 'F', 0x05 }, ! { 'G', 0x06 }, ! { 'H', 0x07 }, ! { 'I', 0x08 }, ! { 'J', 0x09 }, ! { 'K', 0x0A }, ! { 'L', 0x0B }, ! { 'M', 0x0C }, ! { 'N', 0x0D }, ! { 'O', 0x0E }, ! { 'P', 0x0F }, ! { 'Q', 0x10 }, ! { 'R', 0x11 }, ! { 'S', 0x12 }, ! { 'T', 0x13 }, ! { 'U', 0x14 }, ! { 'V', 0x15 }, ! { 'W', 0x16 }, ! { 'X', 0x17 }, ! { 'Y', 0x18 }, ! { 'Z', 0x19 } }; *************** *** 276,284 **** { bitziEncodeBase32(bitprint, BITPRINT_RAW_LEN, base32Bitprint); } ! void bitziBitprintFromBase32(const char *base32Bitprint, unsigned char *bitprint) { bitziDecodeBase32(base32Bitprint, BITPRINT_BASE32_LEN, bitprint); } --- 282,299 ---- { bitziEncodeBase32(bitprint, BITPRINT_RAW_LEN, base32Bitprint); + memmove(base32Bitprint + SHA_BASE32SIZE + 1, + base32Bitprint + SHA_BASE32SIZE, TIGER_BASE32SIZE + 1); + base32Bitprint[SHA_BASE32SIZE] = '.'; } ! void bitziBitprintFromBase32(const char *base32BitprintWithDot, unsigned char *bitprint) { + char base32Bitprint[BITPRINT_BASE32_LEN + 1]; + + memcpy(base32Bitprint, base32BitprintWithDot, SHA_BASE32SIZE); + memcpy(base32Bitprint + SHA_BASE32SIZE, + base32BitprintWithDot + SHA_BASE32SIZE + 1, + TIGER_BASE32SIZE + 1); bitziDecodeBase32(base32Bitprint, BITPRINT_BASE32_LEN, bitprint); } *************** *** 341,344 **** --- 356,360 ---- { lookup = toupper(base32Buffer[i]) - '0'; + /* Check to make sure that the given word falls inside a valid range */ *************** *** 361,365 **** --- 377,383 ---- } else + { buffer[offset] |= word << (8 - index); + } } else *************** *** 675,681 **** * http://www.cs.technion.ac.il/~biham/Reports/Tiger/ */ - /* Initialize the tigertree context */ ! static void tt_init(TT_CONTEXT *ctx) { ctx->count = 0; --- 693,698 ---- * http://www.cs.technion.ac.il/~biham/Reports/Tiger/ */ /* Initialize the tigertree context */ ! void tt_init(TT_CONTEXT *ctx) { ctx->count = 0; *************** *** 687,690 **** --- 704,710 ---- byte *node = ctx->top - NODESIZE; tiger((word64*)node,(word64)NODESIZE,(word64*)ctx->top); // combine two nodes + #if USE_BIG_ENDIAN + tt_endian((byte *)ctx->top); + #endif memmove(node,ctx->top,TIGERSIZE); // move up result ctx->top -= TIGERSIZE; // update top ptr *************** *** 696,699 **** --- 716,722 ---- tiger((word64*)block,(word64)ctx->index,(word64*)ctx->top); + #if USE_BIG_ENDIAN + tt_endian((byte *)ctx->top); + #endif ctx->top += TIGERSIZE; ++ctx->count; *************** *** 705,709 **** } ! static void tt_update(TT_CONTEXT *ctx, byte *buffer, word32 len) { if (ctx->index) --- 728,732 ---- } ! void tt_update(TT_CONTEXT *ctx, byte *buffer, word32 len) { if (ctx->index) *************** *** 711,727 **** unsigned left = BLOCKSIZE - ctx->index; if (len < left) ! { ! memmove(ctx->block + ctx->index, buffer, len); ! ctx->index += len; ! return; /* Finished */ ! } else ! { ! memmove(ctx->block + ctx->index, buffer, left); ! ctx->index = BLOCKSIZE; ! tt_block(ctx, ctx->block); ! buffer += left; ! len -= left; ! } } while (len >= BLOCKSIZE) --- 734,750 ---- unsigned left = BLOCKSIZE - ctx->index; if (len < left) ! { ! memmove(ctx->block + ctx->index, buffer, len); ! ctx->index += len; ! return; /* Finished */ ! } else ! { ! memmove(ctx->block + ctx->index, buffer, left); ! ctx->index = BLOCKSIZE; ! tt_block(ctx, ctx->block); ! buffer += left; ! len -= left; ! } } while (len >= BLOCKSIZE) *************** *** 746,750 **** } ! static void tt_digest(TT_CONTEXT *ctx, byte *s) { tt_final(ctx); --- 769,773 ---- } ! void tt_digest(TT_CONTEXT *ctx, byte *s) { tt_final(ctx); *************** *** 755,760 **** } // this code untested; use at own risk ! static void tt_copy(TT_CONTEXT *dest, TT_CONTEXT *src) { int i; --- 778,811 ---- } + void tt_endian(byte *s) + { + word64 *i; + byte *b, btemp; + word16 *w, wtemp; + + for(w = (word16 *)s; w < ((word16 *)s) + 12; w++) + { + b = (byte *)w; + btemp = *b; + *b = *(b + 1); + *(b + 1) = btemp; + } + + for(i = (word64 *)s; i < ((word64 *)s) + 3; i++) + { + w = (word16 *)i; + + wtemp = *w; + *w = *(w + 3); + *(w + 3) = wtemp; + + wtemp = *(w + 1); + *(w + 1) = *(w + 2); + *(w + 2) = wtemp; + } + } + // this code untested; use at own risk ! void tt_copy(TT_CONTEXT *dest, TT_CONTEXT *src) { int i; *************** *** 1587,1660 **** sha_final(digest, sha_info); } - - #if 0 - void bitziEncodeBase32(const unsigned char *buffer, - unsigned int bufLen, - char *base32Buffer) - { - unsigned int i, index; - unsigned char word; - - for(i = 0, index = 0; i < bufLen;) - { - /* Is the current word going to span a byte boundary? */ - if (index > 3) - { - word = buffer[i] >> index; - index = (index + 5) % 8; - if (i < bufLen - 1) - word |= (buffer[i + 1] & (0xFF >> (8 - index))) << (5 - index); - i++; - } - else - { - word = (buffer[i] >> index) & 0x1F; - index = (index + 5) % 8; - } - - assert(word < 32); - *(base32Buffer++) = (char)base32Chars[word]; - } - - *base32Buffer = 0; - } - - void bitziDecodeBase32(const char *base32Buffer, - unsigned int base32BufLen, - unsigned char *buffer) - { - int i, index, max, lookup, offset; - unsigned char word; - - memset(buffer, 0, bitziGetBase32DecodeLength(base32BufLen)); - max = strlen(base32Buffer); - for(i = 0, index = 0, offset = 0; i < max; i++) - { - lookup = toupper(base32Buffer[i]) - '0'; - /* Check to make sure that the given word falls inside - a valid range */ - if ( lookup < 0 && lookup >= BASE32_LOOKUP_MAX) - word = 0xFF; - else - word = base32Lookup[lookup][1]; - - /* If this word is not in the table, ignore it */ - if (word == 0xFF) - continue; - - if (index <= 3) - { - buffer[offset] |= (word << index); - index = (index + 5) % 8; - } - else - { - buffer[offset] |= (word << index) & 0xFF; - index = (index + 5) % 8; - offset++; - - buffer[offset] |= word >> (5 - index); - } - } - } - #endif --- 1638,1639 ---- Index: bitprint.h =================================================================== RCS file: /cvsroot/bitcollider/bitprint/bitprint.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** bitprint.h 2001/07/16 20:24:54 1.3 --- bitprint.h 2001/12/05 22:44:07 1.4 *************** *** 11,14 **** --- 11,16 ---- #endif + #include <stdio.h> + /* =================================================================== */ /* Definitions for the SHA1 hash function */ *************** *** 75,79 **** */ #define BITPRINT_RAW_LEN 44 ! #define BITPRINT_BASE32_LEN 71 /* This is the context class for the bitziInit, bitziUpdate, bitziFinal --- 77,83 ---- */ #define BITPRINT_RAW_LEN 44 ! #define BITPRINT_BASE32_LEN 72 ! #define SHA_BASE32SIZE 32 ! #define TIGER_BASE32SIZE 39 /* This is the context class for the bitziInit, bitziUpdate, bitziFinal |
From: Robert K. <may...@us...> - 2001-12-05 18:43:55
|
Update of /cvsroot/bitcollider/bitcollider/lib In directory usw-pr-cvs1:/tmp/cvs-serv19399/lib Modified Files: bitprint.c main.c Log Message: Fixed up the character set encoding and added support for the dot between the sha and tigertree hash. Index: bitprint.c =================================================================== RCS file: /cvsroot/bitcollider/bitcollider/lib/bitprint.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** bitprint.c 2001/12/05 09:02:31 1.2 --- bitprint.c 2001/12/05 18:43:52 1.3 *************** *** 24,35 **** { '0', 0xFF }, { '1', 0xFF }, ! { '2', 0x18 }, ! { '3', 0x19 }, ! { '4', 0x1A }, ! { '5', 0x1B }, ! { '6', 0x1C }, ! { '7', 0x1D }, ! { '8', 0x1E }, ! { '9', 0x1F }, { ':', 0xFF }, { ';', 0xFF }, --- 24,35 ---- { '0', 0xFF }, { '1', 0xFF }, ! { '2', 0x1A }, ! { '3', 0x1B }, ! { '4', 0x1C }, ! { '5', 0x1D }, ! { '6', 0x1E }, ! { '7', 0x1F }, ! { '8', 0xFF }, ! { '9', 0xFF }, { ':', 0xFF }, { ';', 0xFF }, *************** *** 50,68 **** { 'J', 0x09 }, { 'K', 0x0A }, ! { 'L', 0xFF }, ! { 'M', 0x0B }, ! { 'N', 0x0C }, ! { 'O', 0xFF }, ! { 'P', 0x0D }, ! { 'Q', 0x0E }, ! { 'R', 0x0F }, ! { 'S', 0x10 }, ! { 'T', 0x11 }, ! { 'U', 0x12 }, ! { 'V', 0x13 }, ! { 'W', 0x14 }, ! { 'X', 0x15 }, ! { 'Y', 0x16 }, ! { 'Z', 0x17 } }; --- 50,68 ---- { 'J', 0x09 }, { 'K', 0x0A }, ! { 'L', 0x0B }, ! { 'M', 0x0C }, ! { 'N', 0x0D }, ! { 'O', 0x0E }, ! { 'P', 0x0F }, ! { 'Q', 0x10 }, ! { 'R', 0x11 }, ! { 'S', 0x12 }, ! { 'T', 0x13 }, ! { 'U', 0x14 }, ! { 'V', 0x15 }, ! { 'W', 0x16 }, ! { 'X', 0x17 }, ! { 'Y', 0x18 }, ! { 'Z', 0x19 } }; *************** *** 173,181 **** { bitziEncodeBase32(bitprint, BITPRINT_RAW_LEN, base32Bitprint); } ! void bitziBitprintFromBase32(const char *base32Bitprint, unsigned char *bitprint) { bitziDecodeBase32(base32Bitprint, BITPRINT_BASE32_LEN, bitprint); } --- 173,190 ---- { bitziEncodeBase32(bitprint, BITPRINT_RAW_LEN, base32Bitprint); + memmove(base32Bitprint + SHA_BASE32SIZE + 1, + base32Bitprint + SHA_BASE32SIZE, TIGER_BASE32SIZE + 1); + base32Bitprint[SHA_BASE32SIZE] = '.'; } ! void bitziBitprintFromBase32(const char *base32BitprintWithDot, unsigned char *bitprint) { + char base32Bitprint[BITPRINT_BASE32_LEN + 1]; + + memcpy(base32Bitprint, base32BitprintWithDot, SHA_BASE32SIZE); + memcpy(base32Bitprint + SHA_BASE32SIZE, + base32BitprintWithDot + SHA_BASE32SIZE + 1, + TIGER_BASE32SIZE + 1); bitziDecodeBase32(base32Bitprint, BITPRINT_BASE32_LEN, bitprint); } Index: main.c =================================================================== RCS file: /cvsroot/bitcollider/bitcollider/lib/main.c,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -r1.38 -r1.39 *** main.c 2001/12/05 09:02:32 1.38 --- main.c 2001/12/05 18:43:52 1.39 *************** *** 722,727 **** b_bool ret = true; Context *context = NULL; - char *treeIndex; - char *treeIndexPlusOne; if (bitziBitprintInit(&bcontext) == -1) --- 722,725 ---- *************** *** 787,797 **** bitziBitprintFinal(&bcontext, bitprintRaw); bitziBitprintToBase32(bitprintRaw, bitprint); - - /* place period in middle of sha1 and tree */ - treeIndex = bitprint + 32; - treeIndexPlusOne = bitprint + 33; - memmove(treeIndexPlusOne, treeIndex, 39); - bitprint[32] = '.'; - bitprint[72] = '\0'; if (mcontext) --- 785,788 ---- |
From: Robert K. <may...@us...> - 2001-12-05 18:43:55
|
Update of /cvsroot/bitcollider/bitcollider In directory usw-pr-cvs1:/tmp/cvs-serv19399 Modified Files: ChangeLog aclocal.m4 config.h.in configure.in Log Message: Fixed up the character set encoding and added support for the dot between the sha and tigertree hash. Index: ChangeLog =================================================================== RCS file: /cvsroot/bitcollider/bitcollider/ChangeLog,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** ChangeLog 2001/08/23 18:45:51 1.7 --- ChangeLog 2001/12/05 18:43:52 1.8 *************** *** 1,2 **** --- 1,8 ---- + Changes to version 0.3.4: + ------------------------- + + - Changed the character set used for Base32 encoding and added a . between + the sha1 and tigertree hash + Changes to version 0.3.3: ------------------------- Index: aclocal.m4 =================================================================== RCS file: /cvsroot/bitcollider/bitcollider/aclocal.m4,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** aclocal.m4 2001/08/23 20:39:42 1.7 --- aclocal.m4 2001/12/05 18:43:52 1.8 *************** *** 103,2854 **** AC_SUBST($1)]) - # libtool.m4 - Configure libtool for the host system. -*-Shell-script-*- ! # serial 46 AC_PROG_LIBTOOL ! AC_DEFUN([AC_PROG_LIBTOOL], [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl ! # This can be used to rebuild libtool when needed ! LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" [...3515 lines suppressed...] ! # This is just to silence aclocal about the macro not being used ! ifelse([AC_DISABLE_FAST_INSTALL]) # Like AC_CONFIG_HEADER, but automatically create stamp file. --- 509,523 ---- ]) ! dnl old names ! AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl ! AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl ! AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl ! AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl ! AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl ! AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl ! AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl ! dnl This is just to silence aclocal about the macro not being used ! ifelse([AC_DISABLE_FAST_INSTALL])dnl # Like AC_CONFIG_HEADER, but automatically create stamp file. Index: config.h.in =================================================================== RCS file: /cvsroot/bitcollider/bitcollider/config.h.in,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** config.h.in 2001/10/10 23:25:48 1.7 --- config.h.in 2001/12/05 18:43:52 1.8 *************** *** 12,18 **** #undef SIZEOF_LONG - /* Define if you have the <dlfcn.h> header file. */ - #undef HAVE_DLFCN_H - /* Name of package */ #undef PACKAGE --- 12,15 ---- Index: configure.in =================================================================== RCS file: /cvsroot/bitcollider/bitcollider/configure.in,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -r1.12 -r1.13 *** configure.in 2001/10/10 23:25:48 1.12 --- configure.in 2001/12/05 18:43:52 1.13 *************** *** 30,40 **** dnl Checks for typedefs, structures, and compiler characteristics. ! AC_CHECK_LIB(db, db_create, have_db="yes", have_db="no") ! if test "$have_db" = "yes"; then ! AC_DEFINE(USE_BDB) ! BDB_LIBS="-ldb" ! AC_SUBST(BDB_LIBS) ! AC_MSG_RESULT([compiling caching support]) ! fi AC_CHECK_LIB(ogg, ogg_sync_init, have_ogg="yes", have_ogg="no") --- 30,42 ---- dnl Checks for typedefs, structures, and compiler characteristics. ! dnl AC_CHECK_LIB(db, db_create, have_db="yes", have_db="no") ! dnl if test "$have_db" = "yes"; then ! dnl AC_DEFINE(USE_BDB) ! dnl BDB_LIBS="-ldb" ! dnl AC_SUBST(BDB_LIBS) ! dnl AC_MSG_RESULT([compiling caching support]) ! dnl fi ! BDB_LIBS="" ! AC_SUBST(BDB_LIBS) AC_CHECK_LIB(ogg, ogg_sync_init, have_ogg="yes", have_ogg="no") |
From: Robert K. <may...@us...> - 2001-12-05 18:43:55
|
Update of /cvsroot/bitcollider/bitcollider/include In directory usw-pr-cvs1:/tmp/cvs-serv19399/include Modified Files: bitprint.h Log Message: Fixed up the character set encoding and added support for the dot between the sha and tigertree hash. Index: bitprint.h =================================================================== RCS file: /cvsroot/bitcollider/bitcollider/include/bitprint.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** bitprint.h 2001/07/23 22:32:10 1.1 --- bitprint.h 2001/12/05 18:43:52 1.2 *************** *** 24,28 **** */ #define BITPRINT_RAW_LEN 44 ! #define BITPRINT_BASE32_LEN 71 #define SHA_BASE32SIZE 32 #define TIGER_BASE32SIZE 39 --- 24,28 ---- */ #define BITPRINT_RAW_LEN 44 ! #define BITPRINT_BASE32_LEN 72 #define SHA_BASE32SIZE 32 #define TIGER_BASE32SIZE 39 |
From: Robert K. <may...@us...> - 2001-10-12 23:16:02
|
Update of /cvsroot/bitcollider/bitcollider In directory usw-pr-cvs1:/tmp/cvs-serv22043 Modified Files: README.win32 Log Message: Updated for the BDB stuff Index: README.win32 =================================================================== RCS file: /cvsroot/bitcollider/bitcollider/README.win32,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** README.win32 2001/03/21 01:44:17 1.1 --- README.win32 2001/10/12 23:16:00 1.2 *************** *** 1,2 **** --- 1,27 ---- + Compilation notes for Win32: + ============================ + + Berkeley DB notes: + ------------------ + + To build the Berkeley DB support into the bitcollider you will need + to install the Berkeley DB from Sleepy Cat software: + + http://www.sleepycat.com + + The BDB installation needs to reside in a directory called 'db' at + the same level the bitcollider source directory. + + Example: If you unzipped the bitcollider source into C:\devel\bitcollider, + you must install the Berkeley DB into c:\devel\db. + + If you do not want to use the Berkeley DB with the Bitcollider, go into + the options for the project bc_dll and under Compile, Preprocessor + options, remove the define USE_BDB. + + + Vorbis Support notes: + --------------------- + In order to compile the vorbis plugin in win32, you must install the vorbis sdk into a directory called vorbis-sdk right alongside the *************** *** 5,6 **** --- 30,35 ---- Example: If you unzipped the bitcollider source into C:\devel\bitcollider, you must install the Vorbis SDK into C:\devel\vorbis-sdk + + If you do not want to build the Vorbis plugin, go to Project|Dependecies + and deselect the vorbis project from the dependecies of the bitcollider + project. |
From: Robert K. <may...@us...> - 2001-10-12 23:07:45
|
Update of /cvsroot/bitcollider/bitcollider/lib In directory usw-pr-cvs1:/tmp/cvs-serv19275/lib Modified Files: main.c Log Message: Finished the win32 port of the cache changes Index: main.c =================================================================== RCS file: /cvsroot/bitcollider/bitcollider/lib/main.c,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -r1.36 -r1.37 *** main.c 2001/10/12 21:37:52 1.36 --- main.c 2001/10/12 23:07:42 1.37 *************** *** 20,28 **** #include "plugin_man.h" #include "tiger.h" #ifndef _WIN32 #include "browser.h" #include <errno.h> #include <unistd.h> - #include <sys/stat.h> #else #include <windows.h> --- 20,28 ---- #include "plugin_man.h" #include "tiger.h" + #include <sys/stat.h> #ifndef _WIN32 #include "browser.h" #include <errno.h> #include <unistd.h> #else #include <windows.h> *************** *** 304,314 **** #if USE_BDB /* Check to see if this bitprint has already been bitprinted */ if (realpath(fileName, centry.fileName) == NULL) strcpy(centry.fileName, fileName); if (submission->bc->cache && get_cache_entry(submission->bc->cache, ¢ry)) { ! if (stat(submission->fileName, &fileInfo) == 0) { if (fileInfo.st_mtime == centry.lastModDate) --- 304,322 ---- #if USE_BDB /* Check to see if this bitprint has already been bitprinted */ + #ifdef WIN32 + { + char *dummy; + if (GetFullPathName(fileName, MAX_PATH, centry.fileName, &dummy) == 0) + strcpy(centry.fileName, fileName); + } + #else if (realpath(fileName, centry.fileName) == NULL) strcpy(centry.fileName, fileName); + #endif if (submission->bc->cache && get_cache_entry(submission->bc->cache, ¢ry)) { ! if (_stat(submission->fileName, (struct _stat *)&fileInfo) == 0) { if (fileInfo.st_mtime == centry.lastModDate) *************** *** 452,456 **** #if USE_BDB ! if (stat(submission->fileName, &fileInfo) == 0) { centry.lastModDate = fileInfo.st_mtime; --- 460,464 ---- #if USE_BDB ! if (_stat(submission->fileName, (struct _stat *)&fileInfo) == 0) { centry.lastModDate = fileInfo.st_mtime; |
From: Robert K. <may...@us...> - 2001-10-12 23:07:45
|
Update of /cvsroot/bitcollider/bitcollider/include In directory usw-pr-cvs1:/tmp/cvs-serv19275/include Modified Files: defs.h Log Message: Finished the win32 port of the cache changes Index: defs.h =================================================================== RCS file: /cvsroot/bitcollider/bitcollider/include/defs.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** defs.h 2001/10/12 19:59:51 1.2 --- defs.h 2001/10/12 23:07:42 1.3 *************** *** 11,14 **** --- 11,16 ---- #include <windows.h> #define strcasecmp stricmp + #else + #define _stat stat #endif |
From: Robert K. <may...@us...> - 2001-10-12 23:07:45
|
Update of /cvsroot/bitcollider/bitcollider/win32 In directory usw-pr-cvs1:/tmp/cvs-serv19275/win32 Modified Files: bc_dll.dsp Log Message: Finished the win32 port of the cache changes Index: bc_dll.dsp =================================================================== RCS file: /cvsroot/bitcollider/bitcollider/win32/bc_dll.dsp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -r1.14 -r1.15 *** bc_dll.dsp 2001/10/12 22:01:15 1.14 --- bc_dll.dsp 2001/10/12 23:07:42 1.15 *************** *** 5,9 **** # TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 ! CFG=bc_dll - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run --- 5,9 ---- # TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 ! CFG=BC_DLL - WIN32 DEBUG WITH BDB !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run *************** *** 14,18 **** !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE ! !MESSAGE NMAKE /f "bc_dll.mak" CFG="bc_dll - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: --- 14,18 ---- !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE ! !MESSAGE NMAKE /f "bc_dll.mak" CFG="BC_DLL - WIN32 DEBUG WITH BDB" !MESSAGE !MESSAGE Possible choices for configuration are: *************** *** 44,48 **** # PROP Target_Dir "" # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "BC_DLL_EXPORTS" /YX /FD /c ! # ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\include" /I "..\include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "BC_DLL_EXPORTS" /D "USE_BDB" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 --- 44,48 ---- # PROP Target_Dir "" # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "BC_DLL_EXPORTS" /YX /FD /c ! # ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\include" /I "..\include" /I "..\..\db\build_win32" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "BC_DLL_EXPORTS" /D "USE_BDB" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 *************** *** 70,74 **** # PROP Target_Dir "" # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "BC_DLL_EXPORTS" /YX /FD /GZ /c ! # ADD CPP /nologo /MD /W3 /Gm /GX /ZI /Od /I "..\..\include" /I "..\include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "BC_DLL_EXPORTS" /D "USE_BDB" /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 --- 70,74 ---- # PROP Target_Dir "" # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "BC_DLL_EXPORTS" /YX /FD /GZ /c ! # ADD CPP /nologo /MD /W3 /Gm /GX /ZI /Od /I "..\..\include" /I "..\include" /I "..\..\db\build_win32" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "BC_DLL_EXPORTS" /D "USE_BDB" /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 *************** *** 151,154 **** --- 151,158 ---- SOURCE=..\lib\tigertree.c + # End Source File + # Begin Source File + + SOURCE=..\libdb33.lib # End Source File # End Group |
From: Robert K. <may...@us...> - 2001-10-12 22:01:18
|
Update of /cvsroot/bitcollider/bitcollider/src In directory usw-pr-cvs1:/tmp/cvs-serv29655/src Modified Files: bitcollider.c Log Message: First set of changes for windows... Index: bitcollider.c =================================================================== RCS file: /cvsroot/bitcollider/bitcollider/src/bitcollider.c,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -r1.17 -r1.18 *** bitcollider.c 2001/10/12 19:59:51 1.17 --- bitcollider.c 2001/10/12 22:01:15 1.18 *************** *** 16,19 **** --- 16,20 ---- #include <windows.h> #else + #include <config.h> #include <sys/stat.h> #include <unistd.h> *************** *** 41,45 **** --- 42,48 ---- printf(" (Default is to analyze only known extensions)\n"); printf(" -f <file> - read tags from <file> instead of analyzing\n"); + #ifdef USE_BDB printf(" -c - clear the bitprint cache\n"); + #endif #ifndef _WIN32 printf(" -k - use the Konqueror to submit\n"); |
From: Robert K. <may...@us...> - 2001-10-12 22:01:18
|
Update of /cvsroot/bitcollider/bitcollider/win32 In directory usw-pr-cvs1:/tmp/cvs-serv29655/win32 Modified Files: bc_dll.def bc_dll.dsp Log Message: First set of changes for windows... Index: bc_dll.def =================================================================== RCS file: /cvsroot/bitcollider/bitcollider/win32/bc_dll.def,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** bc_dll.def 2001/07/23 23:13:33 1.5 --- bc_dll.def 2001/10/12 22:01:15 1.6 *************** *** 26,30 **** getLongPathName convert_to_hex ! read_submission_from_file sha_init --- 26,31 ---- getLongPathName convert_to_hex ! read_submission_from_file ! clear_bitprint_cache sha_init Index: bc_dll.dsp =================================================================== RCS file: /cvsroot/bitcollider/bitcollider/win32/bc_dll.dsp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -r1.13 -r1.14 *** bc_dll.dsp 2001/08/13 18:38:15 1.13 --- bc_dll.dsp 2001/10/12 22:01:15 1.14 *************** *** 44,48 **** # PROP Target_Dir "" # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "BC_DLL_EXPORTS" /YX /FD /c ! # ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\include" /I "..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "BC_DLL_EXPORTS" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 --- 44,48 ---- # PROP Target_Dir "" # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "BC_DLL_EXPORTS" /YX /FD /c ! # ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\include" /I "..\include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "BC_DLL_EXPORTS" /D "USE_BDB" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 *************** *** 70,74 **** # PROP Target_Dir "" # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "BC_DLL_EXPORTS" /YX /FD /GZ /c ! # ADD CPP /nologo /MD /W3 /Gm /GX /ZI /Od /I "..\..\include" /I "..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "BC_DLL_EXPORTS" /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 --- 70,74 ---- # PROP Target_Dir "" # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "BC_DLL_EXPORTS" /YX /FD /GZ /c ! # ADD CPP /nologo /MD /W3 /Gm /GX /ZI /Od /I "..\..\include" /I "..\include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "BC_DLL_EXPORTS" /D "USE_BDB" /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 *************** *** 98,101 **** --- 98,105 ---- SOURCE=..\lib\bitprint.c + # End Source File + # Begin Source File + + SOURCE=..\lib\cache.c # End Source File # Begin Source File |
From: Robert K. <may...@us...> - 2001-10-12 22:01:17
|
Update of /cvsroot/bitcollider/bitcollider/installer In directory usw-pr-cvs1:/tmp/cvs-serv29655/installer Modified Files: bc-setup.wse Log Message: First set of changes for windows... Index: bc-setup.wse =================================================================== RCS file: /cvsroot/bitcollider/bitcollider/installer/bc-setup.wse,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** bc-setup.wse 2001/08/01 21:21:56 1.6 --- bc-setup.wse 2001/10/12 22:01:15 1.7 *************** *** 1212,1215 **** --- 1212,1220 ---- end item: Install File + Source=d:\db-3.3.11\build_win32\Release\libdb33.dll + Destination=%MAINDIR%\libdb33.dll + Flags=0000000010000011 + end + item: Install File Source=d:\bitzi\bitcollider\vorbisfile.dll Destination=%MAINDIR%\vorbisfile.dll |
From: Robert K. <may...@us...> - 2001-10-12 21:37:55
|
Update of /cvsroot/bitcollider/bitcollider/lib In directory usw-pr-cvs1:/tmp/cvs-serv13344/lib Modified Files: main.c Log Message: Moved some include files around. Index: main.c =================================================================== RCS file: /cvsroot/bitcollider/bitcollider/lib/main.c,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -r1.35 -r1.36 *** main.c 2001/10/12 19:59:51 1.35 --- main.c 2001/10/12 21:37:52 1.36 *************** *** 13,16 **** --- 13,17 ---- #include "bc_version.h" #include "bitcollider.h" + #include "cache.h" #include "bitprint.h" #include "md5.h" |