Skip to content

Commit

Permalink
Optimize KeyRotationFacade a tiny bit
Browse files Browse the repository at this point in the history
tutadb#1940
  • Loading branch information
vitoreiji committed Jan 17, 2025
1 parent 3667db6 commit e590abb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/common/api/worker/facades/KeyRotationFacade.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1237,18 +1237,19 @@ export class KeyRotationFacade {
},
}

const groupManagementFacade = await this.groupManagementFacade()

// distribution for all other admins using their distribution keys
for (const distributionKey of distributionKeys) {
// we do not distribute for ourselves
if (isSameId(distributionKey.userGroupId, user.userGroup.group)) continue
// verify authenticity of this distribution key
// reproduce hash

const distributionKeyAuthenticationData = this.keyAuthenticationFacade.generatePubDistKeyAuthenticationData(
distributionKey.pubEccKey,
distributionKey.pubKyberKey,
)

const groupManagementFacade = await this.groupManagementFacade()
const targetUserGroupKey = await groupManagementFacade.getCurrentGroupKeyViaAdminEncGKey(distributionKey.userGroupId)

const adminDistAuthKey = this.keyAuthenticationFacade.deriveAdminGroupDistKeyPairAuthKeyForMultiAdminRotation(
Expand Down

0 comments on commit e590abb

Please sign in to comment.