1
0
mirror of https://github.com/bitwarden/mobile synced 2026-01-03 09:03:35 +00:00

Merge branch 'feature/maui-migration' into feature/maui-migration-android-autofill

This commit is contained in:
Dinis Vieira
2023-12-14 22:00:06 +00:00
11 changed files with 41 additions and 26 deletions

View File

@@ -1,8 +1,7 @@
using Bit.Core.Abstractions;
using System.Runtime.InteropServices;
using Bit.Core.Abstractions;
using Bit.Core.Enums;
using Foundation;
using System;
using System.Runtime.InteropServices;
namespace Bit.iOS.Core.Services
{
@@ -48,8 +47,8 @@ namespace Bit.iOS.Core.Services
var passwordData = NSData.FromArray(password);
var saltData = NSData.FromArray(salt);
//argon2id_hash_raw(iterations, memory, parallelism, passwordData.Bytes, passwordData.Length,
// saltData.Bytes, saltData.Length, keyData.MutableBytes, keyData.Length);
argon2id_hash_raw(iterations, memory, parallelism, passwordData.Bytes, passwordData.Length,
saltData.Bytes, saltData.Length, keyData.MutableBytes, keyData.Length);
var keyBytes = new byte[keyData.Length];
Marshal.Copy(keyData.Bytes, keyBytes, 0, Convert.ToInt32(keyData.Length));
@@ -61,8 +60,8 @@ namespace Bit.iOS.Core.Services
private static extern int CCKeyCerivationPBKDF(uint algorithm, IntPtr password, nuint passwordLen,
IntPtr salt, nuint saltLen, uint prf, nuint rounds, IntPtr derivedKey, nuint derivedKeyLength);
//[DllImport("__Internal", EntryPoint = "argon2id_hash_raw")]
//private static extern int argon2id_hash_raw(int timeCost, int memoryCost, int parallelism, IntPtr pwd,
// nuint pwdlen, IntPtr salt, nuint saltlen, IntPtr hash, nuint hashlen);
[DllImport("__Internal", EntryPoint = "argon2id_hash_raw")]
private static extern int argon2id_hash_raw(int timeCost, int memoryCost, int parallelism, IntPtr pwd,
nuint pwdlen, IntPtr salt, nuint saltlen, IntPtr hash, nuint hashlen);
}
}