This library implements some hash and cryptographic algorithms.

Dependents:   mBuinoBlinky PB_Emma_Ethernet SLOTrashHTTP Garagem ... more

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers StreamCipher.cpp Source File

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 }