This library implements some hash and cryptographic algorithms.

Dependents:   ES_CW2_Starter_JIN EMBEDDED_CW2 EMBEDDED_CW2_Final Spinnybois ... more

Fork of Crypto by Francois Berder

cipher/StreamCipher.cpp

Committer:
estott
Date:
2018-03-09
Revision:
15:634f9c4cbab1
Parent:
8:a090264e9b2d

File content as of revision 15:634f9c4cbab1:

#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]);
}