TritonVM / tasm-lib

A collection of functions written in Triton VM assembly (tasm)
Apache License 2.0
11 stars 2 forks source link

Add `swap` method for lists #67

Closed Sword-Smith closed 10 months ago

Sword-Smith commented 10 months ago

NTT needs to swap elements in a list, so we should have the optimal list swap snippet. It should probably just use the function signature that Rust uses

pub fn swap(&mut self, a: usize, b: usize)

https://doc.rust-lang.org/std/vec/struct.Vec.html#method.swap