e_cswift.c (160815) | e_cswift.c (215697) |
---|---|
1/* crypto/engine/hw_cswift.c */ 2/* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL 3 * project 2000. 4 */ 5/* ==================================================================== 6 * Copyright (c) 1999-2001 The OpenSSL Project. All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 797 unchanged lines hidden (view full) --- 806 807#ifndef OPENSSL_NO_DSA 808static DSA_SIG *cswift_dsa_sign(const unsigned char *dgst, int dlen, DSA *dsa) 809 { 810 SW_CONTEXT_HANDLE hac; 811 SW_PARAM sw_param; 812 SW_STATUS sw_status; 813 SW_LARGENUMBER arg, res; | 1/* crypto/engine/hw_cswift.c */ 2/* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL 3 * project 2000. 4 */ 5/* ==================================================================== 6 * Copyright (c) 1999-2001 The OpenSSL Project. All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 797 unchanged lines hidden (view full) --- 806 807#ifndef OPENSSL_NO_DSA 808static DSA_SIG *cswift_dsa_sign(const unsigned char *dgst, int dlen, DSA *dsa) 809 { 810 SW_CONTEXT_HANDLE hac; 811 SW_PARAM sw_param; 812 SW_STATUS sw_status; 813 SW_LARGENUMBER arg, res; |
814 unsigned char *ptr; | |
815 BN_CTX *ctx; 816 BIGNUM *dsa_p = NULL; 817 BIGNUM *dsa_q = NULL; 818 BIGNUM *dsa_g = NULL; 819 BIGNUM *dsa_key = NULL; 820 BIGNUM *result = NULL; 821 DSA_SIG *to_return = NULL; 822 int acquired = 0; --- 71 unchanged lines hidden (view full) --- 894 { 895 char tmpbuf[DECIMAL_SIZE(sw_status)+1]; 896 CSWIFTerr(CSWIFT_F_CSWIFT_DSA_SIGN,CSWIFT_R_REQUEST_FAILED); 897 sprintf(tmpbuf, "%ld", sw_status); 898 ERR_add_error_data(2, "CryptoSwift error number is ",tmpbuf); 899 goto err; 900 } 901 /* Convert the response */ | 814 BN_CTX *ctx; 815 BIGNUM *dsa_p = NULL; 816 BIGNUM *dsa_q = NULL; 817 BIGNUM *dsa_g = NULL; 818 BIGNUM *dsa_key = NULL; 819 BIGNUM *result = NULL; 820 DSA_SIG *to_return = NULL; 821 int acquired = 0; --- 71 unchanged lines hidden (view full) --- 893 { 894 char tmpbuf[DECIMAL_SIZE(sw_status)+1]; 895 CSWIFTerr(CSWIFT_F_CSWIFT_DSA_SIGN,CSWIFT_R_REQUEST_FAILED); 896 sprintf(tmpbuf, "%ld", sw_status); 897 ERR_add_error_data(2, "CryptoSwift error number is ",tmpbuf); 898 goto err; 899 } 900 /* Convert the response */ |
902 ptr = (unsigned char *)result->d; | |
903 if((to_return = DSA_SIG_new()) == NULL) 904 goto err; 905 to_return->r = BN_bin2bn((unsigned char *)result->d, 20, NULL); 906 to_return->s = BN_bin2bn((unsigned char *)result->d + 20, 20, NULL); 907 908err: 909 if(acquired) 910 release_context(hac); --- 221 unchanged lines hidden --- | 901 if((to_return = DSA_SIG_new()) == NULL) 902 goto err; 903 to_return->r = BN_bin2bn((unsigned char *)result->d, 20, NULL); 904 to_return->s = BN_bin2bn((unsigned char *)result->d + 20, 20, NULL); 905 906err: 907 if(acquired) 908 release_context(hac); --- 221 unchanged lines hidden --- |