Encrypted AXPY

L4 · Application Components
axpy · 1 specification · 3 implementations · 4 benchmarks
WHAT IT ISr = a·x + y over vectors: one scale, one add. The BLAS level-1 classic, and the first kernel measured over encrypted data.
FHECKKSARITHMETICREFERENCE
SIGNATURE
kernel axpy<N: u32>(
%x: secret<tensor<N x i16>>,
%y: secret<tensor<N x i16>>,
%a: i16,
) -> %r: secret<tensor<N x i16>>
Sizes and element types are left open here. A specification fixes them; an implementation says over which of them it works.
SPECIFICATIONS1publishedIMPLEMENTATIONS33 measured
BENCHMARKS4across 2 machines
FASTEST121 µsN8192 on fairmath-fpga
CHALLENGES0none opened
DESCRIPTION

Definition

AXPY scales a vector and adds another, element by element. For a scalar aa and vectors x,yx, y of length NN,

ri=axi+yi,0i<N.r_i = a\cdot x_i + y_i, \qquad 0 \le i < N.

The name is "aa times xx plus yy" — the level-1 BLAS routine axpy. Each output element depends only on the corresponding elements of xx and yy; there is no interaction between positions and no summation across the vector.

Mathematical Domain

AXPY is defined over any ring of scalars — integers, reals, or complex numbers. Under a homomorphic scheme the vectors live in the scheme's plaintext domain and are held in ciphertext slots, while the scalar may be supplied either encrypted or in the clear.

The kernel fixes neither the scalar type, the vector length, nor which operands are secret. These, together with the scheme and the encoding, are set by a specification. Structurally the operation is the shallowest computation there is: one multiplication and one addition, multiplicative depth 1, with no rotations required when xx and yy share a layout.

Parameters Defined by Specifications

A specification narrows AXPY into a concrete problem by fixing:

  • the element domain and homomorphic scheme
  • the vector length NN
  • which operands are secret and which are public
  • the encoding / packing of the vectors into ciphertext slots
  • the correctness or accuracy rule and its value bounds

Applications

AXPY is the update at the heart of iterative numerical methods: a gradient-descent step wwηgw \leftarrow w - \eta\,g, a conjugate-gradient or Krylov update, linear interpolation, and the row operations of Gaussian elimination are all AXPYs. As the simplest kernel that is still a computation, it also opens the encrypted track and exercises every stage of the pipeline — encoding, encryption, the measured call, decryption, decoding — so that a slow scheme, library, or machine has nowhere to hide.

MAINTAINER
FM
fairmathreviews specifications · resolves disputes
USED BY · 0 KERNELS
Kernels above this one. If this kernel is wrong, or slow, they are wrong or slow with it.Nothing depends on this kernel yet.
BUILDS ON · 0 KERNELS
Kernels this one is stated in terms of. Not a call graph — a statement of dependence between problems.Nothing. This kernel sits at the bottom of the graph.
RECENT ACTIVITYNothing yet.