@@ -84,75 +84,85 @@ public static System.Security.Cryptography.RIPEMD160 CreateRIPEMD160()
8484 }
8585#endif // FEATURE_HASH_RIPEMD160
8686
87- public static System . Security . Cryptography . HMACMD5 CreateHMACMD5 ( byte [ ] key )
87+ public static HMAC CreateHMACMD5 ( byte [ ] key )
8888 {
8989#pragma warning disable CA5351 // Do not use broken cryptographic algorithms
90- return new System . Security . Cryptography . HMACMD5 ( key ) ;
90+ return new HMAC ( new System . Security . Cryptography . HMACMD5 ( key ) ) ;
9191#pragma warning restore CA5351 // Do not use broken cryptographic algorithms
9292 }
9393
94- public static HMACMD5 CreateHMACMD5 ( byte [ ] key , int hashSize )
94+ public static HMAC CreateHMACMD5 ( byte [ ] key , int hashSize )
9595 {
9696#pragma warning disable CA5351 // Do not use broken cryptographic algorithms
97- return new HMACMD5 ( key , hashSize ) ;
97+ return new HMAC ( new HMACMD5 ( key , hashSize ) ) ;
9898#pragma warning restore CA5351 // Do not use broken cryptographic algorithms
9999 }
100100
101- public static System . Security . Cryptography . HMACSHA1 CreateHMACSHA1 ( byte [ ] key )
101+ public static HMAC CreateHMACSHA1 ( byte [ ] key )
102102 {
103103#pragma warning disable CA5350 // Do not use weak cryptographic algorithms
104- return new System . Security . Cryptography . HMACSHA1 ( key ) ;
104+ return new HMAC ( new System . Security . Cryptography . HMACSHA1 ( key ) ) ;
105105#pragma warning restore CA5350 // Do not use weak cryptographic algorithms
106106 }
107107
108- public static HMACSHA1 CreateHMACSHA1 ( byte [ ] key , int hashSize )
108+ public static HMAC CreateHMACSHA1 ( byte [ ] key , int hashSize )
109109 {
110110#pragma warning disable CA5350 // Do not use weak cryptographic algorithms
111- return new HMACSHA1 ( key , hashSize ) ;
111+ return new HMAC ( new HMACSHA1 ( key , hashSize ) ) ;
112112#pragma warning restore CA5350 // Do not use weak cryptographic algorithms
113113 }
114114
115- public static System . Security . Cryptography . HMACSHA256 CreateHMACSHA256 ( byte [ ] key )
115+ public static HMAC CreateHMACSHA256 ( byte [ ] key )
116116 {
117- return new System . Security . Cryptography . HMACSHA256 ( key ) ;
117+ return new HMAC ( new System . Security . Cryptography . HMACSHA256 ( key ) ) ;
118118 }
119119
120- public static HMACSHA256 CreateHMACSHA256 ( byte [ ] key , int hashSize )
120+ public static HMAC CreateHMACSHA256 ( byte [ ] key , int hashSize )
121121 {
122- return new HMACSHA256 ( key , hashSize ) ;
122+ return new HMAC ( new HMACSHA256 ( key , hashSize ) ) ;
123123 }
124124
125- public static System . Security . Cryptography . HMACSHA384 CreateHMACSHA384 ( byte [ ] key )
125+ public static HMAC CreateHMACSHA256 ( byte [ ] key , bool etm )
126126 {
127- return new System . Security . Cryptography . HMACSHA384 ( key ) ;
127+ return new HMAC ( new System . Security . Cryptography . HMACSHA256 ( key ) , etm ) ;
128128 }
129129
130- public static HMACSHA384 CreateHMACSHA384 ( byte [ ] key , int hashSize )
130+ public static HMAC CreateHMACSHA384 ( byte [ ] key )
131131 {
132- return new HMACSHA384 ( key , hashSize ) ;
132+ return new HMAC ( new System . Security . Cryptography . HMACSHA384 ( key ) ) ;
133133 }
134134
135- public static System . Security . Cryptography . HMACSHA512 CreateHMACSHA512 ( byte [ ] key )
135+ public static HMAC CreateHMACSHA384 ( byte [ ] key , int hashSize )
136136 {
137- return new System . Security . Cryptography . HMACSHA512 ( key ) ;
137+ return new HMAC ( new HMACSHA384 ( key , hashSize ) ) ;
138138 }
139139
140- public static HMACSHA512 CreateHMACSHA512 ( byte [ ] key , int hashSize )
140+ public static HMAC CreateHMACSHA512 ( byte [ ] key )
141141 {
142- return new HMACSHA512 ( key , hashSize ) ;
142+ return new HMAC ( new System . Security . Cryptography . HMACSHA512 ( key ) ) ;
143+ }
144+
145+ public static HMAC CreateHMACSHA512 ( byte [ ] key , int hashSize )
146+ {
147+ return new HMAC ( new HMACSHA512 ( key , hashSize ) ) ;
148+ }
149+
150+ public static HMAC CreateHMACSHA512 ( byte [ ] key , bool etm )
151+ {
152+ return new HMAC ( new System . Security . Cryptography . HMACSHA512 ( key ) , etm ) ;
143153 }
144154
145155#if FEATURE_HMAC_RIPEMD160
146- public static System . Security . Cryptography . HMACRIPEMD160 CreateHMACRIPEMD160 ( byte [ ] key )
156+ public static HMAC CreateHMACRIPEMD160 ( byte [ ] key )
147157 {
148158#pragma warning disable CA5350 // Do not use weak cryptographic algorithms
149- return new System . Security . Cryptography . HMACRIPEMD160 ( key ) ;
159+ return new HMAC ( new System . Security . Cryptography . HMACRIPEMD160 ( key ) ) ;
150160#pragma warning restore CA5350 // Do not use weak cryptographic algorithms
151161 }
152162#else
153- public static global :: SshNet . Security . Cryptography . HMACRIPEMD160 CreateHMACRIPEMD160 ( byte [ ] key )
163+ public static HMAC CreateHMACRIPEMD160 ( byte [ ] key )
154164 {
155- return new global ::SshNet . Security . Cryptography . HMACRIPEMD160 ( key ) ;
165+ return new HMAC ( new global ::SshNet . Security . Cryptography . HMACRIPEMD160 ( key ) ) ;
156166 }
157167#endif // FEATURE_HMAC_RIPEMD160
158168 }
0 commit comments