def box_curve25519salsa20hmacsha512_beforenm(pk, sk): return hash_sha512(smult_curve25519(sk, pk))[:32]
def box_curve25519salsa20hmacsha512_open(c, n, pk, sk): k = hash_sha512(smult_curve25519(sk, pk))[:32] return secretbox_salsa20hmacsha512_open(c, n, k)