-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #100 from zkemail/rsa-pk-hash
Hash RSA public key in circuit
- Loading branch information
Showing
53 changed files
with
2,728 additions
and
2,128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,70 +1,18 @@ | ||
Return-path: <[email protected]> | ||
Original-recipient: rfc822;[email protected] | ||
Received: from ci74p00im-qukt09071102.me.com by p59-mailgateway-smtp-6776dc6585-266mm (mailgateway 2318B155) | ||
with SMTP id 4bbe59e4-9423-43ff-9c6e-d47053303967 | ||
for <[email protected]>; Thu, 22 Jun 2023 20:02:52 GMT | ||
X-Apple-MoveToFolder: INBOX | ||
X-Apple-Action: MOVE_TO_FOLDER/INBOX | ||
X-Apple-UUID: 4bbe59e4-9423-43ff-9c6e-d47053303967 | ||
Received: from pv50p00im-ztdg10012001.me.com (pv50p00im-ztdg10012001.me.com [17.58.6.51]) | ||
by ci74p00im-qukt09071102.me.com (Postfix) with ESMTPS id 491294B00172 | ||
for <[email protected]>; Thu, 22 Jun 2023 20:02:47 +0000 (UTC) | ||
X-ICL-SCORE: 3.233003230041 | ||
X-ICL-INFO: GAtbVUseBFFGSVZESgMGUkFIRFcUWUIPAApbVRYSFhEAREQZF15TQFUcAkpaQ1cOEBwKNxVVGAEa | ||
FERXHlQLQBgcSBQXXRRCBhAWSloBAUxAQUhBVgUHQFURAxsXDRQSA0xWB0gAXw9YAxITHwEGUkRL | ||
VkdJHlsHWxoJGloQRhYHREQHDgUGEkVJDxpVSkIGEkhWR0kCBlJEVwsSVlNZD1dZAhNFElsHWxoJ | ||
GloQWwsRRERLPnEOUENMVUBVAAYgM1RSQ0x1GyBNSyJaTQZzIEBPIEE+AwFTNRQDWRtfW1xXWRQU | ||
RRJFAxkcAxs4Q1cOEBwKWQBJTEA= | ||
Authentication-Results: bimi.icloud.com; bimi=declined | ||
X-ARC-Info: policy=fail; arc=none | ||
Authentication-Results: arc.icloud.com; arc=none | ||
Authentication-Results: dmarc.icloud.com; dmarc=pass header.from=me.com | ||
X-DMARC-Info: pass=pass; dmarc-policy=quarantine; s=r0; d=r1; pdomain=me.com | ||
X-DMARC-Policy: v=DMARC1; p=quarantine; rua=mailto:[email protected]; ruf=mailto:[email protected]; | ||
Authentication-Results: dkim-verifier.icloud.com; | ||
dkim=pass (2048-bit key) header.d=me.com [email protected] header.b=FpmCwgC9 | ||
Authentication-Results: spf.icloud.com; spf=none (spf.icloud.com: [email protected] does not designate permitted sender hosts) smtp.mailfrom=[email protected] | ||
Received-SPF: none (spf.icloud.com: [email protected] does not designate permitted sender hosts) receiver=spf.icloud.com; client-ip=17.58.6.51; helo=pv50p00im-ztdg10012001.me.com; envelope-from=[email protected] | ||
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=1a1hai; | ||
t=1687464166; bh=FxfpVjf51msd35Z/BVrd7Uv2GcGRjxaW9dGr90Y2M88=; | ||
h=From:Content-Type:Mime-Version:Subject:Message-Id:Date:To; | ||
b=FpmCwgC9dKuHA2BXHuO6Ujfls+b5psK4yurk9TkR9Q2rpH8ahp6XDuDRQW/8mucud | ||
kIoudejHdNfXqUpWzmtcVCff+cWyzBJarYt8YKgPKQZ3f+UZqXMPJ7t1sZbIJkSU7n | ||
zTiXh+F7KX/kIsJ1vUHnf40EsULPMU2CUSdBxvHpH4C2+MiVcx/mazLdh9BlpKavwY | ||
QMl3uEDcH/blpvK7YRFn3eYpFL8TkS819/aBUcQg6aGZMJrGsr+cQFCsPmXTPHbxBD | ||
LUnk7BUdzdvIwPDnOOrFJIf6JCbJd1rWIiGy3ZOP67+h79eHkQPcZxl/fq0BFQypPq | ||
TOvKhhMsQAmHw== | ||
Received: from smtpclient.apple (pv50p00im-dlb-asmtp-mailmevip.me.com [17.56.9.10]) | ||
by pv50p00im-ztdg10012001.me.com (Postfix) with ESMTPSA id A9258A01A4 | ||
for <[email protected]>; Thu, 22 Jun 2023 20:02:44 +0000 (UTC) | ||
From: Saleel <[email protected]> | ||
Content-Type: text/plain; | ||
charset=us-ascii | ||
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=icloud.com; s=1a1hai; t=1693038337; bh=7xQMDuoVVU4m0W0WRVSrVXMeGSIASsnucK9dJsrc+vU=; h=from:Content-Type:Mime-Version:Subject:Message-Id:Date:to; b=EhLyVPpKD7d2/+h1nrnu+iEEBDfh6UWiAf9Y5UK+aPNLt3fAyEKw6Ic46v32NOcZD | ||
M/zhXWucN0FXNiS0pz/QVIEy8Bcdy7eBZA0QA1fp8x5x5SugDELSRobQNbkOjBg7Mx | ||
VXy7h4pKZMm/hKyhvMZXK4AX9fSoXZt4VGlAFymFNavfdAeKgg/SHXLds4lOPJV1wR | ||
2E21g853iz5m/INq3uK6SQKzTnz/wDkdyiq90gC0tHQe8HpDRhPIqgL5KSEpuvUYmJ | ||
wjEOwwHqP6L3JfEeROOt6wyuB1ah7wgRvoABOJ81+qLYRn3bxF+y1BC+PwFd5yFWH5 | ||
Ry43lwp1/3+sA== | ||
from: [email protected] | ||
Content-Type: text/plain; charset=us-ascii | ||
Content-Transfer-Encoding: 7bit | ||
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.500.231\)) | ||
Subject: Test email subject | ||
Message-Id: <[email protected]> | ||
Date: Fri, 23 Jun 2023 01:32:20 +0530 | ||
To: Saleel <[email protected]> | ||
X-Mailer: Apple Mail (2.3731.500.231) | ||
X-Proofpoint-GUID: MU47Y4dCOAohatJZW3Su6CexM6uUt94W | ||
X-Proofpoint-ORIG-GUID: MU47Y4dCOAohatJZW3Su6CexM6uUt94W | ||
X-MANTSH: 1TEIXSUMdHVoaGkNHB1tfQV4aEhoTGxsaGBEKTEMXGxoEGxwSBBscGgQfGhAbHho | ||
fGhEKTFkXGx8ZEQpZRBdsUm5CHktdTXIFbxEKWU0XZEVETxEKWUkXGRxxGwYdG3cGEh0GGgYaB | ||
hoGGRpxGxAadwYaBhoGGgYaBhoGGnEaEBp3BhoRClleF2xseREKQ04XZ38eHXMeTmlla0VCS15 | ||
gcH0ZeV8caU9SZxxff14THn0RClhcFxkEGgQfGgUbGhoEEhgEHhgEGBIQGx4aHxoRCl5ZF0hTQ | ||
RhsEQpNXBcaEQpMWhdoaU1raxEKTEYXTWsRCkNaFxsdBB8SBBwEHxsRCkJeFxsRCkJcFxsRCl5 | ||
OFxsRCkJLF2xwYHlAHWJSaRpiEQpCSRdscGB5QB1iUmkaYhEKQkUXbllZcnNAGl1aGF4RCkJOF | ||
2xwYHlAHWJSaRpiEQpCTBdgTVt4G1BffxhwZxEKQm4XbWVwG0JrYh5eZlwRCkJsF2h7YBNtbBh | ||
JfU4dEQpCQBdufWFrHURjemEFHxEKQlgXemEZYklYHBwYWk8RCk1eFxsRClpYFxgRCnBoF2RMR | ||
20YaAEeBXJpEBkaEQpwbBdpRhJHa2Bzb1NHZhAZGhEKbX4XGxEKWE0XSxE= | ||
X-CLX-Shades: None | ||
X-Proofpoint-Virus-Version: =?UTF-8?Q?vendor=3Dfsecure_engine=3D1.1.170-22c6f66c430a71ce266a39bfe25bc?= | ||
=?UTF-8?Q?2903e8d5c8f:6.0.425,18.0.790,17.0.605.474.0000000_definitions?= | ||
=?UTF-8?Q?=3D2022-01-13=5F02:2022-01-11=5F01,2022-01-13=5F02,2020-01-23?= | ||
=?UTF-8?Q?=5F02_signatures=3D0?= | ||
X-Proofpoint-Spam-Reason: safe | ||
Subject: Hello | ||
Message-Id: <[email protected]> | ||
Date: Sat, 26 Aug 2023 12:25:22 +0400 | ||
to: [email protected] | ||
|
||
Hello | ||
Hello, | ||
|
||
How are you doing? | ||
How are you? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.9; | ||
|
||
import "@openzeppelin/contracts/access/Ownable.sol"; | ||
|
||
/** | ||
A Registry that store the hash(dkim_public_key) for each domain | ||
The hash is calculated by taking Poseidon of DKIM key split into 9 chunks of 242 bits each | ||
*/ | ||
contract DKIMRegistry is Ownable { | ||
// Mapping from domain name to DKIM public key hash | ||
mapping(string => uint256) public dkimPublicKeyHashes; | ||
|
||
constructor() { | ||
// Set values for popular domains | ||
dkimPublicKeyHashes["gmail.com"] = uint256(20579775636546222313859320423592165398188168817714003219389601176739340973605); | ||
dkimPublicKeyHashes["hotmail.com"] = uint256(2750248559912404074361997670683337416910370052869160728223409986079552486582); | ||
dkimPublicKeyHashes["twitter.com"] = uint256(12431732230788297063498039481224031586256793440953465069048041914965586355958); | ||
dkimPublicKeyHashes["ethereum.org"] = uint256(13749471426528386843484698195116860745506750565298853141220185289842769029726); | ||
dkimPublicKeyHashes["skiff.com"] = uint256(11874169184886542147081299005924838984240934585001783050565158265014763417816); | ||
} | ||
|
||
function _stringEq(string memory a, string memory b) internal pure returns (bool) { | ||
return keccak256(abi.encodePacked(a)) == keccak256(abi.encodePacked(b)); | ||
} | ||
|
||
function getDKIMPublicKeyHash( | ||
string memory domainName | ||
) public view returns (uint256) { | ||
return dkimPublicKeyHashes[domainName]; | ||
} | ||
|
||
function setDKIMPublicKeyHash( | ||
string memory domainName, | ||
uint256 publicKeyHash | ||
) public onlyOwner { | ||
dkimPublicKeyHashes[domainName] = publicKeyHash; | ||
} | ||
} |
Oops, something went wrong.