aboutsummaryrefslogtreecommitdiffstats
path: root/cipher/rsa.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Do not use C99 feature.Dario Niedermann2017-11-101-3/+4
| | | | | | | | | * cipher/rsa.c (secret): Move var decl to the beginning. -- Trivial patch; ChangeLog written by wk. Signed-off-by: Werner Koch <[email protected]>
* rsa: Reduce secmem pressure.NIIBE Yutaka2017-07-071-1/+8
| | | | | | * cipher/rsa.c (secret): Don't keep secmem. Signed-off-by: NIIBE Yutaka <[email protected]>
* rsa: Allow different build directory.NIIBE Yutaka2017-07-071-1/+1
| | | | | | | * cipher/Makefile.am (AM_CPPFLAGS): Add mpi dirs. * cipher/rsa.c: Change include file. Signed-off-by: NIIBE Yutaka <[email protected]>
* rsa: Add exponent blinding.Marcus Brinkmann2017-07-071-4/+29
| | | | | | | | | | | * cipher/rsa.c (secret_core_crt): Blind secret D with randomized nonce R for mpi_powm computation. -- Backport of libgcrypt 8725c99ffa41778f382ca97233183bcd687bb0ce. Signed-off-by: Marcus Brinkmann <[email protected]>
* Obsolete option --no-sig-create-check.Werner Koch2015-09-011-1/+12
| | | | | | | | | * cipher/rsa.c (rsa_sign): Verify after sign. * g10/gpg.c (opts): Make --no-sig-create-check a NOP. * g10/options.h (opt): Remove field "no_sig_create_check". * g10/sign.c (do_sign): Do check only for DSA. Signed-off-by: Werner Koch <[email protected]>
* Normalize the MPIs used as input to secret key functions.Werner Koch2013-12-031-4/+18
| | | | | | | | | | | | | | | | | | | * cipher/rsa.c (secret): Normalize the INPUT. (rsa_decrypt): Pass reduced data to secret. * cipher/elgamal.c (decrypt): Normalize A and B. * cipher/dsa.c (sign): Normalize HASH. -- mpi_normalize is in general not required because extra leading zeroes do not harm the computation. However, adding extra all zero limbs or padding with multiples of N may be useful in side-channel attacks. In particular they are used by the acoustic crypt-analysis. This is an extra pre-caution which alone would not be sufficient to mitigate the described attack. CVE-id: CVE-2013-4576 Signed-off-by: Werner Koch <[email protected]>
* Use blinding for the RSA secret operation.Werner Koch2013-12-031-17/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * cipher/random.c (randomize_mpi): New. * g10/gpgv.c (randomize_mpi): New stub. * cipher/rsa.c (USE_BLINDING): Define macro. (secret): Implement blinding. -- GPG 1.x has never used any protection against timing attacks on the RSA secret operation. The rationale for this has been that there was no way to mount a remote timing attack on GnuPG. With the turning up of Acoustic Cryptanalysis (http://cs.tau.ac.il/~tromer/acoustic) this assumption no longer holds true and thus we need to do do something about it. Blinding seems to be a suitable mitigation to the threat of key extraction. It does not help against distinguishing used keys, though. Note that GPG 2.x uses Libgcrypt which does blinding by default. The performance penalty is negligible: Modifying the core pubkey_sign or pubkey_decrypt function to run 100 times in a loop, the entire execution times for signing or decrypting a small message using a 4K RSA key on a Thinkpad X220 are Without blinding: 5.2s (8.9s) With blinding: 5.6s (9.3s) The numbers in parentheses give the values without the recently implemented k-ary exponentiation code. Thus for the next release the user will actually experience faster signing and decryption. A drawback of blinding is that we need random numbers even for decryption (albeit at low quality). Signed-off-by: Werner Koch <[email protected]> CVE-id: CVE-2013-4576
* Switched to GPLv3.Werner Koch2007-10-231-4/+2
| | | | | Updated gettext.
* Removed the use of g10defs.h.Werner Koch2006-12-111-11/+11
| | | | | | This required some code cleanups and the introduction of a few accessor ducntions in mpi.
* * rsa.c (generate): Use e=65537 for new RSA keys.David Shaw2006-06-281-13/+9
|
* Converted all m_free to xfree etc.Werner Koch2005-07-271-2/+2
|
* Updated FSF street address and preparations for a release candidate.Werner Koch2005-05-311-1/+2
|
* Note: I have not fully tested the new key creation due to a pc/scWerner Koch2004-09-231-1/+2
| | | | | | | | | | | | | | | | | | | error. However the backupfile has been created successfully. * rsa.c (rsa_generate): Return the dummy list of factors only if the caller asked for it. * card_util.c (generate_card_keys): ask whether backup should be created. (card_store_subkey): Factored some code out to .. * keygen.c (save_unprotected_key_to_card): .. new function. (gen_card_key_with_backup): New. (generate_raw_key): New. (generate_keypair): New arg BACKUP_ENCRYPTION_DIR. Changed all callers. (do_generate_keypair): Divert to gen_card_key_with_backup when desired.
* * dsa.h, dsa.c (dsa_verify), elgamal.h, elgamal.c (elg_verify), rsa.h,David Shaw2003-12-171-3/+1
| | | | | | rsa.c (rsa_verify), pubkey.c (dummy_verify, pubkey_verify): Remove old unused code.
* * bithelp.h, des.c, random.c, rndlinux.c, sha1.c, blowfish.c, elgamal.c,David Shaw2003-05-241-6/+3
| | | | | | | | rijndael.c, rndunix.c, sha256.c, cast5.c, idea-stub.c, rmd160.c, rndw32.c, sha512.c, md5.c, rmd160test.c, rsa.c, tiger.c: Edit all preprocessor instructions to remove whitespace before the '#'. This is not required by C89, but there are some compilers out there that don't like it.
* Update head to match stable 1.0David Shaw2002-06-291-0/+494
|
* Removed files from the HEAD revision, because they are now in anotherWerner Koch2000-12-191-468/+0
| | | | | repository
* Some configuration changesWerner Koch2000-11-141-20/+20
|
* See ChangeLog: Wed Oct 4 13:16:18 CEST 2000 Werner KochWerner Koch2000-10-041-4/+1
|
* See ChangeLog: Mon Sep 18 16:35:45 CEST 2000 Werner KochWerner Koch2000-09-181-20/+116
|
* See ChangeLog: Fri Jul 14 19:38:23 CEST 2000 Werner KochWerner Koch2000-07-141-0/+375
|
* added option file handlingWerner Koch1997-12-121-214/+0
|
* fingerprints and self signatures addedWerner Koch1997-12-091-0/+16
|
* ElGamal funktioniert und ist defaultWerner Koch1997-11-241-4/+4
|
* Output armor works, RSA keygen works.Werner Koch1997-11-191-15/+22
|
* initially checkinWerner Koch1997-11-181-0/+191