示例#1
0
 public static IHMAC CreateHMAC(IHash a_hash)
 {
     if (a_hash is IHMAC)
     {
         return((IHMAC)a_hash);
     }
     else if (a_hash is IHasHMACBuildIn)
     {
         IHasHMACBuildIn h = (IHasHMACBuildIn)a_hash;
         return(new HMACBuildInAdapter(h.GetBuildHMAC(), h.BlockSize));
     }
     else
     {
         return(new HMACNotBuildInAdapter(a_hash));
     }
 }
示例#2
0
            public static IHMAC CreateHmac(IHash aHash)
            {
                if (aHash is IHMAC)
                {
                    return((IHMAC)aHash);
                }
#if !USEBC
                else if (aHash is IHasHMACBuildIn)
                {
                    IHasHMACBuildIn h = (IHasHMACBuildIn)aHash;
                    return(new HMACBuildInAdapter(h.GetBuildHMAC(), h.BlockSize));
                }
#endif
                else
                {
                    return(new HMACNotBuildInAdapter(aHash));
                }
            }