Crypto++ 8.9 Free C++ class library of cryptographic schemes

arm_simd.h File Reference

Support functions for ARM and vector operations. More...

Go to the source code of this file.

## Functions
CRC32 checksum
uint32_t | CRC32B (uint32_t crc, uint8_t val)
| CRC32 checksum. More...
uint32_t | CRC32W (uint32_t crc, uint32_t val)
| CRC32 checksum. More...
uint32_t | CRC32Wx4 (uint32_t crc, const uint32_t vals[4])
| CRC32 checksum. More...
CRC32-C checksum
uint32_t | CRC32CB (uint32_t crc, uint8_t val)
| CRC32-C checksum. More...
uint32_t | CRC32CW (uint32_t crc, uint32_t val)
| CRC32-C checksum. More...
uint32_t | CRC32CWx4 (uint32_t crc, const uint32_t vals[4])
| CRC32-C checksum. More...
Polynomial multiplication
uint64x2_t | PMULL_00 (const uint64x2_t a, const uint64x2_t b)
| Polynomial multiplication. More...
uint64x2_t | PMULL_01 (const uint64x2_t a, const uint64x2_t b)
| Polynomial multiplication. More...
uint64x2_t | PMULL_10 (const uint64x2_t a, const uint64x2_t b)
| Polynomial multiplication. More...
uint64x2_t | PMULL_11 (const uint64x2_t a, const uint64x2_t b)
| Polynomial multiplication. More...
uint64x2_t | PMULL (const uint64x2_t a, const uint64x2_t b)
| Polynomial multiplication. More...
uint64x2_t | PMULL_HIGH (const uint64x2_t a, const uint64x2_t b)
| Polynomial multiplication. More...
template<unsigned int C>
uint64x2_t | VEXT_U8 (uint64x2_t a, uint64x2_t b)
| Vector extraction. More...
ARMv8.2 operations
uint64x2_t | VEOR3 (uint64x2_t a, uint64x2_t b, uint64x2_t c)
| Three-way XOR. More...
uint64x2_t | VXAR (uint64x2_t a, uint64x2_t b, const int c)
| XOR and rotate. More...
template<unsigned int C>
uint64x2_t | VXAR (uint64x2_t a, uint64x2_t b)
| XOR and rotate. More...
uint64x2_t | VRAX1 (uint64x2_t a, uint64x2_t b)
| XOR and rotate. More...

## Detailed Description

Support functions for ARM and vector operations.

Definition in file arm_simd.h.

## Function Documentation

## ◆ CRC32B()

uint32_t CRC32B | ( | uint32_t | crc,
|  | uint8_t | val
| ) |  |
| inline

CRC32 checksum.

Parameters

  crc | the starting crc value
  val | the value to checksum

Returns
  CRC32 value

Since
  Crypto++ 8.6

Definition at line 30 of file arm_simd.h.

## ◆ CRC32W()

uint32_t CRC32W | ( | uint32_t | crc,
|  | uint32_t | val
| ) |  |
| inline

CRC32 checksum.

Parameters

  crc | the starting crc value
  val | the value to checksum

Returns
  CRC32 value

Since
  Crypto++ 8.6

Definition at line 46 of file arm_simd.h.

## ◆ CRC32Wx4()

uint32_t CRC32Wx4 | ( | uint32_t | crc,
|  | const uint32_t | vals[4]
| ) |  |
| inline

CRC32 checksum.

Parameters

  crc | the starting crc value
  vals | the values to checksum

Returns
  CRC32 value

Since
  Crypto++ 8.6

Definition at line 62 of file arm_simd.h.

## ◆ CRC32CB()

uint32_t CRC32CB | ( | uint32_t | crc,
|  | uint8_t | val
| ) |  |
| inline

CRC32-C checksum.

Parameters

  crc | the starting crc value
  val | the value to checksum

Returns
  CRC32-C value

