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
cipher/BlockCipher.h
- Committer:
- trod
- Date:
- 2018-03-23
- Revision:
- 16:c702a2fd256e
- Parent:
- 8:a090264e9b2d
File content as of revision 16:c702a2fd256e:
#ifndef BLOCK_CIPHER_H #define BLOCK_CIPHER_H #include "Cipher.h" enum BLOCK_CIPHER_MODE { ECB_MODE, CBC_MODE }; class BlockCipher : public Cipher { public : BlockCipher(uint32_t bs, BLOCK_CIPHER_MODE m, uint8_t *iv = 0); virtual ~BlockCipher(); virtual CIPHER_TYPE getType() const; uint32_t getBlockSize() const; virtual void encrypt(uint8_t *out, uint8_t *in, uint32_t length); virtual void decrypt(uint8_t *out, uint8_t *in, uint32_t length); protected : virtual void encryptBlock(uint8_t *out, uint8_t *in) = 0; virtual void decryptBlock(uint8_t *out, uint8_t *in) = 0; private : uint32_t blockSize; BLOCK_CIPHER_MODE mode; uint8_t *IV; }; #endif