[Bug 2154120] Re: gpg bugging on RISC-V when vector length /= 128B

Valentin Haudiquet 2154120 at bugs.launchpad.net
Thu May 28 15:43:40 UTC 2026


Can reproduce on QEMU with VLEN=256

(qemu-system-riscv64 -cpu max,vlen=256 ...)

ubuntu at ubuntu:~$ head -c 10000 /dev/urandom > in.bin
ubuntu at ubuntu:~$  PW="testpw-correct-horse-battery-staple"
ubuntu at ubuntu:~$ gpg --batch --pinentry-mode loopback --passphrase "$PW" --yes --symmetric \
    --cipher-algo AES256 --output out.gpg in.bin
gpg: directory '/home/ubuntu/.gnupg' created
gpg: keybox '/home/ubuntu/.gnupg/pubring.kbx' created
ubuntu at ubuntu:~$ gpg --batch --pinentry-mode loopback --passphrase "$PW" --yes \
   --decrypt --output dec.bin out.gpg
gpg: AES256.CFB encrypted data
gpg: encrypted with 1 passphrase
gpg: WARNING: encrypted message has been manipulated!

** Changed in: gnupg2 (Ubuntu)
       Status: New => Confirmed

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to gnupg2 in Ubuntu.
https://bugs.launchpad.net/bugs/2154120

Title:
  gpg bugging on RISC-V when vector length /= 128B

Status in gnupg2 package in Ubuntu:
  Confirmed

Bug description:
  GPG is broken on RISC-V when vector length (VLEN) doesn't equal 128B.

  This has been fixed upstream:
  https://github.com/gpg/libgcrypt/commit/3f684fc6ab3ac98320e245a06b3563ad37ec56f5

  Test:

  head -c 10000 /dev/urandom > in.bin
  PW="testpw-correct-horse-battery-staple"
  gpg --batch --pinentry-mode loopback --passphrase "$PW" --yes --symmetric \
      --cipher-algo AES256 --output out.gpg in.bin 
  gpg --batch --pinentry-mode loopback --passphrase "$PW" --yes \
     --decrypt --output dec.bin out.gpg
  if cmp -s in.bin dec.bin; then
    echo "PASS encrypt/decrypt"
  else
    echo "MISMATCH"
  fi

  Run this on x86 it works fine but run it on SpacemiT K3 with VLEN=256
  it fails.

  ProblemType: Bug
  DistroRelease: Ubuntu 26.04
  Package: gpg 2.4.8-4ubuntu3
  Uname: Linux 6.18.3-5-spacemit-generic riscv64
  ApportVersion: 2.34.0-0ubuntu2
  Architecture: riscv64
  CasperMD5CheckResult: unknown
  CloudArchitecture: riscv64
  CloudID: nocloud
  CloudName: unknown
  CloudPlatform: nocloud
  CloudSubPlatform: config-disk (/dev/sda2)
  Date: Sun May 24 10:40:29 2026
  ProcEnviron:
   LANG=C.UTF-8
   PATH=(custom, no user)
   SHELL=/bin/bash
   TERM=tmux-256color
   XDG_RUNTIME_DIR=<set>
  SourcePackage: gnupg2
  UpgradeStatus: No upgrade log present (probably fresh install)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gnupg2/+bug/2154120/+subscriptions





More information about the foundations-bugs mailing list