def cr.lrw.tweak
import bend-osdev-crypto@0.1.0.0/lrw.bend as Lrwimport Base
import bend-osdev-bytes@0.1.0.0/bytes.bend as B
import bend-osdev-gf@0.1.0.0/gf128.bend as G
26# the tweak of index i under the tweak key k2, as a block
27def cr.lrw.tweak(~Blk: Data, ~blk_of: B.Octets -> Maybe<&2, Blk>, +k2: G.Gf128, i: G.Gf128) -> Maybe<&2, Blk>:
28 blk_of(G.Gf128.to_octets(G.Gf128.mul_be(k2, i)))