File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -476,13 +476,13 @@ func (k Key) validate(op KeyOp) error {
476476 }
477477
478478 // If present, x, y, and d must match the expected size.
479- if len ( x ) > 0 && len (x ) != size {
479+ if x != nil && len (x ) != size {
480480 return errCoordSizeMismatch
481481 }
482- if len ( y ) > 0 && len (y ) != size {
482+ if y != nil && len (y ) != size {
483483 return errCoordSizeMismatch
484484 }
485- if len ( d ) > 0 && len (d ) != size {
485+ if d != nil && len (d ) != size {
486486 return errCoordSizeMismatch
487487 }
488488 }
@@ -513,10 +513,10 @@ func (k Key) validate(op KeyOp) error {
513513 // If the curve size is known, validate the length of each parameter if present.
514514 if size := keySizeOKP (crv ); size > 0 {
515515 // If present, x and d must match the expected size.
516- if len ( x ) > 0 && len (x ) != size {
516+ if x != nil && len (x ) != size {
517517 return errCoordSizeMismatch
518518 }
519- if len ( d ) > 0 && len (d ) != size {
519+ if d != nil && len (d ) != size {
520520 return errCoordSizeMismatch
521521 }
522522 }
You can’t perform that action at this time.
0 commit comments