blob: 68fbb9c8615be2a9b69f32a324dfcaee950d7a05 [file] [log] [blame]
ptrkrysik18b631e2014-12-15 09:09:18 +01001/* -*- c++ -*- */
Roman Khassrafc51f12b2015-07-17 15:18:10 +02002/*
ptrkrysik18b631e2014-12-15 09:09:18 +01003 * Copyright 2014 <+YOU OR YOUR COMPANY+>.
Roman Khassrafc51f12b2015-07-17 15:18:10 +02004 *
ptrkrysik18b631e2014-12-15 09:09:18 +01005 * 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 Khassrafc51f12b2015-07-17 15:18:10 +02009 *
ptrkrysik18b631e2014-12-15 09:09:18 +010010 * 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 Khassrafc51f12b2015-07-17 15:18:10 +020014 *
ptrkrysik18b631e2014-12-15 09:09:18 +010015 * 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>
ptrkrysik42411c62015-07-08 10:50:41 +020025#include <vector>
ptrkrysik18b631e2014-12-15 09:09:18 +010026
27namespace gr {
28 namespace gsm {
29
30 class decryption_impl : public decryption
31 {
32 private:
Roman Khassraf4dec5402015-07-17 18:32:22 +020033 std::vector<uint8_t> d_k_c;
34 bool d_k_c_valid;
35 uint8_t d_a5_version;
ptrkrysik18b631e2014-12-15 09:09:18 +010036 void decrypt(pmt::pmt_t msg);
Roman Khassraf4dec5402015-07-17 18:32:22 +020037 void validate_k_c();
ptrkrysik18b631e2014-12-15 09:09:18 +010038 public:
Roman Khassraf4dec5402015-07-17 18:32:22 +020039 decryption_impl(const std::vector<uint8_t> & k_c, unsigned int a5_version);
ptrkrysik18b631e2014-12-15 09:09:18 +010040 ~decryption_impl();
41 virtual void set_k_c(const std::vector<uint8_t> & k_c);
Roman Khassraf4dec5402015-07-17 18:32:22 +020042 virtual void set_a5_version(unsigned int a5_version);
ptrkrysik18b631e2014-12-15 09:09:18 +010043 };
44 } // namespace gsm
45} // namespace gr
46
47#endif /* INCLUDED_GSM_DECRYPTION_IMPL_H */
48