Home | History | Annotate | Download | only in src

Lines Matching refs:blob

9 void     printbits   ( const void * blob, int len );
10 void printhex32 ( const void * blob, int len );
11 void printbytes ( const void * blob, int len );
12 void printbytes2 ( const void * blob, int len );
17 uint32_t getbit ( const void * blob, int len, uint32_t bit );
18 uint32_t getbit_wrap ( const void * blob, int len, uint32_t bit );
20 void setbit ( void * blob, int len, uint32_t bit );
21 void setbit ( void * blob, int len, uint32_t bit, uint32_t val );
23 void clearbit ( void * blob, int len, uint32_t bit );
25 void flipbit ( void * blob, int len, uint32_t bit );
30 int countbits ( const void * blob, int len );
37 inline uint32_t getbit ( T & blob, uint32_t bit )
39 return getbit(&blob,sizeof(blob),bit);
42 template<> inline uint32_t getbit ( uint32_t & blob, uint32_t bit ) { return (blob >> (bit & 31)) & 1; }
43 template<> inline uint32_t getbit ( uint64_t & blob, uint32_t bit ) { return (blob >> (bit & 63)) & 1; }
48 inline void setbit ( T & blob, uint32_t bit )
50 return setbit(&blob,sizeof(blob),bit);
53 template<> inline void setbit ( uint32_t & blob, uint32_t bit ) { blob |= uint32_t(1) << (bit & 31); }
54 template<> inline void setbit ( uint64_t & blob, uint32_t bit ) { blob |= uint64_t(1) << (bit & 63); }
59 inline void flipbit ( T & blob, uint32_t bit )
61 flipbit(&blob,sizeof(blob),bit);
64 template<> inline void flipbit ( uint32_t & blob, uint32_t bit ) { bit &= 31; blob ^= (uint32_t(1) << bit); }
65 template<> inline void flipbit ( uint64_t & blob, uint32_t bit ) { bit &= 63; blob ^= (uint64_t(1) << bit); }
71 void lshift1 ( void * blob, int len, int c );
72 void lshift8 ( void * blob, int len, int c );
73 void lshift32 ( void * blob, int len, int c );
75 void rshift1 ( void * blob, int len, int c );
76 void rshift8 ( void * blob, int len, int c );
77 void rshift32 ( void * blob, int len, int c );
79 inline void lshift ( void * blob, int len, int c )
83 lshift32(blob,len,c);
87 lshift8(blob,len,c);
91 inline void rshift ( void * blob, int len, int c )
95 rshift32(blob,len,c);
99 rshift8(blob,len,c);
104 inline void lshift ( T & blob, int c )
108 lshift32(&blob,sizeof(T),c);
112 lshift8(&blob,sizeof(T),c);
117 inline void rshift ( T & blob, int c )
121 lshift32(&blob,sizeof(T),c);
125 lshift8(&blob,sizeof(T),c);
129 template<> inline void lshift ( uint32_t & blob, int c ) { blob <<= c; }
130 template<> inline void lshift ( uint64_t & blob, int c ) { blob <<= c; }
131 template<> inline void rshift ( uint32_t & blob, int c ) { blob >>= c; }
132 template<> inline void rshift ( uint64_t & blob, int c ) { blob >>= c; }
138 void lrot1 ( void * blob, int len, int c );
139 void lrot8 ( void * blob, int len, int c );
140 void lrot32 ( void * blob, int len, int c );
142 void rrot1 ( void * blob, int len, int c );
143 void rrot8 ( void * blob, int len, int c );
144 void rrot32 ( void * blob, int len, int c );
146 inline void lrot ( void * blob, int len, int c )
150 return lrot32(blob,len,c);
154 return lrot8(blob,len,c);
158 inline void rrot ( void * blob, int len, int c )
162 return rrot32(blob,len,c);
166 return rrot8(blob,len,c);
171 inline void lrot ( T & blob, int c )
175 return lrot32(&blob,sizeof(T),c);
179 return lrot8(&blob,sizeof(T),c);
184 inline void rrot ( T & blob, int c )
188 return rrot32(&blob,sizeof(T),c);
192 return rrot8(&blob,sizeof(T),c);
196 template<> inline void lrot ( uint32_t & blob, int c ) { blob = ROTL32(blob,c); }
197 template<> inline void lrot ( uint64_t & blob, int c ) { blob = ROTL64(blob,c); }
198 template<> inline void rrot ( uint32_t & blob, int c ) { blob = ROTR32(blob,c); }
199 template<> inline void rrot ( uint64_t & blob, int c ) { blob = ROTR64(blob,c); }
202 // Bit-windowing functions - select some N-bit subset of the input blob
204 uint32_t window1 ( void * blob, int len, int start, int count );
205 uint32_t window8 ( void * blob, int len, int start, int count );
206 uint32_t window32 ( void * blob, int len, int start, int count );
208 inline uint32_t window ( void * blob, int len, int start, int count )
212 return window8(blob,len,start,count);
216 return window32(blob,len,start,count);
221 inline uint32_t window ( T & blob, int start, int count )
225 return window32(&blob,sizeof(T),start,count);
229 return window8(&blob,sizeof(T),start,count);
234 inline uint32_t window ( uint32_t & blob, int start, int count )
236 return ROTR32(blob,start) & ((1<<count)-1);
240 inline uint32_t window ( uint64_t & blob, int start, int count )
242 return (uint32_t)ROTR64(blob,start) & ((1<<count)-1);