summaryrefslogtreecommitdiffstats
path: root/crypto/ec/ecp_nistp224.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/ec/ecp_nistp224.c')
-rw-r--r--crypto/ec/ecp_nistp224.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/crypto/ec/ecp_nistp224.c b/crypto/ec/ecp_nistp224.c
index 6c9f9095b6..6c55724689 100644
--- a/crypto/ec/ecp_nistp224.c
+++ b/crypto/ec/ecp_nistp224.c
@@ -238,7 +238,6 @@ static const felem gmul[2][16][3] = {
struct nistp224_pre_comp_st {
felem g_pre_comp[2][16][3];
CRYPTO_REF_COUNT references;
- CRYPTO_RWLOCK *lock;
};
const EC_METHOD *EC_GFp_nistp224_method(void)
@@ -1241,11 +1240,8 @@ static NISTP224_PRE_COMP *nistp224_pre_comp_new(void)
if (ret == NULL)
return ret;
- ret->references = 1;
- ret->lock = CRYPTO_THREAD_lock_new();
- if (ret->lock == NULL) {
- ERR_raise(ERR_LIB_EC, ERR_R_CRYPTO_LIB);
+ if (!CRYPTO_NEW_REF(&ret->references, 1)) {
OPENSSL_free(ret);
return NULL;
}
@@ -1256,7 +1252,7 @@ NISTP224_PRE_COMP *EC_nistp224_pre_comp_dup(NISTP224_PRE_COMP *p)
{
int i;
if (p != NULL)
- CRYPTO_UP_REF(&p->references, &i, p->lock);
+ CRYPTO_UP_REF(&p->references, &i);
return p;
}
@@ -1267,13 +1263,13 @@ void EC_nistp224_pre_comp_free(NISTP224_PRE_COMP *p)
if (p == NULL)
return;
- CRYPTO_DOWN_REF(&p->references, &i, p->lock);
+ CRYPTO_DOWN_REF(&p->references, &i);
REF_PRINT_COUNT("EC_nistp224", p);
if (i > 0)
return;
REF_ASSERT_ISNT(i < 0);
- CRYPTO_THREAD_lock_free(p->lock);
+ CRYPTO_FREE_REF(&p->references);
OPENSSL_free(p);
}