Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
cetlib
cetlib
test
sha1.h
Go to the documentation of this file.
1
/*
2
* sha1.h
3
*
4
* Copyright (C) 1998, 2009
5
* Paul E. Jones <paulej@packetizer.com>
6
* All Rights Reserved.
7
*
8
*****************************************************************************
9
* $Id: sha1.h 12 2009-06-22 19:34:25Z paulej $
10
*****************************************************************************
11
*
12
* Description:
13
* This class implements the Secure Hashing Standard as defined
14
* in FIPS PUB 180-1 published April 17, 1995.
15
*
16
* Many of the variable names in this class, especially the single
17
* character names, were used because those were the names used
18
* in the publication.
19
*
20
* Please read the file sha1.cpp for more information.
21
*
22
*/
23
24
#ifndef cetlib_test_sha1_h
25
#define cetlib_test_sha1_h
26
27
namespace
fhicl
{
28
29
class
SHA1
{
30
31
public
:
32
SHA1
();
33
34
/*
35
* Re-initialize the class
36
*/
37
void
Reset
();
38
39
/*
40
* Returns the message digest
41
*/
42
bool
Result
(
unsigned
* message_digest_array);
43
44
/*
45
* Provide input to SHA1
46
*/
47
void
Input
(
const
unsigned
char
* message_array,
unsigned
length);
48
void
Input
(
const
char
* message_array,
unsigned
length);
49
void
Input
(
unsigned
char
message_element);
50
void
Input
(
char
message_element);
51
SHA1
&
operator<<
(
const
char
* message_array);
52
SHA1
&
operator<<
(
const
unsigned
char
* message_array);
53
SHA1
&
operator<<
(
const
char
message_element);
54
SHA1
&
operator<<
(
const
unsigned
char
message_element);
55
56
private
:
57
/*
58
* Process the next 512 bits of the message
59
*/
60
void
ProcessMessageBlock
();
61
62
/*
63
* Pads the current message block to 512 bits
64
*/
65
void
PadMessage
();
66
67
/*
68
* Performs a circular left shift operation
69
*/
70
inline
unsigned
CircularShift
(
int
bits,
unsigned
word
);
71
72
unsigned
H
[5];
// Message digest buffers
73
74
unsigned
Length_Low
;
// Message length in bits
75
unsigned
Length_High
;
// Message length in bits
76
77
unsigned
char
Message_Block
[64];
// 512-bit message blocks
78
int
Message_Block_Index
;
// Index into message block array
79
80
bool
Computed
;
// Is the digest computed?
81
bool
Corrupted
;
// Is the message digest corruped?
82
};
83
84
}
// end of namespace mf
85
86
#endif
/* cetlib_test_sha1_h */
87
88
// Local Variables:
89
// mode: c++
90
// End:
fhicl::SHA1::Length_Low
unsigned Length_Low
Definition:
sha1.h:74
fhicl::SHA1::Length_High
unsigned Length_High
Definition:
sha1.h:75
fhicl::SHA1::Message_Block_Index
int Message_Block_Index
Definition:
sha1.h:78
fhicl::SHA1::Reset
void Reset()
Definition:
sha1.cpp:78
fhicl::SHA1::Message_Block
unsigned char Message_Block[64]
Definition:
sha1.h:77
fhicl::SHA1::H
unsigned H[5]
Definition:
sha1.h:72
fhicl::SHA1::PadMessage
void PadMessage()
Definition:
sha1.cpp:490
fhicl::SHA1
Definition:
sha1.h:29
fhicl::SHA1::CircularShift
unsigned CircularShift(int bits, unsigned word)
Definition:
sha1.cpp:549
fhicl::SHA1::Computed
bool Computed
Definition:
sha1.h:80
fhicl
Definition:
InputSourceFactory.h:7
fhicl::SHA1::Corrupted
bool Corrupted
Definition:
sha1.h:81
fhicl::SHA1::SHA1
SHA1()
Definition:
sha1.cpp:59
fhicl::SHA1::Input
void Input(const unsigned char *message_array, unsigned length)
Definition:
sha1.cpp:152
fhicl::SHA1::Result
bool Result(unsigned *message_digest_array)
Definition:
sha1.cpp:113
fhicl::SHA1::ProcessMessageBlock
void ProcessMessageBlock()
Definition:
sha1.cpp:386
fhicl::SHA1::operator<<
SHA1 & operator<<(const char *message_array)
Definition:
sha1.cpp:273
ptb::content::word::word
union ptb::content::word::word word
Generated by
1.8.11