public static IMac getInstance(String name) {
      if (name == null) {
         return null;
      }

      name = name.trim();
      name = name.toLowerCase();
      if (name.startsWith(HMAC_NAME_PREFIX)) {
         return HMacFactory.getInstance(name);
      }

      IMac result = null;
      if (name.equalsIgnoreCase(UHASH32)) {
         result = new UHash32();
      } else if (name.equalsIgnoreCase(UMAC32)) {
         result = new UMac32();
      } else if (name.equalsIgnoreCase(TMMH16)) {
         result = new TMMH16();
      }
//      else if (name.equalsIgnoreCase(TMMH32)) {
//         result = new TMMH32();
//      }

      if (result != null && !result.selfTest()) {
         throw new InternalError(result.name());
      }

      return result;
   }