blob: aa6e5ac520695d773d7e6acb49e8c3801b3d82c7 [file] [log] [blame]
ptrkrysik18b631e2014-12-15 09:09:18 +01001/* -*- c++ -*- */
Roman Khassrafc51f12b2015-07-17 15:18:10 +02002/*
Piotr Krysikea34c012016-10-02 18:53:43 +02003 * @file
Piotr Krysika6268a52017-08-23 16:02:19 +02004 * @author (C) 2014 by Piotr Krysik <ptrkrysik@gmail.com>
Piotr Krysikea34c012016-10-02 18:53:43 +02005 * @section LICENSE
Roman Khassrafc51f12b2015-07-17 15:18:10 +02006 *
Piotr Krysikea34c012016-10-02 18:53:43 +02007 * Gr-gsm is free software; you can redistribute it and/or modify
ptrkrysik18b631e2014-12-15 09:09:18 +01008 * 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 Khassrafc51f12b2015-07-17 15:18:10 +020011 *
Piotr Krysikea34c012016-10-02 18:53:43 +020012 * Gr-gsm is distributed in the hope that it will be useful,
ptrkrysik18b631e2014-12-15 09:09:18 +010013 * 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 Khassrafc51f12b2015-07-17 15:18:10 +020016 *
ptrkrysik18b631e2014-12-15 09:09:18 +010017 * You should have received a copy of the GNU General Public License
Piotr Krysikea34c012016-10-02 18:53:43 +020018 * along with gr-gsm; see the file COPYING. If not, write to
ptrkrysik18b631e2014-12-15 09:09:18 +010019 * 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>
ptrkrysik42411c62015-07-08 10:50:41 +020027#include <vector>
ptrkrysik18b631e2014-12-15 09:09:18 +010028
29namespace gr {
30 namespace gsm {
31
32 class decryption_impl : public decryption
33 {
34 private:
Roman Khassraf4dec5402015-07-17 18:32:22 +020035 std::vector<uint8_t> d_k_c;
36 bool d_k_c_valid;
37 uint8_t d_a5_version;
ptrkrysik18b631e2014-12-15 09:09:18 +010038 void decrypt(pmt::pmt_t msg);
Roman Khassraf4dec5402015-07-17 18:32:22 +020039 void validate_k_c();
ptrkrysik18b631e2014-12-15 09:09:18 +010040 public:
Roman Khassraf4dec5402015-07-17 18:32:22 +020041 decryption_impl(const std::vector<uint8_t> & k_c, unsigned int a5_version);
ptrkrysik18b631e2014-12-15 09:09:18 +010042 ~decryption_impl();
43 virtual void set_k_c(const std::vector<uint8_t> & k_c);
Roman Khassraf4dec5402015-07-17 18:32:22 +020044 virtual void set_a5_version(unsigned int a5_version);
ptrkrysik18b631e2014-12-15 09:09:18 +010045 };
46 } // namespace gsm
47} // namespace gr
48
49#endif /* INCLUDED_GSM_DECRYPTION_IMPL_H */
50