diff options
Diffstat (limited to 'src/include/gnunet_crypto_lib.h')
-rw-r--r-- | src/include/gnunet_crypto_lib.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/include/gnunet_crypto_lib.h b/src/include/gnunet_crypto_lib.h index 7b7d559cc..4af95af0f 100644 --- a/src/include/gnunet_crypto_lib.h +++ b/src/include/gnunet_crypto_lib.h | |||
@@ -2747,6 +2747,42 @@ GNUNET_CRYPTO_ecdhe_elligator_key_create ( | |||
2747 | struct GNUNET_CRYPTO_ElligatorRepresentative *repr, | 2747 | struct GNUNET_CRYPTO_ElligatorRepresentative *repr, |
2748 | struct GNUNET_CRYPTO_EcdhePrivateKey *pk); | 2748 | struct GNUNET_CRYPTO_EcdhePrivateKey *pk); |
2749 | 2749 | ||
2750 | /** | ||
2751 | * @ingroup crypto | ||
2752 | * Carries out ecdh encapsulation with given public key and a freshly created ephemeral key pair. Ephemeral public key is given as a representative. | ||
2753 | * | ||
2754 | * Following the terminology in https://eprint.iacr.org/2021/509.pdf | ||
2755 | * @param pub receivers edwards curve public key (X) | ||
2756 | * @param r representative of ephemeral public key A to use for the ECDH (direct_map(r)=A=aG) | ||
2757 | * @param key_material where to write the key material H(aX)=H(x(aG)) | ||
2758 | * @return #GNUNET_SYSERR on error, #GNUNET_OK on success | ||
2759 | */ | ||
2760 | enum GNUNET_GenericReturnValue | ||
2761 | GNUNET_CRYPTO_eddsa_elligator_kem_encaps (const struct | ||
2762 | GNUNET_CRYPTO_EddsaPublicKey *pub, | ||
2763 | struct | ||
2764 | GNUNET_CRYPTO_ElligatorRepresentative | ||
2765 | *r, | ||
2766 | struct GNUNET_HashCode *key_material); | ||
2767 | |||
2768 | /** | ||
2769 | * @ingroup crypto | ||
2770 | * Carries out ecdh decapsulation with given private key and the representative of received public key. | ||
2771 | * | ||
2772 | * Following the terminology in https://eprint.iacr.org/2021/509.pdf | ||
2773 | * @param priv own private key (x) | ||
2774 | * @param r received representative (direct_map(r)=A=aG) | ||
2775 | * @param key_material where to write the key material H(xA)=H(a(xG)) | ||
2776 | * @return #GNUNET_SYSERR on error, #GNUNET_OK on success | ||
2777 | */ | ||
2778 | enum GNUNET_GenericReturnValue | ||
2779 | GNUNET_CRYPTO_eddsa_elligator_kem_decaps (const struct | ||
2780 | GNUNET_CRYPTO_EddsaPrivateKey *priv, | ||
2781 | struct | ||
2782 | GNUNET_CRYPTO_ElligatorRepresentative | ||
2783 | *r, | ||
2784 | struct GNUNET_HashCode *key_material); | ||
2785 | |||
2750 | 2786 | ||
2751 | /** | 2787 | /** |
2752 | * Output the given MPI value to the given buffer in network | 2788 | * Output the given MPI value to the given buffer in network |