ptrkrysik | 18b631e | 2014-12-15 09:09:18 +0100 | [diff] [blame] | 1 | /* -*- c++ -*- */ |
Roman Khassraf | c51f12b | 2015-07-17 15:18:10 +0200 | [diff] [blame] | 2 | /* |
Piotr Krysik | ea34c01 | 2016-10-02 18:53:43 +0200 | [diff] [blame] | 3 | * @file |
Piotr Krysik | a6268a5 | 2017-08-23 16:02:19 +0200 | [diff] [blame] | 4 | * @author (C) 2014 by Piotr Krysik <ptrkrysik@gmail.com> |
Piotr Krysik | ea34c01 | 2016-10-02 18:53:43 +0200 | [diff] [blame] | 5 | * @section LICENSE |
Roman Khassraf | c51f12b | 2015-07-17 15:18:10 +0200 | [diff] [blame] | 6 | * |
Piotr Krysik | ea34c01 | 2016-10-02 18:53:43 +0200 | [diff] [blame] | 7 | * Gr-gsm is free software; you can redistribute it and/or modify |
ptrkrysik | 18b631e | 2014-12-15 09:09:18 +0100 | [diff] [blame] | 8 | * it under the terms of the GNU General Public License as published by |
| 9 | * the Free Software Foundation; either version 3, or (at your option) |
| 10 | * any later version. |
Roman Khassraf | c51f12b | 2015-07-17 15:18:10 +0200 | [diff] [blame] | 11 | * |
Piotr Krysik | ea34c01 | 2016-10-02 18:53:43 +0200 | [diff] [blame] | 12 | * Gr-gsm is distributed in the hope that it will be useful, |
ptrkrysik | 18b631e | 2014-12-15 09:09:18 +0100 | [diff] [blame] | 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 | * GNU General Public License for more details. |
Roman Khassraf | c51f12b | 2015-07-17 15:18:10 +0200 | [diff] [blame] | 16 | * |
ptrkrysik | 18b631e | 2014-12-15 09:09:18 +0100 | [diff] [blame] | 17 | * You should have received a copy of the GNU General Public License |
Piotr Krysik | ea34c01 | 2016-10-02 18:53:43 +0200 | [diff] [blame] | 18 | * along with gr-gsm; see the file COPYING. If not, write to |
ptrkrysik | 18b631e | 2014-12-15 09:09:18 +0100 | [diff] [blame] | 19 | * the Free Software Foundation, Inc., 51 Franklin Street, |
| 20 | * Boston, MA 02110-1301, USA. |
| 21 | */ |
| 22 | |
| 23 | #ifndef INCLUDED_GSM_DECRYPTION_IMPL_H |
| 24 | #define INCLUDED_GSM_DECRYPTION_IMPL_H |
| 25 | |
| 26 | #include <grgsm/decryption/decryption.h> |
ptrkrysik | 42411c6 | 2015-07-08 10:50:41 +0200 | [diff] [blame] | 27 | #include <vector> |
ptrkrysik | 18b631e | 2014-12-15 09:09:18 +0100 | [diff] [blame] | 28 | |
| 29 | namespace gr { |
| 30 | namespace gsm { |
| 31 | |
| 32 | class decryption_impl : public decryption |
| 33 | { |
| 34 | private: |
Roman Khassraf | 4dec540 | 2015-07-17 18:32:22 +0200 | [diff] [blame] | 35 | std::vector<uint8_t> d_k_c; |
| 36 | bool d_k_c_valid; |
| 37 | uint8_t d_a5_version; |
ptrkrysik | 18b631e | 2014-12-15 09:09:18 +0100 | [diff] [blame] | 38 | void decrypt(pmt::pmt_t msg); |
Roman Khassraf | 4dec540 | 2015-07-17 18:32:22 +0200 | [diff] [blame] | 39 | void validate_k_c(); |
ptrkrysik | 18b631e | 2014-12-15 09:09:18 +0100 | [diff] [blame] | 40 | public: |
Roman Khassraf | 4dec540 | 2015-07-17 18:32:22 +0200 | [diff] [blame] | 41 | decryption_impl(const std::vector<uint8_t> & k_c, unsigned int a5_version); |
ptrkrysik | 18b631e | 2014-12-15 09:09:18 +0100 | [diff] [blame] | 42 | ~decryption_impl(); |
| 43 | virtual void set_k_c(const std::vector<uint8_t> & k_c); |
Roman Khassraf | 4dec540 | 2015-07-17 18:32:22 +0200 | [diff] [blame] | 44 | virtual void set_a5_version(unsigned int a5_version); |
ptrkrysik | 18b631e | 2014-12-15 09:09:18 +0100 | [diff] [blame] | 45 | }; |
| 46 | } // namespace gsm |
| 47 | } // namespace gr |
| 48 | |
| 49 | #endif /* INCLUDED_GSM_DECRYPTION_IMPL_H */ |
| 50 | |