[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"doc-seo-719097-105":3,"detail-sidebar-cat-0-en-105":80,"doc-detail-719097-en":130,"doc-similar-719097":162},{"code":4,"msg":5,"data":6},0,"ok",{"site_id":7,"language":8,"slug":9,"title":10,"keywords":11,"description":12,"schema_data":13,"social_meta":73,"head_meta":75,"extra_data":77,"updated_unix":79},105,"en","breaking-bad-how-compilers-break-constant-time-implementations","Breaking Bad - How Compilers Break Constant-Time Implementations","","Hardened cryptographic libraries rely on defensive programming guidelines to resist timing side-channel attacks, but these protections can fail after compilation. This paper studies how modern compiler optimizations break constant-time implementations derived from defensive source patterns. A large-scale experiment profiles and dynamically analyzes 44,604 targets across multiple CPU architectures. Results show compiler-induced secret-dependent operations in widely deployed hardened libraries, even when source code is formally verified. The study confirms that state-of-the-art defenses remain inadequate when paired with ongoing compiler optimizations.",{"@graph":14,"@context":72},[15,34,55],{"@type":16,"itemListElement":17},"BreadcrumbList",[18,23,27,31],{"item":19,"name":20,"@type":21,"position":22},"https://docshare.wps.com","Home","ListItem",1,{"item":24,"name":25,"@type":21,"position":26},"https://docshare.wps.com/document/","Document",2,{"item":28,"name":29,"@type":21,"position":30},"https://docshare.wps.com/document/research-report/","Research & Report",3,{"item":32,"name":10,"@type":21,"position":33},"https://docshare.wps.com/document/breaking-bad-how-compilers-break-constant-time-implementations/719097/",4,{"url":32,"name":10,"@type":35,"image":36,"author":41,"headline":10,"publisher":44,"fileFormat":47,"inLanguage":8,"description":12,"dateModified":48,"datePublished":49,"encodingFormat":47,"isAccessibleForFree":50,"interactionStatistic":51},"DigitalDocument",{"url":37,"@type":38,"width":39,"height":40},"https://docshare.wps.com/thumbnails/breaking-bad-how-compilers-break-constant-time-implementations/719097.png","ImageObject",300,407,{"name":42,"@type":43},"River Wang","Person",{"url":19,"name":45,"@type":46},"DocShare","Organization","application/pdf","2026-11-22","2026-11-17",true,{"@type":52,"interactionType":53,"userInteractionCount":33},"InteractionCounter",{"@type":54},"ViewAction",{"@type":56,"mainEntity":57},"FAQPage",[58,64,68],{"name":59,"@type":60,"acceptedAnswer":61},"What problem does the paper address about constant-time cryptographic code?","Question",{"text":62,"@type":63},"It investigates how modern compiler optimizations can break constant-time protections introduced at the source level for side-channel resistance.","Answer",{"name":65,"@type":60,"acceptedAnswer":66},"How is the study conducted and how many targets are analyzed?",{"text":67,"@type":63},"The authors run a large-scale experiment using a profiling tool and trace-based dynamic analysis across 44,604 different targets.",{"name":69,"@type":60,"acceptedAnswer":70},"What do the results show for hardened cryptographic libraries?",{"text":71,"@type":63},"Several compiler-induced secret-dependent operations occur in highly regarded hardened libraries even when high-level source code is formally verified to be free of side channels.","https://schema.org",{"og:url":32,"og:type":74,"og:title":10,"og:site_name":45,"og:description":12},"article",{"robots":76,"canonical":32},"index,follow",{"doc_id":78,"site_id":7},719097,1794950262,{"code":4,"msg":81,"data":82},"success",[83,87,91,95,100,105,110,114,119,122,126],{"id":22,"doc_module":4,"doc_module_name":25,"category_name":84,"show_sort_weight":85,"slug":86},"Story & Novel",90,"story-novel",{"id":26,"doc_module":4,"doc_module_name":25,"category_name":88,"show_sort_weight":89,"slug":90},"Literature",80,"literature",{"id":33,"doc_module":4,"doc_module_name":25,"category_name":92,"show_sort_weight":93,"slug":94},"Exam",70,"exam",{"id":96,"doc_module":4,"doc_module_name":25,"category_name":97,"show_sort_weight":98,"slug":99},5,"Comic",60,"comic",{"id":101,"doc_module":4,"doc_module_name":25,"category_name":102,"show_sort_weight":103,"slug":104},6,"Technology",50,"technology",{"id":106,"doc_module":4,"doc_module_name":25,"category_name":107,"show_sort_weight":108,"slug":109},7,"Healthcare",40,"healthcare",{"id":111,"doc_module":4,"doc_module_name":25,"category_name":29,"show_sort_weight":112,"slug":113},8,30,"research-report",{"id":115,"doc_module":4,"doc_module_name":25,"category_name":116,"show_sort_weight":117,"slug":118},9,"Religion & Spirituality",20,"religion-spirituality",{"id":117,"doc_module":4,"doc_module_name":25,"category_name":120,"show_sort_weight":117,"slug":121},"World Cup","world-cup",{"id":123,"doc_module":4,"doc_module_name":25,"category_name":124,"show_sort_weight":123,"slug":125},10,"Lifestyle","lifestyle",{"id":127,"doc_module":4,"doc_module_name":25,"category_name":128,"show_sort_weight":96,"slug":129},19,"General","general",{"code":4,"msg":81,"data":131},{"doc_id":78,"user_id":132,"nickname":42,"user_avatar":133,"doc_module":4,"category_id":111,"category_name":29,"doc_title":10,"doc_description":12,"doc_content":134,"file_id":135,"file_url":136,"file_type":137,"file_size":138,"view_count":33,"is_deleted":4,"is_public":22,"is_downloadable":22,"audit_status":22,"page_count":139,"language":140,"language_code":8,"site_id":7,"html_lang":8,"table_of_contents":141,"faqs":142,"seo_title":143,"seo_description":12,"update_tm":79,"read_time":144,"preview_page_count":33,"preview_urls":145},1099514067438,"https://ap-avatar.wpscdn.com/avatar/100002539ee87300030?x-image-process=image/resize,m_fixed,w_180,h_180&k=1780474512215547542","Breaking Bad: How Compilers Break Constant-Time  \nImplementations  \nMoritz Schneider  \nETH Zurich Zurich, Switzerland moritz.schneider@inf.ethz.ch  \nDaniele Lain  \nETH Zurich Zurich, Switzerland [daniele.lain@inf.ethz.ch](daniele.lain@inf.ethz.ch)  \nIvan Puddu  \nETH Zurich Zurich, Switzerland [ivan.puddu@inf.ethz.ch](ivan.puddu@inf.ethz.ch)  \nNicolas Dutly  \nETH Zurich Zurich, Switzerland [nicolas.dutly@inf.ethz.ch](nicolas.dutly@inf.ethz.ch)  \nSrdjan Capkun  \nETH Zurich Zurich, Switzerland [srdjan.capkun@inf.ethz.ch](srdjan.capkun@inf.ethz.ch)  \nAbstract  \nThe implementations of most hardened cryptographic libraries use defensive programming techniques for side-channel resistance. These techniques are usually specified as guidelines to developers on specific code patterns to use or avoid. Examples include performing arithmetic operations to choose between two variables instead of executing a secret-dependent branch. However, such techniques are only meaningful if they persist across compilation. In this paper, we investigate how optimizations used by modern compilers break the protections introduced by defensive programming techniques. Specifically, how compilers break high-level constant-time implementations used to mitigate timing side-channel attacks. We runa large-scale experiment to see if such compiler-induced issues manifest in state-of-the-art cryptographic libraries. We develop a tool that can profile virtually any architecture, and we use it to run trace-based dynamic analysis on 44,604 different targets. Particularly, we focus on the most widely deployed cryptographic libraries, which aim to provide side-channel resistance. We are able to evaluate whether their claims hold across various CPU architectures, including x86-64, x86-i386, armv7, aarch64, RISC-V, and MIPS-32 .  \nOur large-scale study reveals that several compiler-induced secretdependent operations occur within some of the most highly regarded hardened cryptographic libraries – even when the high-level source code was formally verified to be free of side channels. To the best of our knowledge, such findings represent the first time these issues have been systematically observed in the wild and provide concrete data confirming previous speculations about defensive programming techniques’ limitations. One of the key takeaways of this paper is that the state-of-the-art defensive programming techniques employed for side-channel resistance are still inadequate, incomplete, and bound to fail when paired with the optimizations that compilers continuously introduce.  \nCCS Concepts  \n• Security and privacy → Systems security; Software and application security.  \nThis work is licensed under a Creative Commons Attribution 4 .0 International License. ASIA CCS’25, Hanoi, Vietnam  \n© 2025 Copyright held by the owner/author(s) .  \nACM ISBN 979-8-4007-1410-8/25/08  \n[https://doi.org/10.1145/3708821.3733909](https://doi.org/10.1145/3708821.3733909)  \nKeywords  \nConstant time code, cryptographic implementations, compilers  \nACM Reference Format:  \nMoritz Schneider, Daniele Lain, Ivan Puddu, Nicolas Dutly, and Srdjan Capkun. 2025. Breaking Bad: How Compilers Break Constant-Time Implementations. In ACM Asia Conference on Computer and Communications Security (ASIA CCS’25), August 25–29, 2025, Hanoi, Vietnam. ACM, New York, NY, USA, 17 pages. [https://doi.org/10.1145/3708821.3733909](https://doi.org/10.1145/3708821.3733909)  \n1 Introduction  \nSince the discovery of timing attacks [24], side-channel vulnerabilities have been one of the major concerns for developers of security-critical code and libraries [21] . Particular attention and expert knowledge are devoted to avoiding side-channel issues insecurity-critical libraries. Three main hardening techniques approaches are generally followed: i) manual assembly hardening, ii) using special compilers that provide constant time guarantees, and iii) hardening the source code. However, all of these approaches suffer from practical l","cbCaia9PsOy8Rcg5","https://ap.wps.com/l/cbCaia9PsOy8Rcg5","pdf",1482192,17,"English","# Abstract\n# Introduction\n## Timing attacks and side-channel hardening techniques\n## Limitations of manual assembly hardening\n## Limits of special compilers with constant-time guarantees\n## Defensive programming with commodity compilers and re-introduced leakage","[{\"question\":\"What problem does the paper address about constant-time cryptographic code?\",\"answer\":\"It investigates how modern compiler optimizations can break constant-time protections introduced at the source level for side-channel resistance.\"},{\"question\":\"How is the study conducted and how many targets are analyzed?\",\"answer\":\"The authors run a large-scale experiment using a profiling tool and trace-based dynamic analysis across 44,604 different targets.\"},{\"question\":\"What do the results show for hardened cryptographic libraries?\",\"answer\":\"Several compiler-induced secret-dependent operations occur in highly regarded hardened libraries even when high-level source code is formally verified to be free of side channels.\"}]","Breaking Bad - How Compilers Break Constant-Time Implementations | PDF",43,[146,150,154,158],{"page_no":22,"url":147,"width":148,"height":149},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-18/074410885ffa36b2ab352cb27257772f.webp",983,1272,{"page_no":26,"url":151,"width":152,"height":153},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-18/92f456b1011401097f81884c32671017.webp",982,1270,{"page_no":30,"url":155,"width":156,"height":157},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-18/dea7e01662fd0d7e57e3a0c36b358e9f.webp",981,1269,{"page_no":33,"url":159,"width":160,"height":161},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-18/c4115b2a01f2800c79b9754e8c5dc7aa.webp",980,1268,{"list":163,"token":11},[164,171,177,183,190,197,204,210,217,223],{"doc_id":165,"doc_title":166,"file_type":137,"home_preview_img_url":167,"slug":168,"view_count":169,"category_name":29,"create_tm":170},84867,"LibFHE: 一款基于 Numba 的 CUDA-Python 库，用于在 GPU 上实现非 RNS CKKS-BGV 全同态加密","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229809214325/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110979&Signature=zQCrwgMwxuGk6%2F9xXSHqyQX5uUs%3D","libfhe-a-numba-based-cuda-python-library-for-non-rns-ckks-bgv-fully-homomorphic-encryption-on-gpus",28,1784198916,{"doc_id":172,"doc_title":173,"file_type":137,"home_preview_img_url":174,"slug":175,"view_count":111,"category_name":29,"create_tm":176},341727,"Optimize data-driven multi-agent simulation for COVID-19 transmission - Research paper","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229910568226/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110979&Signature=FL6x3ETdS%2BMIs%2FdwYEkn8w4SMLY%3D","optimize-data-driven-multi-agent-simulation-for-covid-19-transmission-research-paper",1790043409,{"doc_id":178,"doc_title":179,"file_type":137,"home_preview_img_url":180,"slug":181,"view_count":33,"category_name":29,"create_tm":182},698132,"Taking GPU Programming Models to Task for Performance Portability","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230010206041/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110979&Signature=3J6%2FdnzifyHY0LLaHz%2FZ8CbODng%3D","taking-gpu-programming-models-to-task-for-performance-portability",1794448701,{"doc_id":184,"doc_title":185,"file_type":137,"home_preview_img_url":186,"slug":187,"view_count":188,"category_name":29,"create_tm":189},327178,"Understanding Agent-Based Patching of Compiler Missed Optimizations","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229908477390/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110979&Signature=dfDEPjGC1c6UTn40D1ZLSmcdlUY%3D","understanding-agent-based-patching-of-compiler-missed-optimizations",23,1789976597,{"doc_id":191,"doc_title":192,"file_type":137,"home_preview_img_url":193,"slug":194,"view_count":195,"category_name":29,"create_tm":196},290377,"Dynamic Resource Scaling for Microservices - A Machine Learning-driven Predictive Approach - MSc Research Project","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229903055605/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110979&Signature=v3mRVwlluBk0Bw4ptQMnsmNmBi4%3D","dynamic-resource-scaling-for-microservices-a-machine-learning-driven-predictive-approach-msc-research-project",12,1789641525,{"doc_id":198,"doc_title":199,"file_type":137,"home_preview_img_url":200,"slug":201,"view_count":202,"category_name":29,"create_tm":203},84202,"Finding and Understanding Miscompilation Bugs in the Solidity Compiler","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229809033049/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110979&Signature=lvauq895w7kJ%2B%2F6dZfo0WyF7q4Q%3D","finding-and-understanding-miscompilation-bugs-in-the-solidity-compiler",25,1784193910,{"doc_id":205,"doc_title":206,"file_type":137,"home_preview_img_url":207,"slug":208,"view_count":30,"category_name":29,"create_tm":209},685898,"CommBench - Micro-Benchmarking Hierarchical Networks with Multi-GPU, Multi-NIC Nodes","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230000265127/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110979&Signature=rdoog4YZZiSdwFXd%2BrQOooakTs4%3D","commbench-micro-benchmarking-hierarchical-networks-with-multi-gpu-multi-nic-nodes",1794021623,{"doc_id":211,"doc_title":212,"file_type":137,"home_preview_img_url":213,"slug":214,"view_count":215,"category_name":29,"create_tm":216},31760,"Hardware Security Modules for Secure Communications in the Industrial Internet of Things","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229748474374/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110979&Signature=NH5xHjAFaOz3xJhJ3RJ5luluY%2F4%3D","hardware-security-modules-for-secure-communications-in-the-industrial-internet-of-things",46,1780088517,{"doc_id":218,"doc_title":219,"file_type":137,"home_preview_img_url":220,"slug":221,"view_count":169,"category_name":29,"create_tm":222},86036,"RED-Sphere Hyperspherical Residual Edge Debiasing for Cross-Population Fundus Disease Domain Generalization","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229809499446/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110979&Signature=j3Ctlx%2B%2FnsNsv2cV9CDxMyVn288%3D","red-sphere-hyperspherical-residual-edge-debiasing-for-cross-population-fundus-disease-domain-generalization",1784207990,{"doc_id":224,"doc_title":225,"file_type":137,"home_preview_img_url":226,"slug":227,"view_count":228,"category_name":29,"create_tm":229},85662,"Continual Test-Time Adaptation in Computer Vision","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229809340387/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110979&Signature=8eAJIOV6IiMyb4diEYNjYyuarbU%3D","continual-test-time-adaptation-in-computer-vision",26,1784205440]