smg_comms_rsa_oaep 1
smg_comms_rsa_oaep 2
smg_comms_rsa_oaep 3
smg_comms_rsa_oaep 4
smg_comms_rsa_oaep 5
smg_comms_rsa_oaep 6 with Keccak;
smg_comms_rsa_oaep 7 with Raw_Types;
smg_comms_rsa_oaep 8
smg_comms_rsa_oaep 9 with Interfaces; use Interfaces;
smg_comms_rsa_oaep 10
smg_comms_rsa_oaep 11 package OAEP is
smg_comms_rsa_oaep 12 pragma Pure( OAEP );
smg_comms_rsa_oaep 13
smg_comms_rsa_oaep 14
smg_comms_rsa_oaep 15 OAEP_LENGTH_OCTETS : constant := Raw_Types.RSA_KEY_OCTETS;
smg_comms_rsa_oaep 16 OAEP_LENGTH_BITS : constant := OAEP_LENGTH_OCTETS * 8;
smg_comms_rsa_oaep 17 OAEP_HALF_OCTETS : constant := OAEP_LENGTH_OCTETS / 2;
smg_comms_rsa_oaep 18 TMSR_STR : constant String := "TMSR-RSA";
smg_comms_rsa_oaep 19
smg_comms_rsa_oaep 20 TMSR : constant Raw_Types.Octets := (84,77,83,82,45,82,83,65);
smg_comms_rsa_oaep 21 MAX_LEN_MSG : constant Natural := OAEP_HALF_OCTETS -
smg_comms_rsa_oaep 22 TMSR_STR'Length - 3;
smg_comms_rsa_oaep 23
smg_comms_rsa_oaep 24
smg_comms_rsa_oaep 25 subtype OAEP_Block is Raw_Types.Octets( 1 .. OAEP_LENGTH_OCTETS );
smg_comms_rsa_oaep 26 subtype OAEP_HALF is Raw_Types.Octets( 1 .. OAEP_HALF_OCTETS );
smg_comms_rsa_oaep 27
smg_comms_rsa_oaep 28
smg_comms_rsa_oaep 29
smg_comms_rsa_oaep 30
smg_comms_rsa_oaep 31
smg_comms_rsa_oaep 32
smg_comms_rsa_oaep 33
smg_comms_rsa_oaep 34
smg_comms_rsa_oaep 35
smg_comms_rsa_oaep 36
smg_comms_rsa_oaep 37
smg_comms_rsa_oaep 38
smg_comms_rsa_oaep 39
smg_comms_rsa_oaep 40 procedure OAEP_Encrypt( Msg : in Raw_Types.Octets;
smg_comms_rsa_oaep 41 Entropy : in OAEP_Block;
smg_comms_rsa_oaep 42 Output : out OAEP_Block);
smg_comms_rsa_oaep 43
smg_comms_rsa_oaep 44
smg_comms_rsa_oaep 45
smg_comms_rsa_oaep 46
smg_comms_rsa_oaep 47
smg_comms_rsa_oaep 48
smg_comms_rsa_oaep 49
smg_comms_rsa_oaep 50
smg_comms_rsa_oaep 51 procedure OAEP_Decrypt( Encr : in OAEP_Block;
smg_comms_rsa_oaep 52 Len : out Natural;
smg_comms_rsa_oaep 53 Output : out OAEP_HALF;
smg_comms_rsa_oaep 54 Success : out Boolean);
smg_comms_rsa_oaep 55
smg_comms_rsa_oaep 56 private
smg_comms_rsa_oaep 57
smg_comms_rsa_oaep 58 function Shift_Right( Value : Unsigned_8;
smg_comms_rsa_oaep 59 Amount : Natural )
smg_comms_rsa_oaep 60 return Unsigned_8;
smg_comms_rsa_oaep 61 pragma Import(Intrinsic, Shift_Right);
smg_comms_rsa_oaep 62
smg_comms_rsa_oaep 63 function Shift_Left( Value : Unsigned_8;
smg_comms_rsa_oaep 64 Amount : Natural )
smg_comms_rsa_oaep 65 return Unsigned_8;
smg_comms_rsa_oaep 66 pragma Import(Intrinsic, Shift_Left);
smg_comms_rsa_oaep 67
smg_comms_rsa_oaep 68
smg_comms_rsa_oaep 69 function XOR_Octets(A : in OAEP_HALF;
smg_comms_rsa_oaep 70 B : in OAEP_HALF)
smg_comms_rsa_oaep 71 return OAEP_HALF;
smg_comms_rsa_oaep 72
smg_comms_rsa_oaep 73
smg_comms_rsa_oaep 74
smg_comms_rsa_oaep 75 procedure ToOctets ( B : in Keccak.Bitstream;
smg_comms_rsa_oaep 76 O : out Raw_Types.Octets );
smg_comms_rsa_oaep 77
smg_comms_rsa_oaep 78 procedure ToBitstream( O : in Raw_Types.Octets;
smg_comms_rsa_oaep 79 B : out Keccak.Bitstream );
smg_comms_rsa_oaep 80
smg_comms_rsa_oaep 81
smg_comms_rsa_oaep 82 procedure HashKeccak( Input : in Raw_Types.Octets;
smg_comms_rsa_oaep 83 Output : out Raw_Types.Octets;
smg_comms_rsa_oaep 84 Block_Len : in Keccak.Keccak_Rate :=
smg_comms_rsa_oaep 85 Keccak.Default_Bitrate);
smg_comms_rsa_oaep 86
smg_comms_rsa_oaep 87 end OAEP;