Embedded systems coursework 2.
Fork of Crypto_light by
Embed:
(wiki syntax)
Show/hide line numbers
StreamCipher.cpp
00001 #include "StreamCipher.h" 00002 00003 00004 StreamCipher::StreamCipher() 00005 { 00006 } 00007 00008 CIPHER_TYPE StreamCipher::getType() const 00009 { 00010 return STREAM_CIPHER; 00011 } 00012 00013 void StreamCipher::encrypt(uint8_t *out, uint8_t *in, uint32_t length) 00014 { 00015 for(uint32_t i = 0; i < length; ++i) 00016 out[i] = encryptByte(in[i]); 00017 } 00018 00019 void StreamCipher::decrypt(uint8_t *out, uint8_t *in, uint32_t length) 00020 { 00021 for(uint32_t i = 0; i < length; ++i) 00022 out[i] = decryptByte(in[i]); 00023 }
Generated on Wed Jul 20 2022 22:55:43 by 1.7.2