|
purify
C++ Purify implementation with native circuit and BPP support
|
Move-only packed Purify secret stored in dedicated heap memory. More...
#include <secret.hpp>
Public Member Functions | |
| SecretKey ()=delete | |
| SecretKey (const SecretKey &)=delete | |
| SecretKey & | operator= (const SecretKey &)=delete |
| SecretKey (SecretKey &&) noexcept=default | |
| SecretKey & | operator= (SecretKey &&) noexcept=default |
| ~SecretKey ()=default | |
| Result< SecretKey > | clone () const |
| Creates a second owned copy of this secret key. | |
| const UInt512 & | packed () const noexcept |
| Exposes the packed secret for lower-level cryptographic operations. | |
| bool | operator== (const SecretKey &other) const noexcept |
| Compares two owned secrets by their packed values. | |
Static Public Member Functions | |
| static Result< SecretKey > | from_packed (const UInt512 &packed) |
| Constructs a validated secret key from packed Purify secret bytes. | |
| static Result< SecretKey > | from_hex (std::string_view hex) |
| Parses and validates a packed Purify secret from hexadecimal text. | |
The packed secret is validated on construction, zeroized on destruction, and never copied implicitly. Call clone() when an additional owned copy is intentionally required.
Definition at line 52 of file secret.hpp.
|
delete |
Referenced by from_packed().
|
delete |
|
defaultnoexcept |
|
default |
Definition at line 85 of file secret.hpp.
References from_packed(), and packed().
Referenced by purify::derive_key(), purify::puresign_plusplus::KeyPair::from_secret(), and purify::puresign::KeyPair::from_secret().
| hex | Hex string containing exactly one packed secret. |
Definition at line 76 of file secret.hpp.
References from_packed(), packed(), PURIFY_ASSIGN_OR_RETURN, and purify::BigUInt< 8 >::try_from_hex().
Referenced by purify::run_cli().
| packed | Packed secret scalar pair. |
ErrorCode::RangeViolation if packed is invalid. Definition at line 66 of file secret.hpp.
References packed(), PURIFY_RETURN_IF_ERROR, SecretKey(), and purify::validate_secret_key().
Referenced by clone(), from_hex(), and purify::generate_key().
|
inlinenoexcept |
| other | Secret to compare against. |
true when both secrets encode the same packed value. Definition at line 102 of file secret.hpp.
References packed().
|
inlinenoexcept |
Definition at line 93 of file secret.hpp.
Referenced by clone(), purify::derive_bip340_key(), purify::eval(), from_hex(), from_packed(), operator==(), and purify::prove_assignment_data().