Aead.seal: def of bend-collections@1.0.0.0 Import: import bend-collections@1.0.0.0/src/crypto/aead.bend as Aead Lines 60-66 of bend-collections@1.0.0.0/src/crypto/aead.bend: https://jend.leeeet.dev/read.txt?path=bend-collections@1.0.0.0/src/crypto/aead.bend&start_line=60&end_line=66 import Base import bend-collections@1.0.0.0/src/crypto/aead/chacha20poly1305.bend as CP import bend-collections@1.0.0.0/src/crypto/aesgcm.bend as GCM # ciphertext || tag (encrypt checks the key and nonce lengths first). def seal(alg: Alg, +key: List<&2, U32>, +nonce: List<&2, U32>, +aad: List<&2, U32>, +pt: List<&2, U32>) -> Maybe<&2, List<&2, U32>>: match alg: case CHACHA20_POLY1305{}: Some{CP.seal(key, nonce, aad, pt)} case XCHACHA20_POLY1305{}: Some{CP.xseal(key, nonce, aad, pt)} case AES_128_GCM{}: GCM.aes128_gcm_encrypt(key, nonce, aad, pt) case AES_256_GCM{}: GCM.aes256_gcm_encrypt(key, nonce, aad, pt) Uses (8): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Maybe https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=bend-collections@1.0.0.0/src/crypto/aead/chacha20poly1305.bend&name=seal https://jend.leeeet.dev/definition.txt?path=bend-collections@1.0.0.0/src/crypto/aead/chacha20poly1305.bend&name=xseal https://jend.leeeet.dev/definition.txt?path=bend-collections@1.0.0.0/src/crypto/aead.bend&name=Alg https://jend.leeeet.dev/definition.txt?path=bend-collections@1.0.0.0/src/crypto/aesgcm.bend&name=aes128_gcm_encrypt https://jend.leeeet.dev/definition.txt?path=bend-collections@1.0.0.0/src/crypto/aesgcm.bend&name=aes256_gcm_encrypt