Coverage for src\pqlattice\_backends\_native.py: 73%

1 from typing import override

2

3 from ..lattice._bkz import bkz

4 from ..lattice._hkz import hkz

5 from ..lattice._lll import lll

6 from ..lattice._svp import shortest_vector

7 from ..linalg._linalg import hnf

8 from ..typing import Matrix, SquareMatrix, Vector

9 from ._protocol import BackendInterface

10

11

12 class NativeBackend(BackendInterface):

13 @override

14 def lll(self, lattice_basis: SquareMatrix, delta: float) -> SquareMatrix:

15 return lll(lattice_basis, delta)

16

17 @override

18 def bkz(self, lattice_basis: SquareMatrix, block_size: int, delta: float) -> SquareMatrix:

19 _ = delta

20 return bkz(lattice_basis, block_size)

21

22 @override

23 def hkz(self, lattice_basis: SquareMatrix, delta: float) -> SquareMatrix:

24 _ = delta

25 return hkz(lattice_basis)

26

27 @override

28 def shortest_vector(self, lattice_basis: SquareMatrix) -> Vector:

29 return shortest_vector(lattice_basis)

30

31 @override

32 def hnf(self, matrix: Matrix) -> tuple[Matrix, SquareMatrix]:

33 return hnf(matrix)