Welcome to mirror list, hosted at ThFree Co, Russian Federation.

hmacsha1.cs « cryptography « security « system « mscorlib « referencesource « class « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 1d0b4e75d6bae02ea6401ad39c50084484ac0760 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// ==++==
// 
//   Copyright (c) Microsoft Corporation.  All rights reserved.
// 
// ==--==
// <OWNER>[....]</OWNER>
// 

//
// HMACSHA1.cs
//

namespace System.Security.Cryptography {
    [System.Runtime.InteropServices.ComVisible(true)]
    public class HMACSHA1 : HMAC {
        //
        // public constructors
        //

        public HMACSHA1 () : this (Utils.GenerateRandom(64)) {}

        public HMACSHA1 (byte[] key) : this (key, false) {}

        public HMACSHA1 (byte[] key, bool useManagedSha1) {
            m_hashName = "SHA1";
#if FEATURE_CRYPTO && !FULL_AOT_RUNTIME
            if (useManagedSha1) {
#endif // FEATURE_CRYPTO
                m_hash1 = new SHA1Managed();
                m_hash2 = new SHA1Managed();
#if FEATURE_CRYPTO && !FULL_AOT_RUNTIME
            } else {
                m_hash1 = new SHA1CryptoServiceProvider();
                m_hash2 = new SHA1CryptoServiceProvider();
            }
#endif // FEATURE_CRYPTO

            HashSizeValue = 160;
            base.InitializeKey(key);
        }
    }
}