This library implements some hash and cryptographic algorithms.
Dependents: ES_CW2_Starter_JIN EMBEDDED_CW2 EMBEDDED_CW2_Final Spinnybois ... more
Fork of Crypto by
cipher/StreamCipher.h@8:a090264e9b2d, 2013-09-14 (annotated)
- Committer:
- feb11
- Date:
- Sat Sep 14 20:54:59 2013 +0000
- Revision:
- 8:a090264e9b2d
refactored public API for ciphers & added TDES
Who changed what in which revision?
User | Revision | Line number | New 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 |