[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-exchange] 01/13: first draft of token crypto structs
From: |
gnunet |
Subject: |
[taler-exchange] 01/13: first draft of token crypto structs |
Date: |
Fri, 22 Dec 2023 16:29:23 +0100 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository exchange.
commit 4bfdee106827795e3afee071597d97019ea6a667
Author: Christian Blättler <blatc2@bfh.ch>
AuthorDate: Tue Oct 17 15:58:30 2023 +0200
first draft of token crypto structs
---
src/include/taler_crypto_lib.h | 165 +++++++++++++++++++++++++++++++++++++++++
1 file changed, 165 insertions(+)
diff --git a/src/include/taler_crypto_lib.h b/src/include/taler_crypto_lib.h
index cef8f55a..9f9214c1 100644
--- a/src/include/taler_crypto_lib.h
+++ b/src/include/taler_crypto_lib.h
@@ -6081,4 +6081,169 @@ TALER_denomination_group_get_key (
struct GNUNET_HashCode *key);
+/**
+ * Possible token family key ciphers.
+ */
+enum TALER_TokenFamilyCipher
+{
+ /**
+ * RSA based token key.
+ */
+ TALER_TOKEN_FAMILY_CIPHER_RSA = 0,
+
+ /**
+ * Schnorr based token key.
+ */
+ TALER_TOKEN_FAMILY_CIPHER_CS = 1
+};
+
+/**
+ * Token family public key.
+ */
+struct TALER_TokenFamilyPublicKey
+{
+ /**
+ * Type of the signature.
+ */
+ enum TALER_TokenFamilyCipher cipher;
+
+ /**
+ * Details, depending on @e cipher.
+ */
+ union
+ {
+ /**
+ * If we use #TALER_TOKEN_FAMILY_CIPHER_CS in @a cipher.
+ */
+ struct GNUNET_CRYPTO_CsPublicKey cs;
+
+ /**
+ * If we use #TALER_TOKEN_FAMILY_CIPHER_RSA in @a cipher.
+ */
+ struct GNUNET_CRYPTO_RsaPublicKey rsa;
+ } key;
+};
+
+/**
+ * Hash of a public key of a token family.
+ */
+struct TALER_TokenFamilyPublicKeyHash
+{
+ /**
+ * Hash of the token public key.
+ */
+ struct GNUNET_HashCode hash;
+};
+
+/**
+ * Token family private key.
+ */
+struct TALER_TokenFamilyPrivateKey
+{
+ /**
+ * Type of the signature.
+ */
+ enum TALER_TokenFamilyCipher cipher;
+
+ /**
+ * Details, depending on @e cipher.
+ */
+ union
+ {
+ /**
+ * If we use #TALER_TOKEN_FAMILY_CIPHER_CS in @a cipher.
+ */
+ struct GNUNET_CRYPTO_CsPrivateKey cs;
+
+ /**
+ * If we use #TALER_TOKEN_FAMILY_CIPHER_RSA in @a cipher.
+ */
+ struct GNUNET_CRYPTO_RsaPrivateKey rsa;
+ } key;
+};
+
+/**
+ * Token public key.
+ */
+struct TALER_TokenPublicKey
+{
+ /**
+ * Type of the signature.
+ */
+ enum TALER_TokenFamilyCipher cipher;
+
+ /**
+ * Details, depending on @e cipher.
+ */
+ union
+ {
+ /**
+ * If we use #TALER_TOKEN_FAMILY_CIPHER_CS in @a cipher.
+ */
+ struct GNUNET_CRYPTO_CsPublicKey cs;
+
+ /**
+ * If we use #TALER_TOKEN_FAMILY_CIPHER_RSA in @a cipher.
+ */
+ struct GNUNET_CRYPTO_RsaPublicKey rsa;
+ } key;
+};
+
+/**
+ * Signature made using a token private key.
+ */
+struct TALER_TokenSignature
+{
+ // TODO: Do we need a separate type for this?
+ // Like TALER_TokenCipher (not token family)
+ /**
+ * Type of the signature.
+ */
+ enum TALER_TokenFamilyCipher cipher;
+
+ /**
+ * Details, depending on @e cipher.
+ */
+ union
+ {
+ /**
+ * If we use #TALER_TOKEN_FAMILY_CIPHER_CS in @a cipher.
+ */
+ struct GNUNET_CRYPTO_CsSignature cs;
+
+ /**
+ * If we use #TALER_TOKEN_FAMILY_CIPHER_RSA in @a cipher.
+ */
+ struct GNUNET_CRYPTO_RsaSignature rsa;
+ } signature;
+};
+
+/**
+ * Blind signature for a token.
+ */
+struct TALER_TokenBlindSignature
+{
+ /**
+ * Type of the signature.
+ */
+ enum TALER_TokenFamilyCipher cipher;
+
+
+ /**
+ * Details, depending on @e cipher.
+ */
+ union
+ {
+ /**
+ * If we use #TALER_TOKEN_FAMILY_CIPHER_CS in @a cipher.
+ */
+ struct GNUNET_CRYPTO_CsSignature cs;
+
+ /**
+ * If we use #TALER_TOKEN_FAMILY_CIPHER_RSA in @a cipher.
+ */
+ struct GNUNET_CRYPTO_RsaSignature rsa;
+ } signature;
+};
+
#endif
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [taler-exchange] branch master updated (28116298 -> ad09066a), gnunet, 2023/12/22
- [taler-exchange] 02/13: ignore .DS_Store files, gnunet, 2023/12/22
- [taler-exchange] 03/13: Merge branch 'master' into feature/tokens, gnunet, 2023/12/22
- [taler-exchange] 01/13: first draft of token crypto structs,
gnunet <=
- [taler-exchange] 06/13: Merge branch 'master' into feature/tokens, gnunet, 2023/12/22
- [taler-exchange] 05/13: use new gnunet bling sign structs, gnunet, 2023/12/22
- [taler-exchange] 07/13: Merge branch 'master' into feature/tokens, gnunet, 2023/12/22
- [taler-exchange] 10/13: Merge branch 'master' into feature/tokens, gnunet, 2023/12/22
- [taler-exchange] 09/13: Merge branch 'master' into feature/tokens, gnunet, 2023/12/22
- [taler-exchange] 12/13: Merge branch 'feature/tokens' of git+ssh://git.taler.net/exchange, gnunet, 2023/12/22
- [taler-exchange] 11/13: Merge branch 'master' into feature/tokens, gnunet, 2023/12/22
- [taler-exchange] 13/13: -minor code cleanup, gnunet, 2023/12/22
- [taler-exchange] 08/13: add query param functions for blind sign private and public keys, gnunet, 2023/12/22
- [taler-exchange] 04/13: Merge branch 'master' into feature/tokens, gnunet, 2023/12/22