Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of Crypto_light by
Diff: cipher/StreamCipher.cpp
- Revision:
- 8:a090264e9b2d
diff -r 2dbbdfb08123 -r a090264e9b2d cipher/StreamCipher.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cipher/StreamCipher.cpp Sat Sep 14 20:54:59 2013 +0000 @@ -0,0 +1,23 @@ +#include "StreamCipher.h" + + +StreamCipher::StreamCipher() +{ +} + +CIPHER_TYPE StreamCipher::getType() const +{ + return STREAM_CIPHER; +} + +void StreamCipher::encrypt(uint8_t *out, uint8_t *in, uint32_t length) +{ + for(uint32_t i = 0; i < length; ++i) + out[i] = encryptByte(in[i]); +} + +void StreamCipher::decrypt(uint8_t *out, uint8_t *in, uint32_t length) +{ + for(uint32_t i = 0; i < length; ++i) + out[i] = decryptByte(in[i]); +} \ No newline at end of file