}
}
- /*
- * Internal function test on GostR3411_94_TestParamSet
- */
-# if 0 && defined(OPENSSL_NO_DYNAMIC_ENGINE)
- {
- gost_ctx ctx;
-
- for (t = 0; t < sizeof(tcs) / sizeof(tcs[0]); t++) {
- const gost_subst_block *pSubst = NULL;
-
- if (1024 < tcs[t].ullLen) {
- /* Key meshing check by engine tests */
- continue;
- }
- memset(bTest, 0xc3, sizeof(bTest));
- if (0 == strcmp(tcs[t].szParamSet,
- "id-GostR3410-94-TestParamSet")) {
- pSubst = &GostR3411_94_TestParamSet;
- } else if (0 == strcmp(tcs[t].szParamSet,
- "id-Gost28147-89-CryptoPro-A-ParamSet")) {
- pSubst = &Gost28147_CryptoProParamSetA;
- } else if (0 == strcmp(tcs[t].szParamSet,
- "id-Gost28147-89-CryptoPro-B-ParamSet")) {
- pSubst = &Gost28147_CryptoProParamSetB;
- } else if (0 == strcmp(tcs[t].szParamSet,
- "id-Gost28147-89-CryptoPro-C-ParamSet")) {
- pSubst = &Gost28147_CryptoProParamSetC;
- } else if (0 == strcmp(tcs[t].szParamSet,
- "id-Gost28147-89-CryptoPro-D-ParamSet")) {
- pSubst = &Gost28147_CryptoProParamSetD;
- }
- gost_init(&ctx, pSubst);
- gost_key(&ctx, tcs[t].bRawKey);
- switch (tcs[t].gMode) {
- case G89_ECB:
- gost_enc(&ctx, tcs[t].bIn, bTest,
- (int)((tcs[t].ullLen + G89_BLOCK_LEN - 1) /
- G89_BLOCK_LEN));
- l = (size_t)tcs[t].ullLen;
- break;
- case G89_CFB:
- gost_enc_cfb(&ctx, tcs[t].bIV, tcs[t].bIn,
- bTest,
- (int)((tcs[t].ullLen + G89_BLOCK_LEN - 1) /
- G89_BLOCK_LEN));
- l = (size_t)tcs[t].ullLen;
- break;
- case G89_CNT:
- /*
- * GOST 28147-89 cipher CNT mode check by engine tests
- */
- continue;
- case G89_IMIT:
- gost_mac(&ctx, 32, tcs[t].bIn,
- (unsigned int)tcs[t].ullLen, bTest);
- gost_mac_iv(&ctx, 32, tcs[t].bIV, tcs[t].bIn,
- (unsigned int)tcs[t].ullLen, bTest1);
- if (0 != memcmp(bTest, bTest1, 4)) {
- fflush(NULL);
- fprintf(stderr, "\nInternal test t=%d len=" FMT64
- " failed (gost_mac_iv).\n", t, tcs[t].ullLen);
- if (!ignore) {
- return 2;
- }
- }
- l = 4;
- break;
- }
- gost_destroy(&ctx);
-
- if (0 != memcmp(tcs[t].bOut, bTest, l)) {
- fflush(NULL);
- fprintf(stderr, "\nInternal test t=%d len=" FMT64
- " failed.\n", t, tcs[t].ullLen);
- if (!ignore) {
- return 3;
- }
- } else {
- printf(",");
- fflush(NULL);
- }
- }
- }
-# endif
-
/*
* ccgost engine test on GostR3411_94_CryptoProParamSet
*/
# ifdef RSA_NULL
def_rsa_method = RSA_null_method();
# else
-# if 0
- def_rsa_method = RSA_PKCS1_RSAref();
-# else
def_rsa_method = RSA_PKCS1_SSLeay();
-# endif
# endif
if (def_rsa_method)
return def_rsa_method->rsa_mod_exp(r0, I, rsa, ctx);
# ifdef RSA_NULL
def_rsa_method = RSA_null_method();
# else
-# if 0
- def_rsa_method = RSA_PKCS1_RSAref();
-# else
def_rsa_method = RSA_PKCS1_SSLeay();
-# endif
# endif
if (def_rsa_method)
return def_rsa_method->bn_mod_exp(r, a, p, m, ctx, m_ctx);
void *callback_data);
static void surewarehk_ex_free(void *obj, void *item, CRYPTO_EX_DATA *ad,
int idx, long argl, void *argp);
-# if 0
-static void surewarehk_dh_ex_free(void *obj, void *item, CRYPTO_EX_DATA *ad,
- int idx, long argl, void *argp);
-# endif
# ifndef OPENSSL_NO_RSA
/* This function is aliased to mod_exp (with the mont stuff dropped). */
p_surewarehk_Free((char *)item, 0);
}
-# if 0
-/* not currently used (bug?) */
-/*
- * This cleans up an DH KM key (destroys the key into hardware), called when
- * ex_data is freed
- */
-static void surewarehk_dh_ex_free(void *obj, void *item, CRYPTO_EX_DATA *ad,
- int idx, long argl, void *argp)
-{
- if (!p_surewarehk_Free) {
- SUREWAREerr(SUREWARE_F_SUREWAREHK_DH_EX_FREE,
- ENGINE_R_NOT_INITIALISED);
- } else
- p_surewarehk_Free((char *)item, 1);
-}
-# endif
-
/*
* return number of decrypted bytes
*/