]> git.codecow.com Git - nano25519.git/commitdiff
Hash from arrays which are passed as pointers not objects.
authorChris Duncan <chris@codecow.com>
Mon, 17 Aug 2026 20:35:32 +0000 (13:35 -0700)
committerChris Duncan <chris@codecow.com>
Mon, 17 Aug 2026 20:35:32 +0000 (13:35 -0700)
src/assembly/blake2b.ts

index 72a268847bbc4d435bec1029780a5a1941bc890f..e0712f02c8ad560830dd9751c6ab26338a6b6d39 100644 (file)
@@ -89,7 +89,7 @@ export class Blake2b {
        }
 
        // input: variable-length message bytes passed by user to be hashed
-       update (input: usize, length: i32): Blake2b {
+       update (input: StaticArray<u8>, length: i32): Blake2b {
                for (let i = 0; i < length; i++) {
 
                        // is buffer full?
@@ -106,7 +106,7 @@ export class Blake2b {
                        }
 
                        // increment buffer counter and set byte
-                       this.b[this.c++] = load<u8>(input + i)
+                       this.b[this.c++] = input[i]
                }
                return this
        }