Arcane  v3.14.10.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
SHA3HashAlgorithm.h
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2023 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
4// See the top-level COPYRIGHT file for details.
5// SPDX-License-Identifier: Apache-2.0
6//-----------------------------------------------------------------------------
7/*---------------------------------------------------------------------------*/
8/* SHA3HashAlgorithm.h (C) 2000-2023 */
9/* */
10/* Calcule la fonction de hashage SHA-3 (224, 256, 384 ou 512). */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_UTILS_SHA3HASHALGORITHM_H
13#define ARCANE_UTILS_SHA3HASHALGORITHM_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arcane/utils/IHashAlgorithm.h"
18#include "arcane/utils/String.h"
19
20/*---------------------------------------------------------------------------*/
21/*---------------------------------------------------------------------------*/
22
23namespace Arcane::SHA3Algorithm
24{
25class SHA3;
26}
27
28namespace Arcane
29{
30
31/*---------------------------------------------------------------------------*/
32/*---------------------------------------------------------------------------*/
36class ARCANE_UTILS_EXPORT SHA3HashAlgorithm
37: public IHashAlgorithm
38{
39 public:
40
41 void computeHash(ByteConstArrayView input, ByteArray& output) final;
42 void computeHash64(Span<const Byte> input, ByteArray& output) final;
43 void computeHash64(Span<const std::byte> input, ByteArray& output) final;
44
45 protected:
46
47 virtual void _initialize(SHA3Algorithm::SHA3&) = 0;
48
49 private:
50
51 void _computeHash64(Span<const std::byte> input, ByteArray& output);
52};
53
54/*---------------------------------------------------------------------------*/
55/*---------------------------------------------------------------------------*/
57class ARCANE_UTILS_EXPORT SHA3_256HashAlgorithm
58: public SHA3HashAlgorithm
59{
60 public:
61
62 String name() const override { return "SHA3_256"; }
63 Int32 hashSize() const override { return 32; }
64
65 protected:
66
67 void _initialize(SHA3Algorithm::SHA3&) override;
68};
69
70/*---------------------------------------------------------------------------*/
71/*---------------------------------------------------------------------------*/
73class ARCANE_UTILS_EXPORT SHA3_224HashAlgorithm
74: public SHA3HashAlgorithm
75{
76 public:
77
78 String name() const override { return "SHA3_224"; }
79 Int32 hashSize() const override { return 28; }
80
81 protected:
82
83 void _initialize(SHA3Algorithm::SHA3&) override;
84};
85
86/*---------------------------------------------------------------------------*/
87/*---------------------------------------------------------------------------*/
89class ARCANE_UTILS_EXPORT SHA3_384HashAlgorithm
90: public SHA3HashAlgorithm
91{
92 public:
93
94 String name() const override { return "SHA3_384"; }
95 Int32 hashSize() const override { return 48; }
96
97 protected:
98
99 void _initialize(SHA3Algorithm::SHA3&) override;
100};
101
102/*---------------------------------------------------------------------------*/
103/*---------------------------------------------------------------------------*/
105class ARCANE_UTILS_EXPORT SHA3_512HashAlgorithm
106: public SHA3HashAlgorithm
107{
108 public:
109
110 String name() const override { return "SHA3_512"; }
111 Int32 hashSize() const override { return 64; }
112
113 protected:
114
115 void _initialize(SHA3Algorithm::SHA3&) override;
116};
117
118/*---------------------------------------------------------------------------*/
119/*---------------------------------------------------------------------------*/
120
121} // namespace Arcane
122
123/*---------------------------------------------------------------------------*/
124/*---------------------------------------------------------------------------*/
125
126#endif
Tableau d'items de types quelconques.
Interface d'un algorithme de hashage.
Lecteur des fichiers de maillage via la bibliothèque LIMA.
Definition Lima.cc:120
Classe de base des algorithmes SHA-3.
Hash pour l'algorithme SHA-3 224.
String name() const override
Nom de l'algorithme.
Int32 hashSize() const override
Taille (en octet) de la clé de hash.
Hash pour l'algorithme SHA-3 256.
Int32 hashSize() const override
Taille (en octet) de la clé de hash.
String name() const override
Nom de l'algorithme.
Hash pour l'algorithme SHA-3 384.
String name() const override
Nom de l'algorithme.
Int32 hashSize() const override
Taille (en octet) de la clé de hash.
Hash pour l'algorithme SHA-3 512.
Int32 hashSize() const override
Taille (en octet) de la clé de hash.
String name() const override
Nom de l'algorithme.
Vue constante d'un tableau de type T.
Chaîne de caractères unicode.
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-