~ubuntu-branches/ubuntu/trusty/clamav/trusty-security

« back to all changes in this revision

Viewing changes to libclamav/7z/7zCrcOpt.c

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2014-11-20 14:29:18 UTC
  • mfrom: (0.47.10) (137.1.1 trusty-proposed)
  • Revision ID: package-import@ubuntu.com-20141120142918-slpjc6vqq139e49n
Tags: 0.98.5+addedllvm-0ubuntu0.14.04.1
* Updated to 0.98.5 to fix security issues, including CVE-2013-6497.
* Removed patches no longer needed:
  - d/p/0002-Sebastian-Andrzej-Siewior.patch
  - d/p/0003-configure-use-pkg-config-for-check-so-test-is-detect.patch
  - d/p/0004-Stop-using-a-cargo-culted-syscall-table-and-trust-th.patch
  - d/p/0005-configure.ac-patches-to-got-with-autoreconf-and-auto.patch
  - d/p/0006-Fix-STAT64-definition-and-add-missing-includes.patch
* Added patches from vivid to fix FTBFS, .so version and other issues:
  - d/p/0002-Add-an-additional-n-after-the-number-in-the-pidfile.patch
  - d/p/0003-unit_tests-increment-test-timeout-from-40secs-to-5mi.patch
  - d/p/0006-remove-unnecessary-harmful-flags-from-libclamav.pc.patch
  - d/p/0010-hardcode-LLVM-linker-flag-because-llvm-config-return.patch
  - d/p/0017-Bump-.so-version-number.patch
  - d/p/0018-llvm-don-t-use-system-libs.patch
* debian/clamav-docs.docs: use wildcards, as some docs have changed.
* debian/clamav-base.postinst.in: added new options.
* debian/clamav-base.config.in: added new options.
* debian/clamav-base.templates: added new options.
* debian/control: added libssl-dev BuildDepends.
* clamav-testfiles.install: removed rar files.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* 7zCrcOpt.c -- CRC32 calculation : optimized version
2
 
2009-11-23 : Igor Pavlov : Public domain */
3
 
 
4
 
#include "CpuArch.h"
5
 
 
6
 
#ifdef MY_CPU_LE
7
 
 
8
 
#define CRC_UPDATE_BYTE_2(crc, b) (table[((crc) ^ (b)) & 0xFF] ^ ((crc) >> 8))
9
 
 
10
 
UInt32 MY_FAST_CALL CrcUpdateT4(UInt32 v, const void *data, size_t size, const UInt32 *table)
11
 
{
12
 
  const Byte *p = (const Byte *)data;
13
 
  for (; size > 0 && ((unsigned)(ptrdiff_t)p & 3) != 0; size--, p++)
14
 
    v = CRC_UPDATE_BYTE_2(v, *p);
15
 
  for (; size >= 4; size -= 4, p += 4)
16
 
  {
17
 
    v ^= *(const UInt32 *)p;
18
 
    v =
19
 
      table[0x300 + (v & 0xFF)] ^
20
 
      table[0x200 + ((v >> 8) & 0xFF)] ^
21
 
      table[0x100 + ((v >> 16) & 0xFF)] ^
22
 
      table[0x000 + ((v >> 24))];
23
 
  }
24
 
  for (; size > 0; size--, p++)
25
 
    v = CRC_UPDATE_BYTE_2(v, *p);
26
 
  return v;
27
 
}
28
 
 
29
 
UInt32 MY_FAST_CALL CrcUpdateT8(UInt32 v, const void *data, size_t size, const UInt32 *table)
30
 
{
31
 
  return CrcUpdateT4(v, data, size, table);
32
 
}
33
 
 
34
 
#endif
 
1
/* 7zCrcOpt.c -- CRC32 calculation : optimized version
 
2
2009-11-23 : Igor Pavlov : Public domain */
 
3
 
 
4
#if defined(_WIN32)
 
5
#include <WinSock2.h>
 
6
#include <Windows.h>
 
7
#endif
 
8
 
 
9
#include "CpuArch.h"
 
10
 
 
11
#ifdef MY_CPU_LE
 
12
 
 
13
#define CRC_UPDATE_BYTE_2(crc, b) (table[((crc) ^ (b)) & 0xFF] ^ ((crc) >> 8))
 
14
 
 
15
UInt32 MY_FAST_CALL CrcUpdateT4(UInt32 v, const void *data, size_t size, const UInt32 *table)
 
16
{
 
17
  const Byte *p = (const Byte *)data;
 
18
  for (; size > 0 && ((unsigned)(ptrdiff_t)p & 3) != 0; size--, p++)
 
19
    v = CRC_UPDATE_BYTE_2(v, *p);
 
20
  for (; size >= 4; size -= 4, p += 4)
 
21
  {
 
22
    v ^= *(const UInt32 *)p;
 
23
    v =
 
24
      table[0x300 + (v & 0xFF)] ^
 
25
      table[0x200 + ((v >> 8) & 0xFF)] ^
 
26
      table[0x100 + ((v >> 16) & 0xFF)] ^
 
27
      table[0x000 + ((v >> 24))];
 
28
  }
 
29
  for (; size > 0; size--, p++)
 
30
    v = CRC_UPDATE_BYTE_2(v, *p);
 
31
  return v;
 
32
}
 
33
 
 
34
UInt32 MY_FAST_CALL CrcUpdateT8(UInt32 v, const void *data, size_t size, const UInt32 *table)
 
35
{
 
36
  return CrcUpdateT4(v, data, size, table);
 
37
}
 
38
 
 
39
#endif