encryptogroup / MOTION

An efficient, user-friendly, modular, and extensible framework for mixed-protocol secure multi-party computation with two or more parties
MIT License
85 stars 40 forks source link

Adopt SIMD abstraction library for Android support #10

Open robinhundt opened 2 years ago

robinhundt commented 2 years ago

Related: #9 Motion currently uses x86 simd instructions in three places:

src/motioncore/primitives/aes/aesni_primitives.cpp
27:#include <immintrin.h>

src/test/test_bitmatrix.cpp
33:#include <emmintrin.h>   // this seems unused

src/motioncore/utility/bit_matrix.cpp
38:#include <immintrin.h>

the bit_matrix implementation seems to use sse2 instructions (code using AVX is unconditionally disabled and labeled as buggy). The AES implementation seems to use sse2 and AES-NI instructions.
During the last meeting, we discussed using simde as an abstraction library. The problem however is, that it doesn't support AES. There is however a library which supports this use case: sse2neon. While it's not as broad as simde, it supports exactly what we need to enable Android support.