aboutsummaryrefslogtreecommitdiff
path: root/src
Commit message (Expand)AuthorAge
...
* Change many useless std::list into Environment class (m_players), ABMHandler ...Loic Blot2015-02-17
* Grab GUIChatConsole::m_font, fixes segfault when changing font_sizeKahrl2015-02-18
* Replace std::list by std::vector into ClientMap::updateDrawList, Map::timerUp...Loic Blot2015-02-17
* Replace std::list by std::vector into timerUpdate callsLoic Blot2015-02-17
* Ignore old entities from 0.3.Novatux2015-02-17
* Remove old comment from Network Rework Patch 2/4Loic Blot2015-02-17
* Replace std::list by std::vector into ServerMap::listAllLoadableBlocks Server...Loic Blot2015-02-17
* SAO: re-add old ActiveObjectTypes for a future migration layerLoic Blot2015-02-17
* SAO work: ActiveObject types & SAO cleanup * Replace u8 types with ActiveObje...Loic Blot2015-02-17
* Add player direction to on-screen debug textYaman2015-02-17
* Performance Improvement: Use a cache which caches result for getFacePositions.Loic Blot2015-02-16
* [Patch 2/4] Network rework: packet writing, sending and cleanupsLoic Blot2015-02-16
* Fix unit test if there isn't a localhost address (for example FreeBSD jails),...Loic Blot2015-02-15
* Fix unit test if there isn't a localhost address (for example FreeBSD jails)Loic Blot2015-02-15
* Only do the IPv6 unit test if IPv6 is enabledLoic Blot2015-02-15
* Re-apply 4a6582c13c36cab457b78f32338c6bb4ab9ea58b broken since 146f77fdb75083...Loic Blot2015-02-14
* Suppress CGUITTFONT build warningsCraig Robbins2015-02-13
* Minor fixes in translationsngosang2015-02-12
* Fix gettext on MSVCBlockMen2015-02-12
* Fix .zip extraction (mod store)ngosang2015-02-12
* main.cpp rework * Move ClientLauncher class to a dedicated file * ClientLaunc...Loic Blot2015-02-12
* Remove unused variables to make clang happyLoic Blot2015-02-12
* Small changes in the style of controlsngosang2015-02-12
* Make Clang happy with lua lauxlib.c.Loic Blot2015-02-12
* Enable LUA_USE_POSIX if possible in bundled Luaest312015-02-12
* Fix Android compile warningCraig Robbins2015-02-12
* Don't permit to open inventory is playerCAO isn't present. This prevent to op...Loic Blot2015-02-11
* Fix issue #2279. ok @zeno-Loic Blot2015-02-11
* Remove workaround in itemdef.cpp to enable/disable/enable "enable_shaders" se...Craig Robbins2015-02-11
* Fix Android build of narrow_to_wideShadowNinja2015-02-11
* Revert "Remove workaround in itemdef.cpp to enable/disable/enable "enable_sha...Craig Robbins2015-02-11
* Remove workaround in itemdef.cpp to enable/disable/enable "enable_shaders" se...Craig Robbins2015-02-11
* Fix FTBFS on GNU/Hurd platformMarkus Koschany2015-02-11
* Increase MapBlock::actuallyUpdateDayNightDiff() performance by 2-8x. ok @cele...Craig Robbins2015-02-10
* Replace getPlayer(playername) by getPlayer(peer_id) in some possible cases. o...Loic Blot2015-02-10
* Craftdef.cpp: Improve loop and mathematics for CraftDefinitionShaped::checkLoic Blot2015-02-10
* Fix Exit to OS button focus in Pause Menungosang2015-02-10
* Network Layer 7 rework (Packet handling)Loic Blot2015-02-10
* Hud: Modify Y-positioning of health/breath starbars to prevent overlapping wi...kwolekr2015-02-08
* Fix rebase bug, make render loop use cache settinggregorycu2015-02-07
* Fix warnings in CGUITTFont.cppCraig Robbins2015-02-06
* Fix gettextShadowNinja2015-02-05
* Reduce gettext wide/narrow and string/char* conversionsShadowNinja2015-02-05
* Fix translation memory leakShadowNinja2015-02-05
* Fix translation finding of overlay messagesShadowNinja2015-02-05
* Mgv7 mountains: Remove divide by zero code that creates vast wallsparamat2015-02-05
* Fix performance regressionCraig Robbins2015-02-05
* Give full breath after deathSmallJoker2015-02-05
* Fix dying of lava causes repeated death This is a bugfix for issue #81gregorycu2015-02-05
* Suppress 4 gcc 4.9.2 warnings in CGUITTFont.cppngosang2015-02-05
an class="hl slc">// starting values a = H0; b = H1; c = H2; d = H3; e = H4; // copy and expand the message block for( t = 0; t < 16; t++ ) W[t] = (bytes[t*4] << 24) +(bytes[t*4 + 1] << 16) +(bytes[t*4 + 2] << 8) + bytes[t*4 + 3]; for(; t< 80; t++ ) W[t] = lrot( W[t-3]^W[t-8]^W[t-14]^W[t-16], 1 ); /* main loop */ Uint32 temp; for( t = 0; t < 80; t++ ) { if( t < 20 ) { K = 0x5a827999; f = (b & c) | ((b ^ 0xFFFFFFFF) & d);//TODO: try using ~ } else if( t < 40 ) { K = 0x6ed9eba1; f = b ^ c ^ d; } else if( t < 60 ) { K = 0x8f1bbcdc; f = (b & c) | (b & d) | (c & d); } else { K = 0xca62c1d6; f = b ^ c ^ d; } temp = lrot(a,5) + f + e + W[t] + K; e = d; d = c; c = lrot(b,30); b = a; a = temp; //printf( "t=%d %08x %08x %08x %08x %08x\n",t,a,b,c,d,e ); } /* add variables */ H0 += a; H1 += b; H2 += c; H3 += d; H4 += e; //printf( "Current: %08x %08x %08x %08x %08x\n",H0,H1,H2,H3,H4 ); /* all bytes have been processed */ unprocessedBytes = 0; } // addBytes ********************************************************** void SHA1::addBytes( const char* data, int num ) { assert( data ); assert( num >= 0 ); // add these bytes to the running total size += num; // repeat until all data is processed while( num > 0 ) { // number of bytes required to complete block int needed = 64 - unprocessedBytes; assert( needed > 0 ); // number of bytes to copy (use smaller of two) int toCopy = (num < needed) ? num : needed; // Copy the bytes memcpy( bytes + unprocessedBytes, data, toCopy ); // Bytes have been copied num -= toCopy; data += toCopy; unprocessedBytes += toCopy; // there is a full block if( unprocessedBytes == 64 ) process(); } } // digest ************************************************************ unsigned char* SHA1::getDigest() { // save the message size Uint32 totalBitsL = size << 3; Uint32 totalBitsH = size >> 29; // add 0x80 to the message addBytes( "\x80", 1 ); unsigned char footer[64] = { 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, 0 }; // block has no room for 8-byte filesize, so finish it if( unprocessedBytes > 56 ) addBytes( (char*)footer, 64 - unprocessedBytes); assert( unprocessedBytes <= 56 ); // how many zeros do we need int neededZeros = 56 - unprocessedBytes; // store file size (in bits) in big-endian format storeBigEndianUint32( footer + neededZeros , totalBitsH ); storeBigEndianUint32( footer + neededZeros + 4, totalBitsL ); // finish the final block addBytes( (char*)footer, neededZeros + 8 ); // allocate memory for the digest bytes unsigned char* digest = (unsigned char*)malloc( 20 ); // copy the digest bytes storeBigEndianUint32( digest, H0 ); storeBigEndianUint32( digest + 4, H1 ); storeBigEndianUint32( digest + 8, H2 ); storeBigEndianUint32( digest + 12, H3 ); storeBigEndianUint32( digest + 16, H4 ); // return the digest return digest; }