~ubuntu-branches/ubuntu/trusty/libgcrypt11/trusty-proposed

« back to all changes in this revision

Viewing changes to cipher/crc.c

  • Committer: Bazaar Package Importer
  • Author(s): Steve Kowalik
  • Date: 2008-07-02 18:32:45 UTC
  • mfrom: (1.1.5 upstream) (2.1.2 lenny)
  • Revision ID: james.westby@ubuntu.com-20080702183245-b1p9zumbhmq9wk4g
Tags: 1.4.1-1ubuntu1
* Merge from Debian unstable.
* Remaining Ubuntu changes:
  - Add libgcrypt11-udeb package.
  - Add clean-la.mk, and add a symlink for the .la
* Ubuntu changes dropped:
  - Build-Depends changes.
  - Drop patch 20_socket_nsl_linkage.diff, basically applied upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
#include <stdio.h>
24
24
#include <stdlib.h>
25
25
#include <string.h>
26
 
#include <assert.h>
 
26
 
27
27
#include "g10lib.h"
28
28
#include "memory.h"
29
29
#include "cipher.h"
129
129
 *
130
130
 */
131
131
static u32
132
 
update_crc32 (u32 crc, char *buf, size_t len)
 
132
update_crc32 (u32 crc, const void *buf_arg, size_t len)
133
133
{
 
134
  const char *buf = buf_arg;
134
135
  size_t n;
135
136
 
136
137
  for (n = 0; n < len; n++)
156
157
}
157
158
 
158
159
static void
159
 
crc32_write (void *context, byte * inbuf, size_t inlen)
 
160
crc32_write (void *context, const void *inbuf, size_t inlen)
160
161
{
161
162
  CRC_CONTEXT *ctx = (CRC_CONTEXT *) context;
162
163
  if (!inbuf)
163
164
    return;
164
 
  ctx->CRC = update_crc32 (ctx->CRC, (char*)inbuf, inlen);
 
165
  ctx->CRC = update_crc32 (ctx->CRC, inbuf, inlen);
165
166
}
166
167
 
167
168
static byte *
244
245
}
245
246
 
246
247
static void
247
 
crc24rfc2440_write (void *context, byte * inbuf, size_t inlen)
 
248
crc24rfc2440_write (void *context, const void *inbuf_arg, size_t inlen)
248
249
{
 
250
  const unsigned char *inbuf = inbuf_arg;
249
251
  int i;
250
252
  CRC_CONTEXT *ctx = (CRC_CONTEXT *) context;
251
253