discuss-gnuradio
[Top][All Lists]
Advanced

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

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


From: Michael Dickens
Subject: Re: [Discuss-gnuradio] oot module - deffie Hellman key exchange
Date: Fri, 1 Dec 2017 19:20:10 -0500

Hi Brandon - You're a little light on the description of your problem. For example, is this during compilation or runtime? If the latter, are you using C++ or Python or GRC for your runtime scripting?

If I had to guess, I'd think this issue is popping up when you are using GRC (GNU Radio Companion), because the "raw" typename is typically specified in the GRC xml scripts to describe values that can't be classified by the standard types (e.g., real, float, complex, message, int, byte). 

If your block "does the right thing", then you can use a number sink to view its output.

There are very likely GR / GRC examples in various OOT GR modules that would provide similar material to what you require. I'd advise you to do a little searching through them & see what comes up.

Hope this helps! - MLD

On Fri, Dec 1, 2017 at 4:05 PM, Brandon Dunn <address@hidden> wrote:
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?

reply via email to

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