Skip to content

Commit

Permalink
* cosmetic
Browse files Browse the repository at this point in the history
  • Loading branch information
jkmnt committed Nov 27, 2021
1 parent 25eb326 commit aa4eaa4
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions eax.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,14 @@ def eax_enc(cfg, key, nonce, header, pt):
tag = xorstrings(xorstrings(N, C), H)
return (ct, tag)

# authenticate, but do not encrypt plaintext
def eax_just_auth(cfg, key, nonce, header, pt):
N = omac(cfg, key, nonce, 0)
H = omac(cfg, key, header, 1)
C = omac(cfg, key, pt, 2)
tag = xorstrings(xorstrings(N, C), H)
return (pt, tag)


def eax_dec(cfg, key, nonce, header, ct):
N = omac(cfg, key, nonce, 0)
Expand Down

0 comments on commit aa4eaa4

Please sign in to comment.