Since
  Crypto++ 8.6

Definition at line 86 of file arm_simd.h.

## ◆ CRC32CW()

uint32_t CRC32CW | ( | uint32_t | crc,
|  | uint32_t | val
| ) |  |
| inline

CRC32-C checksum.

Parameters

  crc | the starting crc value
  val | the value to checksum

Returns
  CRC32-C value

Since
  Crypto++ 8.6

Definition at line 102 of file arm_simd.h.

## ◆ CRC32CWx4()

uint32_t CRC32CWx4 | ( | uint32_t | crc,
|  | const uint32_t | vals[4]
| ) |  |
| inline

CRC32-C checksum.

Parameters

  crc | the starting crc value
  vals | the values to checksum

Returns
  CRC32-C value

Since
  Crypto++ 8.6

Definition at line 118 of file arm_simd.h.

## ◆ PMULL_00()

uint64x2_t PMULL_00 | ( | const uint64x2_t | a,
|  | const uint64x2_t | b
| ) |  |
| inline

Polynomial multiplication.

Parameters

  a | the first value
  b | the second value

Returns
  vector product

PMULL_00() performs polynomial multiplication and presents the result like Intel's `c = _mm_clmulepi64_si128(a, b, 0x00)`. The `0x00` indicates the low 64-bits of `a` and `b` are multiplied.

Note
  An Intel XMM register is composed of 128-bits. The leftmost bit is MSB and numbered 127, while the rightmost bit is LSB and numbered 0.

Since
  Crypto++ 8.0

Definition at line 152 of file arm_simd.h.

## ◆ PMULL_01()

uint64x2_t PMULL_01 | ( | const uint64x2_t | a,
|  | const uint64x2_t | b
| ) |  |
| inline

Polynomial multiplication.

Parameters

  a | the first value
  b | the second value

Returns
  vector product

PMULL_01 performs() polynomial multiplication and presents the result like Intel's `c = _mm_clmulepi64_si128(a, b, 0x01)`. The `0x01` indicates the low 64-bits of `a` and high 64-bits of `b` are multiplied.

Note
  An Intel XMM register is composed of 128-bits. The leftmost bit is MSB and numbered 127, while the rightmost bit is LSB and numbered 0.

Since
  Crypto++ 8.0

Definition at line 182 of file arm_simd.h.

## ◆ PMULL_10()

uint64x2_t PMULL_10 | ( | const uint64x2_t | a,
|  | const uint64x2_t | b
| ) |  |
| inline

Polynomial multiplication.

Parameters

  a | the first value
  b | the second value

Returns
  vector product

PMULL_10() performs polynomial multiplication and presents the result like Intel's `c = _mm_clmulepi64_si128(a, b, 0x10)`. The `0x10` indicates the high 64-bits of `a` and low 64-bits of `b` are multiplied.

Note
  An Intel XMM register is composed of 128-bits. The leftmost bit is MSB and numbered 127, while the rightmost bit is LSB and numbered 0.

Since
  Crypto++ 8.0

Definition at line 212 of file arm_simd.h.

## ◆ PMULL_11()

uint64x2_t PMULL_11 | ( | const uint64x2_t | a,
|  | const uint64x2_t | b
| ) |  |
| inline

Polynomial multiplication.

Parameters

  a | the first value
  b | the second value

Returns
  vector product

PMULL_11() performs polynomial multiplication and presents the result like Intel's `c = _mm_clmulepi64_si128(a, b, 0x11)`. The `0x11` indicates the high 64-bits of `a` and `b` are multiplied.

Note
  An Intel XMM register is composed of 128-bits. The leftmost bit is MSB and numbered 127, while the rightmost bit is LSB and numbered 0.

Since
  Crypto++ 8.0

Definition at line 242 of file arm_simd.h.

## ◆ PMULL()

uint64x2_t PMULL | ( | const uint64x2_t | a,
|  | const uint64x2_t | b
| ) |  |
| inline

