Sha256: cc1ba30d52b5102bf5ca8e971a585f6b38bd3e1161ac5d24e86597dd0f775bb6
Contents?: true
Size: 921 Bytes
Versions: 19
Compression:
Stored size: 921 Bytes
Contents
/** * MACs * * An enumeration of MACs implemented for TLS 1.0/SSL 3.0 * Copyright (c) 2007 Henri Torgemane * * See LICENSE.txt for full license information. */ package com.hurlant.crypto.tls { import com.hurlant.crypto.Crypto; import com.hurlant.crypto.hash.HMAC; import com.hurlant.crypto.hash.MAC; public class MACs { public static const NULL:uint = 0; public static const MD5:uint = 1; public static const SHA1:uint = 2; public static function getHashSize(hash:uint):uint { return [0,16,20][hash]; } public static function getPadSize(hash:uint):int { return [0, 48, 40][hash]; } public static function getHMAC(hash:uint):HMAC { if (hash==NULL) return null; return Crypto.getHMAC(['',"md5","sha1"][hash]); } public static function getMAC(hash:uint):MAC { return Crypto.getMAC(['', "md5", "sha1"][hash]); } } }
Version data entries
19 entries across 19 versions & 4 rubygems