@@ -47,12 +47,7 @@ VALUE eEC_GROUP;
47
47
VALUE cEC_POINT ;
48
48
VALUE eEC_POINT ;
49
49
50
- static ID s_GFp ;
51
- static ID s_GFp_simple ;
52
- static ID s_GFp_mont ;
53
- static ID s_GFp_nist ;
54
- static ID s_GF2m ;
55
- static ID s_GF2m_simple ;
50
+ static ID s_GFp , s_GF2m ;
56
51
57
52
static ID ID_uncompressed ;
58
53
static ID ID_compressed ;
@@ -580,20 +575,11 @@ ec_group_new(const EC_GROUP *group)
580
575
* call-seq:
581
576
* OpenSSL::PKey::EC::Group.new(ec_group)
582
577
* OpenSSL::PKey::EC::Group.new(pem_or_der_encoded)
583
- * OpenSSL::PKey::EC::Group.new(ec_method)
584
578
* OpenSSL::PKey::EC::Group.new(:GFp, bignum_p, bignum_a, bignum_b)
585
579
* OpenSSL::PKey::EC::Group.new(:GF2m, bignum_p, bignum_a, bignum_b)
586
580
*
587
581
* Creates a new EC::Group object.
588
582
*
589
- * _ec_method_ is a symbol that represents an EC_METHOD. Currently the following
590
- * are supported:
591
- *
592
- * * :GFp_simple
593
- * * :GFp_mont
594
- * * :GFp_nist
595
- * * :GF2m_simple
596
- *
597
583
* If the first argument is :GFp or :GF2m, creates a new curve with given
598
584
* parameters.
599
585
*/
@@ -608,29 +594,7 @@ static VALUE ossl_ec_group_initialize(int argc, VALUE *argv, VALUE self)
608
594
609
595
switch (rb_scan_args (argc , argv , "13" , & arg1 , & arg2 , & arg3 , & arg4 )) {
610
596
case 1 :
611
- if (SYMBOL_P (arg1 )) {
612
- const EC_METHOD * method = NULL ;
613
- ID id = SYM2ID (arg1 );
614
-
615
- if (id == s_GFp_simple ) {
616
- method = EC_GFp_simple_method ();
617
- } else if (id == s_GFp_mont ) {
618
- method = EC_GFp_mont_method ();
619
- } else if (id == s_GFp_nist ) {
620
- method = EC_GFp_nist_method ();
621
- #if !defined(OPENSSL_NO_EC2M )
622
- } else if (id == s_GF2m_simple ) {
623
- method = EC_GF2m_simple_method ();
624
- #endif
625
- }
626
-
627
- if (method ) {
628
- if ((group = EC_GROUP_new (method )) == NULL )
629
- ossl_raise (eEC_GROUP , "EC_GROUP_new" );
630
- } else {
631
- ossl_raise (rb_eArgError , "unknown symbol, must be :GFp_simple, :GFp_mont, :GFp_nist or :GF2m_simple" );
632
- }
633
- } else if (rb_obj_is_kind_of (arg1 , cEC_GROUP )) {
597
+ if (rb_obj_is_kind_of (arg1 , cEC_GROUP )) {
634
598
const EC_GROUP * arg1_group ;
635
599
636
600
GetECGroup (arg1 , arg1_group );
@@ -1592,10 +1556,6 @@ void Init_ossl_ec(void)
1592
1556
1593
1557
s_GFp = rb_intern ("GFp" );
1594
1558
s_GF2m = rb_intern ("GF2m" );
1595
- s_GFp_simple = rb_intern ("GFp_simple" );
1596
- s_GFp_mont = rb_intern ("GFp_mont" );
1597
- s_GFp_nist = rb_intern ("GFp_nist" );
1598
- s_GF2m_simple = rb_intern ("GF2m_simple" );
1599
1559
1600
1560
ID_uncompressed = rb_intern ("uncompressed" );
1601
1561
ID_compressed = rb_intern ("compressed" );
0 commit comments