60 memset (
c,0,
sizeof(*
c));
70 size_t chunk = ((size_t)1)<<(
sizeof(size_t)*8-4);
71 const unsigned char *inp = _inp;
88 unsigned int bitoff = c->
bitoff,
90 inpgap = (8-(
unsigned int)bits%8)&7;
91 const unsigned char *inp=_inp;
105 #ifndef OPENSSL_SMALL_FOOTPRINT
107 if (inpgap==0 && bitrem==0)
119 unsigned int byteoff = bitoff/8;
126 memcpy(c->
data+byteoff,inp,bitrem);
133 memcpy(c->
data+byteoff,inp,bits/8);
134 bitoff += (
unsigned int)bits;
158 unsigned int byteoff = bitoff/8;
161 #ifndef OPENSSL_SMALL_FOOTPRINT
164 c->
data[byteoff++] |= inp[0] & (0xff>>inpgap);
166 bitoff += inpgap; bitrem = 0;
167 bits -= inpgap; inpgap = 0;
181 b = ((inp[0]<<inpgap) | (inp[1]>>(8-inpgap)));
183 if (bitrem) c->
data[byteoff++] |= b>>bitrem;
184 else c->
data[byteoff++] =
b;
194 if (bitrem) c->
data[byteoff] = b<<(8-bitrem);
198 b = (inp[0]<<inpgap)&0xff;
199 if (bitrem) c->
data[byteoff++] |= b>>bitrem;
200 else c->
data[byteoff++] =
b;
201 bitoff += (
unsigned int)bits;
208 if (bitrem) c->
data[byteoff] = b<<(8-bitrem);
218 unsigned int bitoff = c->
bitoff,
224 if (bitoff) c->
data[byteoff] |= 0x80>>bitoff;
225 else c->
data[byteoff] = 0x80;
237 memset(&c->
data[byteoff],0,
242 for(v=c->
bitlen[i],j=0;j<
sizeof(
size_t);j++,v>>=8)
243 *p-- = (
unsigned char)(v&0xff);
249 memset(c,0,
sizeof(*c));
260 if (md == NULL) md=m;