Environment
Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):
- CLI: 6.0.3
- iOS Runtime: 6.0.0
Describe the bug
Using the following iOS API from {N}:
extern unsigned char *
CC_SHA256(const void *data, CC_LONG len, unsigned char *md);
returns a result that is interpreted as buffer of signed ints, which ends up working with wrong results.
To Reproduce
See this {N} Playground. The following line is the workaround that rescues the situation:
let buffer = new interop.Reference(interop.types.uint8, sha256buffer);
Without it, the result from CC_SHA256 is treated as signed integers and that can lead to wrong results.