Finite Field Arithmetic

fz_bitop.ads


   1 ------------------------------------------------------------------------------
   2 ------------------------------------------------------------------------------
   3 -- This file is part of 'Finite Field Arithmetic', aka 'FFA'.               --
   4 --                                                                          --
   5 -- (C) 2019 Stanislav Datskovskiy ( www.loper-os.org )                      --
   6 -- http://wot.deedbot.org/17215D118B7239507FAFED98B98228A001ABFFC7.html     --
   7 --                                                                          --
   8 -- You do not have, nor can you ever acquire the right to use, copy or      --
   9 -- distribute this software ; Should you use this software for any purpose, --
  10 -- or copy and distribute it to anyone or in any manner, you are breaking   --
  11 -- the laws of whatever soi-disant jurisdiction, and you promise to         --
  12 -- continue doing so for the indefinite future. In any case, please         --
  13 -- always : read and understand any software ; verify any PGP signatures    --
  14 -- that you use - for any purpose.                                          --
  15 --                                                                          --
  16 -- See also http://trilema.com/2015/a-new-software-licensing-paradigm .     --
  17 ------------------------------------------------------------------------------
  18 ------------------------------------------------------------------------------
  19 
  20 with FZ_Type; use FZ_Type;
  21 with Words; use Words;
  22 
  23 
  24 package FZ_BitOp is
  25    
  26    pragma Pure;
  27    
  28    -- Result := X & Y
  29    procedure FZ_And(X : in FZ; Y : in FZ; Result : out FZ);
  30    pragma Inline_Always(FZ_And);
  31    
  32    -- N := N & W, W is a word
  33    procedure FZ_And_W(N : in out FZ; W : in Word);
  34    pragma Inline_Always(FZ_And_W);
  35    
  36    -- Result := X | Y
  37    procedure FZ_Or(X : in FZ; Y : in FZ; Result : out FZ);
  38    pragma Inline_Always(FZ_Or);
  39    
  40    -- N := N | W, W is a word
  41    procedure FZ_Or_W(N : in out FZ; W : in Word);
  42    pragma Inline_Always(FZ_Or_W);
  43    
  44    -- Result := X ^ Y
  45    procedure FZ_Xor(X : in FZ; Y : in FZ; Result : out FZ);
  46    pragma Inline_Always(FZ_Xor);
  47    
  48    -- N := N ^ W, W is a word
  49    procedure FZ_Xor_W(N : in out FZ; W : in Word);
  50    pragma Inline_Always(FZ_Xor_W);
  51    
  52    -- NotN := ~N
  53    procedure FZ_Not(N : in FZ; NotN : out FZ);
  54    pragma Inline_Always(FZ_Not);
  55    
  56 end FZ_BitOp;