def ghash_field_shift_right
qasim-bend-kit@0.1.0.2 · libs/AES256GCMCore.bend:359
import qasim-bend-kit@0.1.0.2/libs/AES256GCMCore.bend as AES256GCMCore
import Base
359def ghash_field_shift_right(value: GhashField) -> GhashField:
360 match value:
361 case GhashField{+w0, +w1, +w2, +w3}:
362 GhashField{
363 ghash_field_shift_top(w0, U32.is_ne(U32.and(1, w3), 0)),
364 U32.or(U32.shrn(w1, 1n), U32.shln(U32.and(1, w0), 31n)),
365 U32.or(U32.shrn(w2, 1n), U32.shln(U32.and(1, w1), 31n)),
366 U32.or(U32.shrn(w3, 1n), U32.shln(U32.and(1, w2), 31n))}