Skip to content

crypto: poly1305 improvements

Jason A. Donenfeld linux-crypto 8 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v8 Latest4 patches 1 replyIn review
  2. v74 patches 0 repliesSuperseded
  3. v63 patches 3 repliesSuperseded
Earlier versions · 5
VersionPostedPatchesRepliesStatus
v53 patches2 repliesSuperseded
v43 patches0 repliesSuperseded
v33 patches3 repliesSuperseded
v23 patches16 repliesSuperseded
v11 patch2 repliesSuperseded

Patches in v8 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4crypto: poly1305 - add new 32 and 64-bit generic versionsarch/x86/crypto/poly1305-avx2-x86_64.S arch/x86/crypto/poly1305_glue.c crypto/adiantum.c +9 more+675 -2280 replies
2/4crypto: x86_64/poly1305 - import unmodified cryptogams implementationarch/x86/crypto/poly1305-x86_64-cryptogams.pl+4159 -00 replies
3/4crypto: x86_64/poly1305 - wire up faster implementations for kernelarch/x86/crypto/.gitignore arch/x86/crypto/Makefile arch/x86/crypto/poly1305-avx2-x86_64.S +4 more+572 -15770 replies
4/4crypto: arm/arm64/mips/poly1305 - remove redundant non-reduction from emitarch/arm/crypto/poly1305-glue.c arch/arm64/crypto/poly1305-glue.c arch/mips/crypto/poly1305-glue.c+6 -480 replies

Reviews trailers per patch

1 of 4 patches has a Reviewed-by or Acked-by.

PatchArd Biesheuvel
1/4
2/4
3/4
4/4T-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v8 thread

Cover letter [PATCH v8 0/4] crypto: poly1305 improvements

Sorry for the repost so soon after version 7. Version 8 fixes a build error spotted by kbuild, due to mixing object file name and module name. Other than that derp, it's identical to version 7.

Version 7 incorporates suggestions from the mailing list on version 6. We now use a union type to handle the poly1305_core_key, per suggestion. And now the changes to the cryptogams code are nicely split out into its own commit, with detail on the (limited) scope of the changes. I believe this should address the last of issues brought up.

####

These are some improvements to the Poly1305 code that I think should be fairly uncontroversial. The first part, the new C implementations, adds cleaner code in two forms that can easily be compared and reviewed, and also results in performance speedups. The second part, the new x86_64 implementation, replaces an slow unvetted implementation with an extremely fast implementation that has received many eyeballs. Finally, we fix up some dead code.

Jason A. Donenfeld (4):
crypto: poly1305 - add new 32 and 64-bit generic versions
crypto: x86_64/poly1305 - import unmodified cryptogams implementation
crypto: x86_64/poly1305 - wire up faster implementations for kernel
crypto: arm/arm64/mips/poly1305 - remove redundant non-reduction from
emit

 arch/arm/crypto/poly1305-glue.c               |   18 +-
 arch/arm64/crypto/poly1305-glue.c             |   18 +-
 arch/mips/crypto/poly1305-glue.c              |   18 +-
 arch/x86/crypto/.gitignore                    |    1 +
 arch/x86/crypto/Makefile                      |   11 +-
 arch/x86/crypto/poly1305-avx2-x86_64.S        |  390 --
 arch/x86/crypto/poly1305-sse2-x86_64.S        |  590 ---
 arch/x86/crypto/poly1305-x86_64-cryptogams.pl | 4265 +++++++++++++++++
 arch/x86/crypto/poly1305_glue.c               |  308 +-
 crypto/adiantum.c                             |    4 +-
 crypto/nhpoly1305.c                           |    2 +-
 crypto/poly1305_generic.c                     |   25 +-
 include/crypto/internal/poly1305.h            |   45 +-
 include/crypto/nhpoly1305.h                   |    4 +-
 include/crypto/poly1305.h                     |   26 +-
 lib/crypto/Kconfig                            |    2 +-
 lib/crypto/Makefile                           |    4 +-
 lib/crypto/poly1305-donna32.c                 |  204 +
 lib/crypto/poly1305-donna64.c                 |  185 +
 lib/crypto/poly1305.c                         |  169 +-
 20 files changed, 4924 insertions(+), 1365 deletions(-)
 create mode 100644 arch/x86/crypto/.gitignore
 delete mode 100644 arch/x86/crypto/poly1305-avx2-x86_64.S
 delete mode 100644 arch/x86/crypto/poly1305-sse2-x86_64.S
 create mode 100644 arch/x86/crypto/poly1305-x86_64-cryptogams.pl
 create mode 100644 lib/crypto/poly1305-donna32.c
 create mode 100644 lib/crypto/poly1305-donna64.c
Signature · 1 line
2.24.1