eucrypt_ch10_oaep... 1
eucrypt_ch10_oaep... 2
eucrypt_ch10_oaep... 3
eucrypt_ch10_oaep... 4
eucrypt_ch10_oaep... 5 with SMG_Keccak; use SMG_Keccak;
eucrypt_ch10_oaep... 6 with Interfaces; use Interfaces;
eucrypt_ch10_oaep... 7 with Interfaces.C; use Interfaces.C;
eucrypt_ch10_oaep... 8
eucrypt_ch10_oaep... 9 package SMG_OAEP is
eucrypt_ch10_oaep... 10 pragma Pure( SMG_OAEP );
eucrypt_ch10_oaep... 11
eucrypt_ch10_oaep... 12
eucrypt_ch10_oaep... 13 OAEP_LENGTH_BITS : constant := 4096;
eucrypt_ch10_oaep... 14 OAEP_LENGTH_OCTETS : constant := 512;
eucrypt_ch10_oaep... 15 OAEP_HALF_OCTETS : constant := OAEP_LENGTH_OCTETS / 2;
eucrypt_oaep_fix_... 16 TMSR : constant String := "TMSR-RSA";
eucrypt_oaep_fix_... 17 MAX_LEN_MSG : constant := OAEP_HALF_OCTETS - TMSR'Length - 3;
eucrypt_ch10_oaep... 18
eucrypt_ch10_oaep... 19
eucrypt_ch10_oaep... 20 subtype OAEP_Block is String( 1 .. OAEP_LENGTH_OCTETS );
eucrypt_ch10_oaep... 21 subtype OAEP_HALF is String( 1 .. OAEP_HALF_OCTETS );
eucrypt_ch10_oaep... 22
eucrypt_ch10_oaep... 23
eucrypt_ch10_oaep... 24
eucrypt_ch10_oaep... 25
eucrypt_ch10_oaep... 26
eucrypt_ch10_oaep... 27
eucrypt_ch10_oaep... 28
eucrypt_ch10_oaep... 29
eucrypt_ch10_oaep... 30
eucrypt_ch10_oaep... 31
eucrypt_ch10_oaep... 32
eucrypt_ch10_oaep... 33
eucrypt_oaep_fix_... 34
eucrypt_ch10_oaep... 35 procedure OAEP_Encrypt( Msg : in String;
eucrypt_ch10_oaep... 36 Entropy : in OAEP_Block;
eucrypt_ch10_oaep... 37 Output : out OAEP_Block);
eucrypt_ch10_oaep... 38
eucrypt_ch10_oaep... 39
eucrypt_ch10_oaep... 40
eucrypt_ch10_oaep... 41
eucrypt_ch10_oaep... 42
eucrypt_ch10_oaep... 43
eucrypt_ch10_oaep... 44
eucrypt_ch10_oaep... 45 procedure OAEP_Decrypt( Encr : in OAEP_Block;
eucrypt_ch10_oaep... 46 Len : out Natural;
eucrypt_ch10_oaep... 47 Output : out OAEP_HALF;
eucrypt_ch10_oaep... 48 Success : out Boolean);
eucrypt_ch10_oaep... 49
eucrypt_ch10_oaep... 50
eucrypt_ch10_oaep... 51
eucrypt_ch10_oaep... 52
eucrypt_ch10_oaep... 53 procedure XOR_Strings( S1: in String; S2: in String; Output: out String );
eucrypt_ch10_oaep... 54
eucrypt_ch10_oaep... 55
eucrypt_ch10_oaep... 56 function Shift_Right( Value : Unsigned_8;
eucrypt_ch10_oaep... 57 Amount : Natural )
eucrypt_ch10_oaep... 58 return Unsigned_8;
eucrypt_ch10_oaep... 59 pragma Import(Intrinsic, Shift_Right);
eucrypt_ch10_oaep... 60
eucrypt_ch10_oaep... 61 function Shift_Left( Value : Unsigned_8;
eucrypt_ch10_oaep... 62 Amount : Natural )
eucrypt_ch10_oaep... 63 return Unsigned_8;
eucrypt_ch10_oaep... 64 pragma Import(Intrinsic, Shift_Left);
eucrypt_ch10_oaep... 65
eucrypt_ch10_oaep... 66
eucrypt_ch10_oaep... 67
eucrypt_ch10_oaep... 68 procedure ToString( B: in Bitstream; S: out String );
eucrypt_ch10_oaep... 69 procedure ToBitstream( S: in String; B: out Bitstream );
eucrypt_ch10_oaep... 70
eucrypt_ch10_oaep... 71
eucrypt_ch10_oaep... 72 procedure HashKeccak( Input : in String;
eucrypt_ch10_oaep... 73 Output : out String;
eucrypt_ch10_oaep... 74 Block_Len : in Keccak_Rate := Default_Bitrate);
eucrypt_ch10_oaep... 75
eucrypt_ch10_oaep... 76
eucrypt_ch10_oaep... 77
eucrypt_ch10_oaep... 78
eucrypt_ch10_oaep... 79
eucrypt_ch10_oaep... 80
eucrypt_ch10_oaep... 81
eucrypt_ch10_oaep... 82
eucrypt_ch10_oaep... 83
eucrypt_ch10_oaep... 84
eucrypt_ch10_oaep... 85 function Hash( Input : Interfaces.C.Char_Array;
eucrypt_ch10_oaep... 86 LenIn : Interfaces.C.size_t;
eucrypt_ch10_oaep... 87 LenOut : Interfaces.C.size_t;
eucrypt_ch10_oaep... 88 Block_Len : Interfaces.C.int := Default_Bitrate)
eucrypt_ch10_oaep... 89 return Interfaces.C.Char_Array;
eucrypt_ch10_oaep... 90 pragma Export( C, Hash, "hash" );
eucrypt_ch10_oaep... 91
eucrypt_ch10_oaep... 92 end SMG_OAEP;