Пример #1
0
 /// <summary>
 /// Clone params
 /// </summary>
 /// <param name="parameters"></param>
 /// <returns></returns>
 public static AesParams Clone(this AesParams parameters)
 {
     if (parameters == null)
     {
         return(null);
     }
     return(new AesParams {
         K = parameters.K,
         T = parameters.T
     });
 }
Пример #2
0
 /// <summary>
 /// Compare params
 /// </summary>
 /// <param name="parameters"></param>
 /// <param name="other"></param>
 /// <returns></returns>
 public static bool SameAs(this AesParams parameters, AesParams other)
 {
     if (parameters == null)
     {
         return(other == null);
     }
     if (other == null)
     {
         return(false);
     }
     if (!KeyEx.SameNoLeadingZeros(other.K, parameters.K))
     {
         return(false);
     }
     if (!KeyEx.SameNoLeadingZeros(other.T, parameters.T))
     {
         return(false);
     }
     return(true);
 }
Пример #3
0
 /// <summary>
 /// Verifies whether this object has a private key
 /// </summary>
 /// <returns> True if the object has private key; false otherwise.</returns>
 public static bool HasPrivateKey(this AesParams key)
 {
     return(key.K != null);
 }