+block2bytes(a, dest);
+block2bytes(b, dest + 4);
+}
+//-----------------------------------------------------------------------------
+void DecryptString(void * d, const void * s, size_t length, const BLOWFISH_CTX * ctx)
+{
+const char * src = s;
+char * dest = d;
+size_t pos = 0;
+while (pos < length)
+ {
+ DecryptBlock(dest + pos, src + pos, ctx);
+ pos += 8;
+ }
+}
+//-----------------------------------------------------------------------------
+void EncryptString(void * d, const void * s, size_t length, const BLOWFISH_CTX * ctx)
+{
+const char * src = s;
+char * dest = d;
+size_t pos = 0;
+while (pos < length)
+ {
+ if (pos + 8 < length)
+ EncryptBlock(dest + pos, src + pos, ctx);
+ else
+ {
+ // Short string, use 0-padded buffer.
+ char buf[8];
+ memset(buf, 0, sizeof(buf));
+ memcpy(buf, src + pos, length - pos);
+ EncryptBlock(dest + pos, buf, ctx);
+ }
+ pos += 8;
+ }