steelcrypt/src/algorithms/sha2/sha2_384_spec.ads

45 lines
1.5 KiB
Ada
Raw Normal View History

2015-07-01 22:23:31 +00:00
-- Copyright (C) 2015 Daniel Otte <bg@nerilex.org>
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
2015-09-19 18:07:46 +00:00
with Crypto_Core_Types; use Crypto_Core_Types;
with Crypto_Types; use Crypto_Types;
with Sha2_Large;
2015-07-01 22:23:31 +00:00
2015-09-19 18:07:46 +00:00
use Crypto_Types.Crypto_Utils_u8;
use Crypto_Types.Crypto_Utils_u64;
2015-07-01 22:23:31 +00:00
2015-09-19 18:07:46 +00:00
package SHA2_384_Spec is
2015-07-01 22:23:31 +00:00
2015-09-19 18:07:46 +00:00
Name : constant String := "SHA2-384";
2015-07-01 22:23:31 +00:00
2015-09-19 18:07:46 +00:00
type Context_T is private;
2015-07-01 22:23:31 +00:00
2015-09-19 18:07:46 +00:00
Block_Size_Bits : constant := 1024;
Digest_Size_Bits : constant := 384;
2015-07-01 22:23:31 +00:00
2015-09-19 18:07:46 +00:00
Block_Size_Bytes : constant := (Block_Size_Bits) / 8;
Digest_Size_Bytes : constant := (Digest_Size_Bits) / 8;
2015-07-01 22:23:31 +00:00
2015-09-19 18:07:46 +00:00
procedure Initialize(Context : out Context_T);
procedure Next_Block(Context : in out Context_T; Block : in Block_1024_Bit);
procedure Last_Block(Context : in out Context_T; Block : in u8_Array; Bits : in Integer := -1);
procedure Get_Digest(Context : in out Context_T; Digest : out Block_384_Bit);
2015-07-01 22:23:31 +00:00
2015-09-19 18:07:46 +00:00
private
2015-07-01 22:23:31 +00:00
2015-09-19 18:07:46 +00:00
type Context_T is new Sha2_Large.Context_T;
2015-07-01 22:23:31 +00:00
2015-09-19 18:07:46 +00:00
end SHA2_384_Spec;