Comments (7)
from isopoh.cryptography.argon2.
How about making it injectable:
- Declare an interface ISecureArray with the public methods of SecureArray
- Add a constructor for the Argon2 class that takes an Func<int,ISecureArray> factory function as an argument.
- Have the default constructor pass BestSecuryArray as the factory function.
That way, uses can replace SecureArray with their own implementation if there are issues on a particular platform, and you can inject a mock array in test functions if that helps.
from isopoh.cryptography.argon2.
from isopoh.cryptography.argon2.
I have added a SecureArrayCall class that holds the methods used by SecureArray to actually secure the array.
There is a SecureArray.DefaultCall property that will get populated with the basic calls for Windows/Linux/OSx. In a unit test, I create a SecureArrayCall that wraps calls in SecureArray.DefaultCall to track locks (and I found a situation where I didn't free a lock - fixed in 1.0.5).
The Argon2 calls (should) now all have an optional parameter so they can use a non-default SecureArrayCall to get non-default behavior.
from isopoh.cryptography.argon2.
Same message here:
Managed Debugging Assistant 'PInvokeStackImbalance' : 'A call to PInvoke function 'Isopoh.Cryptography.SecureArray!Isopoh.Cryptography.SecureArray.SecureArray::SetProcessWorkingSetSizeEx64' has unbalanced the stack. This is likely because the managed PInvoke signature does not match the unmanaged target signature. Check that the calling convention and parameters of the PInvoke signature match the target unmanaged signature.'
That's with .NET 4.7 "AnyCpu" on Windows Server 2016
from isopoh.cryptography.argon2.
I think I can get access to a WinServer 2016 VM. I'll see if I can reproduce this as soon as I can.
from isopoh.cryptography.argon2.
It was a bug! I had flipped 32/64-bit P/Invokes and I never hit it until I added a .Net Framework test (which I had removed a long time ago as painful to maintain). The testing here is woefully incomplete because of the multitude of platforms and configurations it theoretically runs on...
1.0.6 version at https://www.nuget.org/packages/Isopoh.Cryptography.Argon2/ has the fix.
from isopoh.cryptography.argon2.
Related Issues (20)
- Memory block count calculation error
- Running on Hololens UWP HOT 3
- Blazor WebAssembly option for SecureArray.DefaultCall HOT 4
- Errors appearing after creating first project with .Net "core" 5. HOT 2
- Output hash doesn't match output from argon2 linux utility HOT 2
- System.TypeInitializationException with .NET native on UWP
- Retrieving version being used HOT 1
- OutOfMemoryException when creating Argon2() HOT 1
- Clarification on conflicting licenses (CC0/CC4/attribution?) HOT 1
- Memory allocate issue ? HOT 1
- No clear way to disable memory binding HOT 2
- Update dependencies for target `net6.0` HOT 3
- Memory leak in Verify() HOT 4
- High Heap Using
- Incorrect output when generating more than 64 bytes HOT 5
- Release 1.1.11 breaks Verify method. HOT 1
- Exploding memory usage HOT 1
- pinvokestackimbalance on Windows memset call HOT 1
- Memory is not being released HOT 3
- Hash without salt is corrupt
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from isopoh.cryptography.argon2.