Exemplo n.º 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));
     }
 }
Exemplo n.º 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));
                }
            }