diff options
author | Christian Grothoff <christian@grothoff.org> | 2019-04-06 14:37:07 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2019-04-06 14:37:07 +0200 |
commit | c57caa206c761424b73e900978edff0a1b8fca50 (patch) | |
tree | 66641306c9a1d196dfe9f82c863bada50fb86187 /src/util/crypto_ecc.c | |
parent | c0d08bbdeed4523cf89bf55b64ce2c16476c3e26 (diff) | |
download | gnunet-c57caa206c761424b73e900978edff0a1b8fca50.tar.gz gnunet-c57caa206c761424b73e900978edff0a1b8fca50.zip |
introduce GNUNET_memcmp() and GNUNET_is_zero()
Diffstat (limited to 'src/util/crypto_ecc.c')
-rw-r--r-- | src/util/crypto_ecc.c | 23 |
1 files changed, 3 insertions, 20 deletions
diff --git a/src/util/crypto_ecc.c b/src/util/crypto_ecc.c index cf40522d6..339180dff 100644 --- a/src/util/crypto_ecc.c +++ b/src/util/crypto_ecc.c | |||
@@ -11,7 +11,7 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
@@ -763,23 +763,6 @@ GNUNET_CRYPTO_ecdsa_key_get_anonymous () | |||
763 | 763 | ||
764 | 764 | ||
765 | /** | 765 | /** |
766 | * Compare two Peer Identities. | ||
767 | * | ||
768 | * @param first first peer identity | ||
769 | * @param second second peer identity | ||
770 | * @return bigger than 0 if first > second, | ||
771 | * 0 if they are the same | ||
772 | * smaller than 0 if second > first | ||
773 | */ | ||
774 | int | ||
775 | GNUNET_CRYPTO_cmp_peer_identity (const struct GNUNET_PeerIdentity *first, | ||
776 | const struct GNUNET_PeerIdentity *second) | ||
777 | { | ||
778 | return memcmp (first, second, sizeof (struct GNUNET_PeerIdentity)); | ||
779 | } | ||
780 | |||
781 | |||
782 | /** | ||
783 | * Convert the data specified in the given purpose argument to an | 766 | * Convert the data specified in the given purpose argument to an |
784 | * S-expression suitable for signature operations. | 767 | * S-expression suitable for signature operations. |
785 | * | 768 | * |
@@ -795,7 +778,7 @@ data_to_eddsa_value (const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose) | |||
795 | /* SEE #5398 */ | 778 | /* SEE #5398 */ |
796 | #if 1 | 779 | #if 1 |
797 | struct GNUNET_HashCode hc; | 780 | struct GNUNET_HashCode hc; |
798 | 781 | ||
799 | GNUNET_CRYPTO_hash (purpose, | 782 | GNUNET_CRYPTO_hash (purpose, |
800 | ntohl (purpose->size), | 783 | ntohl (purpose->size), |
801 | &hc); | 784 | &hc); |
@@ -823,7 +806,7 @@ data_to_eddsa_value (const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose) | |||
823 | rc); | 806 | rc); |
824 | return NULL; | 807 | return NULL; |
825 | } | 808 | } |
826 | #endif | 809 | #endif |
827 | return data; | 810 | return data; |
828 | } | 811 | } |
829 | 812 | ||