added CBC encryption mode (configure --enable-cbc)

This commit is contained in:
git@daemon.de
2014-01-28 12:20:30 +01:00
parent ad009a8142
commit 5ae1d07067
9 changed files with 166 additions and 65 deletions

View File

@@ -20,7 +20,7 @@
*/
// various helpers
// various helpers, too small to put into own c
#ifndef _HAVE_PCP_UTIL_H
#define _HAVE_PCP_UTIL_H
@@ -58,4 +58,11 @@ static inline size_t _findoffset(unsigned char *bin, size_t binlen, char *sigsta
return offset;
}
static inline void _xorbuf(unsigned char *iv, unsigned char *buf, size_t xlen) {
size_t i;
for (i = 0; i < xlen; ++i)
buf[i] = iv[i] ^ buf[i];
}
#endif // _HAVE_PCP_UTIL_H