|
A11 (C++ runtime)
Native C++ implementation of the A11 streaming action runtime
|
Functions | |
| EM_ASYNC_JS (int, HostSha256,(const unsigned char *data, size_t length, unsigned char *digest), { try { if(!globalThis.crypto?.subtle) return 0;const input=HEAPU8.slice(data, data+length);const output=await globalThis.crypto.subtle.digest("SHA-256", input);HEAPU8.set(new Uint8Array(output), digest);return 1;} catch { return 0;} }) | |
| EM_JS (int, HostRandom,(unsigned char *data, int count), { try { if(!globalThis.crypto?.getRandomValues) return 0;if(count===16) { const scratch=Module.__a11UuidScratch||(Module.__a11UuidScratch=new Uint8Array(16));try { globalThis.crypto.getRandomValues(scratch);HEAPU8.set(scratch, data);} finally { scratch.fill(0);} return 1;} for(let offset=0;offset< count;offset+=65536) { const size=Math.min(65536, count - offset);const scratch=new Uint8Array(size);try { globalThis.crypto.getRandomValues(scratch);HEAPU8.set(scratch, data+offset);} finally { scratch.fill(0);} } return 1;} catch { return 0;} }) | |
| unsigned char * | SHA256 (const unsigned char *data, size_t length, unsigned char *digest) |
| int | RAND_bytes (unsigned char *data, int count) |
| EM_ASYNC_JS | ( | int | , |
| HostSha256 | , | ||
| (const unsigned char *data, size_t length, unsigned char *digest) | , | ||
| { try { if(!globalThis.crypto?.subtle) return 0;const input=HEAPU8.slice(data, data+length);const output=await globalThis.crypto.subtle.digest("SHA-256", input);HEAPU8.set(new Uint8Array(output), digest);return 1;} catch { return 0;} } | |||
| ) |
| EM_JS | ( | int | , |
| HostRandom | , | ||
| (unsigned char *data, int count) | , | ||
| { try { if(!globalThis.crypto?.getRandomValues) return 0;if(count===16) { const scratch=Module.__a11UuidScratch||(Module.__a11UuidScratch=new Uint8Array(16));try { globalThis.crypto.getRandomValues(scratch);HEAPU8.set(scratch, data);} finally { scratch.fill(0);} return 1;} for(let offset=0;offset< count;offset+=65536) { const size=Math.min(65536, count - offset);const scratch=new Uint8Array(size);try { globalThis.crypto.getRandomValues(scratch);HEAPU8.set(scratch, data+offset);} finally { scratch.fill(0);} } return 1;} catch { return 0;} } | |||
| ) |
| int RAND_bytes | ( | unsigned char * | data, |
| int | count | ||
| ) |
| unsigned char * SHA256 | ( | const unsigned char * | data, |
| size_t | length, | ||
| unsigned char * | digest | ||
| ) |