After I used this code to encrypt gpg.txt
$ gpg -c --cipher-algo AES256 --digest-algo SHA512 "GPG.txt"
I checked the result to see if it was encrypted with AES256 and hashed with SHA512
$ gpg --list-packets GPG.txt.gpg
symkey enc packet: version 4, cipher 9, s2k 3, ***hash 2***
gpg: AES256 encrypted data
I found Cipher=9, which is AES256 as I asked, but Hash=2, which stands for SHA1 and is not 10=SHA512 as I had wanted!
Why did this happen? Does anyone know how to force gpg to use SHA512 instead of SHA1?