Skip to content

Commit

Permalink
input.size -> input.bytesize (#188)
Browse files Browse the repository at this point in the history
  • Loading branch information
bannable authored Apr 6, 2024
1 parent 3577799 commit 67071d2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/paseto/paserk_types.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ class PaserkTypes < T::Enum
sig { params(input: String).returns(Interface::Key) }
def generate(input) # rubocop:disable Metrics/MethodLength, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
case self
in K3LocalWrap | K3LocalPBKW | K3Local if input.size == 32
in K3LocalWrap | K3LocalPBKW | K3Local if input.bytesize == 32
V3::Local.new(ikm: input)
in K3SecretWrap | K3SecretPBKW | K3Secret if input.size == 48
in K3SecretWrap | K3SecretPBKW | K3Secret if input.bytesize == 48
V3::Public.from_scalar_bytes(input)
in K3Public
V3::Public.from_public_bytes(input)
in K4LocalWrap | K4LocalPBKW | K4Local if Paseto::HAS_RBNACL && input.size == 32
in K4LocalWrap | K4LocalPBKW | K4Local if Paseto::HAS_RBNACL && input.bytesize == 32
V4::Local.new(ikm: input)
in K4SecretWrap | K4SecretPBKW | K4Secret if Paseto::HAS_RBNACL && input.size == 64
in K4SecretWrap | K4SecretPBKW | K4Secret if Paseto::HAS_RBNACL && input.bytesize == 64
V4::Public.from_keypair(input)
in K4Public
V4::Public.from_public_bytes(input)
Expand Down

0 comments on commit 67071d2

Please sign in to comment.