Bug:Fix file validation issue
[vnfsdk/refrepo.git] / vnfmarket / src / main / webapp / vnfmarket / node_modules / socket.io-client / lib / vendor / web-socket-js / flash-src / com / hurlant / crypto / tls / MACs.as
1 /**\r
2  * MACs\r
3  * \r
4  * An enumeration of MACs implemented for TLS 1.0/SSL 3.0\r
5  * Copyright (c) 2007 Henri Torgemane\r
6  * \r
7  * See LICENSE.txt for full license information.\r
8  */\r
9 package com.hurlant.crypto.tls {\r
10         import com.hurlant.crypto.Crypto;\r
11         import com.hurlant.crypto.hash.HMAC;\r
12         import com.hurlant.crypto.hash.MAC;\r
13         \r
14         public class MACs {\r
15                 public static const NULL:uint = 0;\r
16                 public static const MD5:uint = 1;\r
17                 public static const SHA1:uint = 2;\r
18                 \r
19                 public static function getHashSize(hash:uint):uint {\r
20                         return [0,16,20][hash];\r
21                 }       \r
22                 \r
23                 public static function getPadSize(hash:uint):int {\r
24                         return [0, 48, 40][hash];\r
25                 }       \r
26                 \r
27                 public static function getHMAC(hash:uint):HMAC {\r
28                         if (hash==NULL) return null;\r
29                         return Crypto.getHMAC(['',"md5","sha1"][hash]);\r
30                 }\r
31         \r
32                 public static function getMAC(hash:uint):MAC {\r
33                         return Crypto.getMAC(['', "md5", "sha1"][hash]);\r
34                 } \r
35                 \r
36                 \r
37         }\r
38 }