Polynomial multiplication.

Parameters

  a | the first value
  b | the second value

Returns
  vector product

PMULL() performs vmull_p64(). PMULL is provided as GCC inline assembly due to Clang and lack of support for the intrinsic.

Since
  Crypto++ 8.0

Definition at line 267 of file arm_simd.h.

## ◆ PMULL_HIGH()

uint64x2_t PMULL_HIGH | ( | const uint64x2_t | a,
|  | const uint64x2_t | b
| ) |  |
| inline

Polynomial multiplication.

Parameters

  a | the first value
  b | the second value

Returns
  vector product

PMULL_HIGH() performs vmull_high_p64(). PMULL_HIGH is provided as GCC inline assembly due to Clang and lack of support for the intrinsic.

Since
  Crypto++ 8.0

Definition at line 292 of file arm_simd.h.

## ◆ VEXT_U8()

template<unsigned int C>

uint64x2_t VEXT_U8 | ( | uint64x2_t | a,
|  | uint64x2_t | b
| ) |  |
| inline

Vector extraction.

Template Parameters

  C | the byte count

Parameters

  a | the first value
  b | the second value

Returns
  vector

VEXT_U8() extracts the first `C` bytes of vector `a` and the remaining bytes in `b`. VEXT_U8 is provided as GCC inline assembly due to Clang and lack of support for the intrinsic.

Since
  Crypto++ 8.0

Definition at line 320 of file arm_simd.h.

## ◆ VEOR3()

uint64x2_t VEOR3 | ( | uint64x2_t | a,
|  | uint64x2_t | b,
|  | uint64x2_t | c
| ) |  |
| inline

Three-way XOR.

Parameters

  a | the first value
  b | the second value
  c | the third value

Returns
  three-way exclusive OR of the values

VEOR3() performs veor3q_u64(). VEOR3 is provided as GCC inline assembly due to Clang and lack of support for the intrinsic.

VEOR3 requires ARMv8.2.

Since
  Crypto++ 8.6

Definition at line 350 of file arm_simd.h.

## ◆ VXAR() [1/2]

uint64x2_t VXAR | ( | uint64x2_t | a,
|  | uint64x2_t | b,
|  | const int | c
| ) |  |
| inline

XOR and rotate.

Parameters

  a | the first value
  b | the second value
  c | the third value

Returns
  two-way exclusive OR of the values, then rotated by c

VXARQ() performs vxarq_u64(). VXARQ is provided as GCC inline assembly due to Clang and lack of support for the intrinsic.

VXARQ requires ARMv8.2.

Since
  Crypto++ 8.6

Definition at line 371 of file arm_simd.h.

## ◆ VXAR() [2/2]

template<unsigned int C>

uint64x2_t VXAR | ( | uint64x2_t | a,
|  | uint64x2_t | b
| ) |  |
| inline

XOR and rotate.

Template Parameters

  C | the rotate amount

Parameters

  a | the first value
  b | the second value

Returns
  two-way exclusive OR of the values, then rotated by C

VXARQ() performs vxarq_u64(). VXARQ is provided as GCC inline assembly due to Clang and lack of support for the intrinsic.

VXARQ requires ARMv8.2.

Since
  Crypto++ 8.6

Definition at line 393 of file arm_simd.h.

## ◆ VRAX1()

uint64x2_t VRAX1 | ( | uint64x2_t | a,
|  | uint64x2_t | b
| ) |  |
| inline

XOR and rotate.

Parameters

  a | the first value
  b | the second value

Returns
  two-way exclusive OR of the values, then rotated 1-bit

VRAX1() performs vrax1q_u64(). VRAX1 is provided as GCC inline assembly due to Clang and lack of support for the intrinsic.

VRAX1 requires ARMv8.2.

Since
  Crypto++ 8.6

Definition at line 413 of file arm_simd.h.