@@ -12,6 +12,7 @@ import { configProvider } from '../../src/config_provider.ts'
1212import { type ConfigProvider } from '../../src/types.ts'
1313
1414import {
15+ type AESSIVDriverConfig ,
1516 type AES256CBCDriverConfig ,
1617 type AES256GCMDriverConfig ,
1718 type ChaCha20Poly1305DriverConfig ,
@@ -198,6 +199,21 @@ export const drivers: {
198199 */
199200 aes256gcm : ( config : AES256GCMDriverConfig ) => ConfigProvider < EncryptionConfig >
200201
202+ /**
203+ * Creates an AES-SIV encryption driver configuration.
204+ *
205+ * @param config - The AES-SIV driver configuration
206+ *
207+ * @example
208+ * ```ts
209+ * drivers.aessiv({
210+ * id: 'app',
211+ * key: env.get('APP_KEY')
212+ * })
213+ * ```
214+ */
215+ aessiv : ( config : AESSIVDriverConfig ) => ConfigProvider < EncryptionConfig >
216+
201217 /**
202218 * Creates a Legacy encryption driver configuration.
203219 *
@@ -251,6 +267,17 @@ export const drivers: {
251267 } )
252268 } ,
253269
270+ aessiv : ( config ) => {
271+ return configProvider . create ( async ( ) => {
272+ const { AESSIV } = await import ( './drivers/aes_siv.ts' )
273+ debug ( 'configuring aessiv encryption driver' )
274+ return {
275+ driver : ( key ) => new AESSIV ( { id : config . id , key } ) ,
276+ keys : [ config . key ] . filter ( ( key ) => ! ! key ) ,
277+ }
278+ } )
279+ } ,
280+
254281 legacy : ( config ) => {
255282 return configProvider . create ( async ( ) => {
256283 const { Legacy } = await import ( './drivers/legacy.ts' )
0 commit comments