Skip to content

Commit

Permalink
typo
Browse files Browse the repository at this point in the history
  • Loading branch information
hannahdaviscrypto committed Aug 21, 2023
1 parent 43864d0 commit d701f32
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
7 changes: 2 additions & 5 deletions draft-irtf-cfrg-vdaf.md
Original file line number Diff line number Diff line change
Expand Up @@ -1691,12 +1691,9 @@ class PrgSha3(Prg):
# allows stateful handling of the stream.
# The length of dst, the domain separation string, should be <256 bytes
# A longer dst will cause an OverflowError
dst_length = len(dst).__to_bytes(1) #one byte value
dst_length = len(dst).to_bytes(1) #one byte value
stream = SHAKE128(dst_length + dst + self.x, self.l)
return stream[-length:]

def __to_bytes__(self, i):
return i.to_bytes(1, byteorder = 'little)
~~~
{: title="Definition of PRG PrgSha3."}

Expand Down Expand Up @@ -1731,7 +1728,7 @@ class PrgFixedKeyAes128(Prg):
# evaluations with many different seeds.
# The length of dst, the domain separation string, should be <256 bytes
# A longer dst will cause an OverflowError
dst_length = len(dst).__to_bytes(1) #one byte value
dst_length = len(dst).to_bytes(1) #one byte value
self.fixed_key = SHAKE128(dst_length + dst + binder, 16)
self.seed = seed

Expand Down
4 changes: 2 additions & 2 deletions poc/prg.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def __init__(self, seed, dst, binder):
# `dst` is used for domain separation; `seed || binder` is
# used as the main input string.
self.shake = SHAKE128.new()
dst_length = len(dst).__to_bytes__(1) # one byte value
dst_length = len(dst).to_bytes(1) # one byte value
self.shake.update(dst_length)
self.shake.update(dst)
self.shake.update(seed)
Expand Down Expand Up @@ -140,7 +140,7 @@ def __init__(self, seed, dst, binder):
# Implementation note: This step can be cached across PRG
# evaluations with many different seeds.
shake = SHAKE128.new()
dst_length = len(dst).__to_bytes__(1) # one byte value
dst_length = len(dst).to_bytes(1) # one byte value
shake.update(dst_length)
shake.update(dst)
shake.update(binder)
Expand Down

0 comments on commit d701f32

Please sign in to comment.