octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #55424] [octave forge](communications) rsdec()


From: Klaus Braun
Subject: [Octave-bug-tracker] [bug #55424] [octave forge](communications) rsdec() returns incorrect result if shortened message is used
Date: Tue, 8 Jan 2019 16:07:03 -0500 (EST)
User-agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:64.0) Gecko/20100101 Firefox/64.0

URL:
  <https://savannah.gnu.org/bugs/?55424>

                 Summary: [octave forge](communications) rsdec() returns
incorrect result if shortened message is used
                 Project: GNU Octave
            Submitted by: kmb721
            Submitted on: Tue 08 Jan 2019 09:07:02 PM UTC
                Category: Octave Forge Package
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Incorrect Result
                  Status: None
             Assigned to: None
         Originator Name: Klaus Braun
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 4.4.1
        Operating System: Microsoft Windows

    _______________________________________________________

Details:

communications *|   1.2.1 | 
rsdec() returns errors (in longer messages uncorrectable errors), when I use
shortened messages, i.e. the message is shorter than k.
In the following example (encode - decode) there should be of course no
error:

m = 3;           % Number of bits per symbol
n = 2^m - 1;     % Codeword length 
k = 5;           % Message length
sk = 3;   %shortened message length

msg = gf([2 7 3; 4 0 6],m);

code = rsenc(msg,n-k+sk,sk);

[msg2, nerr] = rsdec(code,n-k+sk,sk);
disp(nerr); # returns [1;1] (should be [0;0])


The same example but with full lenght message returns no error:

m = 3;           % Number of bits per symbol
n = 2^m - 1;     % Codeword length 
k = 5;           % Message length

msg = gf([0 0 2 7 3; 0 0 4 0 6],m);

code = rsenc(msg,n,k);

[msg2, nerr] = rsdec(code,n,k);
disp(nerr); # returns [0;0] (correct)


vague guess where the bug could hide:
in gf.cc (ca. line 1741 - 1773)
from:
 // Find a corresponding fcr and prim that coincide with the roots.
 to
  /* Find prim-th root of 1, used in decoding */
maybe "n" should be replaced by "nn"? (in several places).


---------
Another problem (maybe a following error):
If I use rsgenpoly(?,?,?,0) with zero as b-parameter, then octave crashes when
executing rsdec():

m = 3;           % Number of bits per symbol
n = 2^m - 1;     % Codeword length 
k = 5;           % Message length

msg = gf([0 0 2 7 3; 0 0 4 0 6],m);

p=11;
polynom = rsgenpoly(n, k, p, 0); # <- here zero

code = rsenc(msg,n,k);

[msg2, nerr] = rsdec(code,n,k,polynom); # crash

Octave crashes (disappears) or if I use poly also for rsenc, then rsdec()
executes very long/endless.
I am not really sure if b=0 is a useful input, but nevertheless octave should
never crash.





    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?55424>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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