cipher.setAAD(buffer[, options])

    当使用认证的加密模式时(目前支持 GCMCCMOCBchacha20-poly1305),则 cipher.setAAD() 方法设置用于额外的认证数据(AAD)输入参数的值。

    When using an authenticated encryption mode (GCM, CCM, OCB, and chacha20-poly1305 are currently supported), the cipher.setAAD() method sets the value used for the additional authenticated data (AAD) input parameter.

    The plaintextLength option is optional for GCM and OCB. When using CCM, the plaintextLength option must be specified and its value must match the length of the plaintext in bytes. See CCM mode.

    The cipher.setAAD() method must be called before cipher.update().