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