lambdaworks-math 0.10.0

Modular math library for cryptography
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
#pragma once

#include "../utils.h"

template <class Fp>
inline __device__ void _bitrev_permutation(const Fp *input, Fp *result, const int len)
{
    unsigned thread_pos = blockDim.x * blockIdx.x + threadIdx.x;
    if (thread_pos >= len) return;
    // TODO: guard is not needed for inputs of len >=block_size * 2, if len is pow of two

    result[thread_pos] = input[reverse_index(thread_pos, len)];
};