WebAssembly / wasi-crypto

WASI Cryptography API Proposal
162 stars 25 forks source link

witx: @witx u8 + size -> array and dedicated types #16

Closed jedisct1 closed 2 years ago

jedisct1 commented 4 years ago

Right now, the witx definitions for function parameters accepting raw bytes is:

(random example from the AEAD interface)

    (param $tag (@witx pointer u8))
    (param $tag_len $size)

This is consistent with the core WASI interface.

But as witx supports arrays, so maybe we want to define actual types instead.

For example:

(typename $aead_tag (array u8))

wiggle can already converts these to a pointer + len tuple (after a fix that is being made to wiggle right now).

witx doesn't currently support mutable arrays, so we need to keep a few mutable pointers around until this is the case.