| Crates.io | ark-secret-scalar |
| lib.rs | ark-secret-scalar |
| version | 0.0.2 |
| created_at | 2025-01-24 19:15:18.19527+00 |
| updated_at | 2025-01-24 19:15:18.19527+00 |
| description | Secret scalars for non-constant-time fields and curves |
| homepage | |
| repository | https://github.com/w3f/ring-vrf/tree/master/ark-secret-scalar |
| max_upload_size | |
| id | 1529859 |
| size | 9,951 |
Secret scalar split into the sum of two scalars, which randomly mutate but retain the same sum. Incurs 2x penalty in scalar multiplications, but provides side channel defenses.
We support &self recievers throughout, like typical secret keys do.
We choose non-thread-safe interior mutability via UnsafeCell which
avoids atomics, but makes SecretScalar only Send but !Sync.
As Mutex<T: Send>: Send+Sync, one should prefer Mutex<SecretKey>
over cloning SecretScalar, simply to minimize clones of secret keys.