discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Discuss-gnuradio] oot module - deffie Hellman key exchange


From: Brandon Dunn
Subject: [Discuss-gnuradio] oot module - deffie Hellman key exchange
Date: Fri, 1 Dec 2017 21:05:18 +0000 (UTC)

Hello,

I am trying to create a oot module for gnuradio which performs Deffie Hellman key exchange with a finite cyclic group. The group i am using is Z10 which is addition modulus 10 both parties in this key exchange have the finite cyclic group. A transmitter Alice sends a number over a channel 4, Bob receives it then adds a number he has 5 to 0 the number of times Alice's number indicates 4. This new number 20 is then mod 10 and this is the key 2. Bob sends the number he was adding 5 to Alice and she adds to 0 her number 4, Bob's number 5 of times. This gives Alice 20 this is then mod 10 to give the key to Alice of 2. I have the following in tree blocks: receiver, rational resampler, qpsk demodulator, char to short. I am under the impression that this should give the short version of the number the radio receives. This short then goes into my OOT block and performs the above. The following is my code:

 my_deffieH_key_exchange_cb_impl::my_deffieH_key_exchange_cb_impl()
      : gr::block("my_deffieH_key_exchange_cb",
              gr::io_signature::make(1, 1, sizeof(short)),
              gr::io_signature::make(1, 1, sizeof(int)))
    {}

    /*
     * Our virtual destructor.
     */
    my_deffieH_key_exchange_cb_impl::~my_deffieH_key_exchange_cb_impl()
    {
    }
void
    my_deffieH_key_exchange_cb_impl::forecast (int noutput_items, gr_vector_int$
    {
      ninput_items_required[0] = noutput_items;
    }

    int
    my_deffieH_key_exchange_cb_impl::general_work (int noutput_items,
                       gr_vector_int &ninput_items,
                       gr_vector_const_void_star &input_items,
                       gr_vector_void_star &output_items)
    {
      const short *in = (const short *) input_items[0];
      int *out = (int *) output_items[0];

        /*char num = gr_char_to_float(*in);
        short num1 = gr_float_to_short(num);*/
        ina=in[0];
        int s=1;

 // Do <+signal processing+>
      // Tell runtime system how many input items we consumed on
      // each input stream.
      consume_each (noutput_items);

      // Tell runtime system how many output items we produced.
      return noutput_items;
    }

I got the block into gnuradio but it gives me the following error: 
    
Sink - in(0):
Type "raw" is not a possible type.

Any ideas what might be the problem? I also need to know how i could see the number result after all this works, is there a block that can do that?

Thank you very much,
Brandon

  

reply via email to

[Prev in Thread] Current Thread [Next in Thread]