X448Agreement.cs 863 B

12345678910111213141516171819202122232425262728293031
  1. #if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
  2. #pragma warning disable
  3. using System;
  4. using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters;
  5. namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Agreement
  6. {
  7. public sealed class X448Agreement
  8. : IRawAgreement
  9. {
  10. private X448PrivateKeyParameters privateKey;
  11. public void Init(ICipherParameters parameters)
  12. {
  13. this.privateKey = (X448PrivateKeyParameters)parameters;
  14. }
  15. public int AgreementSize
  16. {
  17. get { return X448PrivateKeyParameters.SecretSize; }
  18. }
  19. public void CalculateAgreement(ICipherParameters publicKey, byte[] buf, int off)
  20. {
  21. privateKey.GenerateSecret((X448PublicKeyParameters)publicKey, buf, off);
  22. }
  23. }
  24. }
  25. #pragma warning restore
  26. #endif