Fork of François Berder Crypto, fixed AES CBC and small rework

Dependents:   AES_example shaun_larada Smartage

Fork of Crypto by Francois Berder

Committer:
Geremia
Date:
Wed Jan 28 17:55:13 2015 +0000
Revision:
16:4399e2e6260b
Parent:
8:a090264e9b2d
AES: bugfixed CBC, added PCBC (i could add CFB and OFB if needed), added public setIV(), moved keyExpansion() to public, in and out buffers can be the same

Who changed what in which revision?

UserRevisionLine numberNew contents of line
feb11 8:a090264e9b2d 1 #ifndef STREAM_CIPHER_H
feb11 8:a090264e9b2d 2 #define STREAM_CIPHER_H
feb11 8:a090264e9b2d 3
feb11 8:a090264e9b2d 4 #include "Cipher.h"
feb11 8:a090264e9b2d 5
feb11 8:a090264e9b2d 6 class StreamCipher : public Cipher
feb11 8:a090264e9b2d 7 {
feb11 8:a090264e9b2d 8 public :
feb11 8:a090264e9b2d 9
feb11 8:a090264e9b2d 10 StreamCipher();
feb11 8:a090264e9b2d 11
feb11 8:a090264e9b2d 12 virtual CIPHER_TYPE getType() const;
feb11 8:a090264e9b2d 13
feb11 8:a090264e9b2d 14 virtual void encrypt(uint8_t *out, uint8_t *in, uint32_t length);
feb11 8:a090264e9b2d 15 virtual void decrypt(uint8_t *out, uint8_t *in, uint32_t length);
feb11 8:a090264e9b2d 16
feb11 8:a090264e9b2d 17 protected :
feb11 8:a090264e9b2d 18
feb11 8:a090264e9b2d 19 virtual uint8_t encryptByte(uint8_t in) = 0;
feb11 8:a090264e9b2d 20 virtual uint8_t decryptByte(uint8_t in) = 0;
feb11 8:a090264e9b2d 21
feb11 8:a090264e9b2d 22 };
feb11 8:a090264e9b2d 23
feb11 8:a090264e9b2d 24 #endif