| 242 | } |
| 243 | |
| 244 | size_t BlindedPublicKey::GetBlindedKey (const char * date, uint8_t * blindedKey) const |
| 245 | { |
| 246 | uint8_t seed[64]; |
| 247 | GenerateAlpha (date, seed); |
| 248 | |
| 249 | size_t publicKeyLength = 0; |
| 250 | switch (m_SigType) |
| 251 | { |
| 252 | case i2p::data::SIGNING_KEY_TYPE_ECDSA_SHA256_P256: |
| 253 | case i2p::data::SIGNING_KEY_TYPE_ECDSA_SHA384_P384: |
| 254 | case i2p::data::SIGNING_KEY_TYPE_ECDSA_SHA512_P521: |
| 255 | publicKeyLength = BlindECDSA (m_SigType, GetPublicKey (), seed, BlindEncodedPublicKeyECDSA, blindedKey); |
| 256 | break; |
| 257 | case i2p::data::SIGNING_KEY_TYPE_REDDSA_SHA512_ED25519: |
| 258 | case i2p::data::SIGNING_KEY_TYPE_EDDSA_SHA512_ED25519: |
| 259 | i2p::crypto::GetEd25519 ()->BlindPublicKey (GetPublicKey (), seed, blindedKey); |
| 260 | publicKeyLength = i2p::crypto::EDDSA25519_PUBLIC_KEY_LENGTH; |
| 261 | break; |
| 262 | default: |
| 263 | LogPrint (eLogError, "Blinding: Can't blind signature type ", (int)m_SigType); |
| 264 | } |
| 265 | return publicKeyLength; |
| 266 | } |
| 267 | |
| 268 | size_t BlindedPublicKey::BlindPrivateKey (const uint8_t * priv, const char * date, uint8_t * blindedPriv, uint8_t * blindedPub) const |
| 269 | { |