aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/pubkey/gost_3410/gost_3410.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix flaky GOST 34.10 signature testJack Lloyd2020-04-071-5/+5
| | | | | | | | | | | | | The problem was a race between the GOST 34.10 signature and verification tests. Each registered an EC group, but signature registered it with an OID and verification without. If during threaded test runs, verificatino ran first, then signature would fail because there was no OID. Fix the tests by registering using an OID in both cases. Also fix EC_Group registration so if the same group is registered with and without an OID, we update the internal state to use the OID. Fixes GH #2197
* Throw if you attempt to use GOST 34.10-2012 with invalid paramsJack Lloyd2019-10-061-2/+23
| | | | It can only be used with 256 or 512 bit params, so enforce that.
* Update GOST to use 2012 OIDs/paramsJack Lloyd2019-08-031-0/+5
|
* Add PK_Signer::signature_lengthJack Lloyd2018-08-101-0/+2
|
* DER improvementsJack Lloyd2018-05-221-5/+8
| | | | | | | | | | | Let DER_Encoder write to a user specified vector instead of only to an internal vector. This allows encoding to a std::vector without having to first write to a locked vector and then copying out the result. Add ASN1_Object::BER_encode convenience method. Replaces X509_Object::BER_encode which had the same logic but was restricted to a subtype. This replaces many cases where DER_Encoder was just used to encode a single object (X509_DN, AlgorithmIdentifier, etc).
* Use EC_Group::inverse_mod_order where appropriateJack Lloyd2018-04-201-1/+1
|
* Precompute for multiexponentation when verifying ECC signaturesJack Lloyd2018-04-171-3/+4
| | | | | ECDSA already did this. Improves repeated ECGDSA, ECKCDSA, SM2, and GOST signature verification by 10-15%
* Revamp GOST-34.10 testsJack Lloyd2018-03-211-6/+1
| | | | | Use an official vector (from RFC 5832), support arbitrary curves since GOST likes those for testing.
* Use blinded_base_point_multiply_x in the various signature schemesJack Lloyd2018-03-081-4/+5
|
* New API for blinded ECC point multiplicationJack Lloyd2018-02-211-3/+2
| | | | No shared state
* Add point_multiply operation to EC_GroupJack Lloyd2018-02-181-2/+1
| | | | Allows precomputations in the future.
* Add functions to reduce integers mod the order to EC_GroupJack Lloyd2018-02-181-35/+33
| | | | | | This allows calculating the Barett reduction params just once, when the group is initialized, then sharing them across all operations which use that group.
* Use shared representation of EC_GroupJack Lloyd2018-01-311-2/+2
| | | | Hide CurveGFp with an eye for eventual removal
* Add accessors to ASN1_Attribute and AlgorithmIdentifierJack Lloyd2017-12-191-1/+1
|
* Apply final annotations to the library alsoJack Lloyd2017-09-221-2/+2
| | | | | Done by a perl script which converted all classes to final, followed by selective reversion where it caused compilation failures.
* Convert to using standard uintN_t integer typesJack Lloyd2016-12-181-15/+15
| | | | | | Renames a couple of functions for somewhat better name consistency, eg make_u32bit becomes make_uint32. The old typedefs remain for now since probably lots of application code uses them.
* Public_Key derived class ctors take an std::vector<byte>René Korthaus2016-12-111-1/+1
| | | | | | | Changes all the Public_Key derived classes ctors to take a std::vector instead of a secure_vector for the DER encoded public key bits. There is no point in transporting a public key in secure storage. (GH #768)
* Add Public_Key::subject_public_key()René Korthaus2016-12-051-1/+1
| | | | | | | Adds new Public_Key::subject_public_key() that returns a X.509 SubjectPublicKey structure. Renames the current Public_Key::x509_subject_public_key() to public_key_bits(). BER_encode() just invokes subject_public_key().
* Pubkey cleanupsJack Lloyd2016-11-121-4/+0
| | | | | | | | | | Add Public_Key::key_length usable for policy checking (as in TLS::Policy::check_peer_key_acceptable) Remove Public_Key::max_input_bits because it didn't make much sense for most algorithms actually. Remove message_parts and message_part_size from PK_Ops
* Remove Key_Type typedefsJack Lloyd2016-11-081-2/+0
| | | | Also part of Algo_Registry and not needed after #668
* Revert PK_Verifier change (don't require RNG there).Jack Lloyd2016-10-071-5/+8
| | | | | | | Verification is deterministic and public, so really no RNG is ever needed. Change provider handling - accepts "base", "openssl", or empty, otherwise throws a Provider_Not_Found exception.
* Remove Algo_Registry usage from public key code.Jack Lloyd2016-10-071-3/+17
| | | | | | | | Instead the key types exposes operations like `create_encryption_op` which will return the relevant operation if the algorithm supports it. Changes pubkey.h interface, now RNG is passed at init time. Blinder previous created its own RNG, now it takes it from app.
* Mass-prefix member vars with m_René Korthaus2016-01-081-19/+19
|
* Add power analysis countermeasures for ECC point multiplications.Jack Lloyd2015-08-211-19/+19
| | | | | | | | The plain PointGFp operator* now uses Montgomery ladder exclusively. Adds a blinded point multiply algorithm which uses exponent and point randomization, as well as a Montgomery ladder technique that takes a random walk of the possible addition chains for k.
* pubkey: Add missing overridesDaniel Seither2015-07-301-1/+1
|
* lib/pubkey: Convert &vec[0] to vec.data()Simon Warta2015-06-231-2/+2
|
* Move the signature padding schemes to the PK operation classes,lloyd2015-03-231-15/+19
| | | | | | | | | as was previously done with encrypt/decrypt ops. One feature dropped on the floor here is previously PK_Signer by default did verification of signatures before releasing them as an measure against fault attacks. However in addition to being expensive this turned out to be difficult to implement with the new scheme.
* Convert PK operations to using Algo_Registry instead of Engine.lloyd2015-02-031-17/+55
| | | | Remove global PRNG.
* Ensure all files have copyright and license info.lloyd2015-01-101-1/+1
| | | | | Update license header line to specify the terms and refer to the file, neither of which it included before.
* Move lib into srclloyd2014-01-101-0/+176