ecx_backend.h 1017 B

1234567891011121314151617181920
  1. /*
  2. * Copyright 2020 The OpenSSL Project Authors. All Rights Reserved.
  3. *
  4. * Licensed under the Apache License 2.0 (the "License"). You may not use
  5. * this file except in compliance with the License. You can obtain a copy
  6. * in the file LICENSE in the source distribution or at
  7. * https://www.openssl.org/source/license.html
  8. */
  9. #define ISX448(id) ((id) == EVP_PKEY_X448)
  10. #define IS25519(id) ((id) == EVP_PKEY_X25519 || (id) == EVP_PKEY_ED25519)
  11. #define KEYLENID(id) (IS25519(id) ? X25519_KEYLEN \
  12. : ((id) == EVP_PKEY_X448 ? X448_KEYLEN \
  13. : ED448_KEYLEN))
  14. #define KEYNID2TYPE(id) \
  15. (IS25519(id) ? ((id) == EVP_PKEY_X25519 ? ECX_KEY_TYPE_X25519 \
  16. : ECX_KEY_TYPE_ED25519) \
  17. : ((id) == EVP_PKEY_X448 ? ECX_KEY_TYPE_X448 \
  18. : ECX_KEY_TYPE_ED448))
  19. #define KEYLEN(p) KEYLENID((p)->ameth->pkey_id)