| 148 | } |
| 149 | |
| 150 | void DbCrypt::encrypt(CheckStatusWrapper* status, unsigned int length, const void* from, void* to) |
| 151 | { |
| 152 | status->init(); |
| 153 | |
| 154 | if (!key) |
| 155 | { |
| 156 | noKeyError(status); |
| 157 | return; |
| 158 | } |
| 159 | |
| 160 | const ISC_UCHAR* f = static_cast<const ISC_UCHAR*>(from); |
| 161 | ISC_UCHAR* t = static_cast<ISC_UCHAR*>(to); |
| 162 | |
| 163 | while (length--) |
| 164 | { |
| 165 | *t++ = (*f++) ^ key; |
| 166 | } |
| 167 | } |
| 168 | |
| 169 | void DbCrypt::decrypt(CheckStatusWrapper* status, unsigned int length, const void* from, void* to) |
| 170 | { |