You've already forked linux-packaging-mono
Imported Upstream version 4.8.0.309
Former-commit-id: 5f9c6ae75f295e057a7d2971f3a6df4656fa8850
This commit is contained in:
parent
ee1447783b
commit
94b2861243
@ -14,7 +14,7 @@ namespace Xamarin {
|
||||
|
||||
public static class CommonCryptor {
|
||||
|
||||
static public void Generate (string namespaceName, string typeName, string baseTypeName, string ccAlgorithmName, string feedbackSize = "8", string ctorInitializers = null)
|
||||
static public void Generate (string namespaceName, string typeName, string baseTypeName, string ccAlgorithmName, string feedbackSize = "8", string ctorInitializers = null, string decryptorInitializers = null, string encryptorInitializers = null, string properties = null)
|
||||
{
|
||||
string template = @"// Generated file to bind CommonCrypto cipher algorithms - DO NOT EDIT
|
||||
//
|
||||
@ -38,7 +38,9 @@ namespace %NAMESPACE% {
|
||||
FeedbackSizeValue = %FEEDBACKSIZE%;
|
||||
%CTOR_INIT%
|
||||
}
|
||||
|
||||
|
||||
%PROPERTIES%
|
||||
|
||||
public override void GenerateIV ()
|
||||
{
|
||||
IVValue = KeyBuilder.IV (BlockSizeValue >> 3);
|
||||
@ -51,6 +53,8 @@ namespace %NAMESPACE% {
|
||||
|
||||
public override ICryptoTransform CreateDecryptor (byte[] rgbKey, byte[] rgbIV)
|
||||
{
|
||||
%CREATEDECRYPTOR_INIT%
|
||||
|
||||
IntPtr decryptor = IntPtr.Zero;
|
||||
switch (Mode) {
|
||||
case CipherMode.CBC:
|
||||
@ -74,6 +78,8 @@ namespace %NAMESPACE% {
|
||||
|
||||
public override ICryptoTransform CreateEncryptor (byte[] rgbKey, byte[] rgbIV)
|
||||
{
|
||||
%CREATEENCRYPTOR_INIT%
|
||||
|
||||
IntPtr encryptor = IntPtr.Zero;
|
||||
switch (Mode) {
|
||||
case CipherMode.CBC:
|
||||
@ -98,6 +104,9 @@ namespace %NAMESPACE% {
|
||||
|
||||
File.WriteAllText (typeName + ".g.cs", template.Replace ("%NAMESPACE%", namespaceName).
|
||||
Replace ("%TYPE%", typeName).Replace ("%BASE%", baseTypeName).Replace("%FEEDBACKSIZE%", feedbackSize).Replace ("%CTOR_INIT%", ctorInitializers).
|
||||
Replace ("%CREATEDECRYPTOR_INIT%", decryptorInitializers).
|
||||
Replace ("%CREATEENCRYPTOR_INIT%", encryptorInitializers).
|
||||
Replace ("%PROPERTIES%", properties).
|
||||
Replace ("%CCALGORITHM%", ccAlgorithmName.ToString ()));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user